Using an addressable chip to drive mosfets (non addressable LEDs) using Teensy

dimitre

Well-known member
I'm working on a project that uses an addressable LED chip (UCS8904B) to drive mosfets with non addressable LEDs.
After everything assembled I've discovered some heavy interference when using Teensy and a level shifter to make the data signal work with 5v.

Curiously when using Arduino Uno R3 the signal is 100% good, no interference.

I've noticed the interference is greatly reduced if I slow down the data transfer from 800khz to 400khz (it seems the chip tolerates everything between 300khz and a little more than 1000)
interference is heavier if I use dimmer animations.
I suppose the PWM itself is interfering with data integrity, but I'm puzzled with the fact that Arduino is not affected.
Thank you
 
Dimitre,

Disclaimer... I am very new to microcontrollers, software, hardware, ect... I have very little experience and no right to give advice... So basically talking out of the side of my mouth...
In one data sheet for your UCS8904B chip I see there is a recommendation to add a 104 ??? capacitor to the power and ground. "To be used to reduce interference". Have you added these?
In the couple of T4.1 projects I have had, I also add them to the Power and ground. also Look at your voltage level shifter and see if they also recommend this.
Check to see if the voltage level shifter has the ability to go as fast as 800khz.
I tried to figure out the communication protocol but I did not understand what it was ... So is this just sending 16 bits over one wire similar to a shift register??? although the shift register uses a clock and enable...
and finally the interference is verified by a scope or by gut? If you have a scope post a screen shot of the signals before and after the level shifter.
 
Nice, thanks for all the tips.
yes board has the capacitor specified in datasheet
This LED protocol is identical to ws2812, but it only changes the packet size (64 bits, 16 bits each channel RGBW)
I've bought one oscilloscope to inspect this and it will arrive next week, so I will have a better understanding
 
When you get it post a screenshot. I have struggled just recently with noise, so I am just curious what your will look like and what it takes to resolve it.
 
What level shifter are you using? Can you post schematics or something that gives us some indication as to how things are hooked up?
I am assuming that the level shifter isn't in effect an open drain output with a pullup, if that is the case then it may simply need a stronger pull up.

Noise issues at this sort of speed is almost always poor power or ground connections or environmental effects.
Environmental is normally easy to rule out. Is this close to any motors or anything with coils/sparks/electromagnets? If so does the problem go away when that's turned off?

Check you have short power connections with a capacitor to ground on every IC power pin. Ensure you have a good solid ground connections between everything.
 
Is the level shifter unidirectional or bidirectional?

Many people have reported problems with the bidirectional types. The ones with a small mosfet and 2 resistors are too slow and distort the waveform, because the rise time is much worse than fall time. The TXS types often work better, but if using long wires or other non-ideal conditions, the direction detect circuitry can get confused which gives wrong results at seemingly random times.

The other common issue, again usually a bigger problem with "long" wires, is the faster signals Teensy can output. Usually adding a 100 ohm resistor between the Teensy pin and the long wire it's driving solves the problem. Using shielded cables or twisted pairs where ground stays close to the signal can also help.
 
Thank you for the info.
I'm using three different ones but I suppose they are all the same.
one of them I know to be bi-directional, the other one is the BSS138 J1

Knowing that the bi-directional can be the issue I'll now try this 74AHCT125, because I have three available here.
 
Only one warning about this chip: datasheet show the pins in relation to the dot (circle) on the chip, but in reality they are in relation to the notch. the dot is on the opposite (and wrong) side.
 
Back
Top