Is it possible to add another SPI Device? I would like to add a NRF24 wireless transmitter which is a SPI device. The pi has two chip select pins which are not used for some reason.
Use SPI Chip Select
- ScarletStar
- Erledigt
-
-
Are you sure it's not used by the software ?
The hardware required is probably just 1 transistor to isolate the clock line .
-
-
That sort of thing - pnp transistors make my head hurt - I always feel the need to stand on my head.
You definitely need a resistor on the base - maybe 1k
And standing on my head says your pull up resistor should be pull down
-
Btw - what is your led strip ?
-
It's a WS2801.
After looking though the inventory of a local store I will probably use a IRLML6401 MOSFET
Would a gate resistor of 10Ohm be reasonable?
And you're right, it has to be a pull down resistor. -
I don't think a mosfet needs a gate resistor - they're voltage controlled aren't they ?
I wouldn't run this very fast - the switch off and fall time seem quite slow
-
Isn't it more to dampen the ringing that might occur because of the resonator that's made up of the gate capacity and the wiring inductivity? Probably doesn't really matter in this case, you're right.
Thanks. I'll try this and post back with the results.
-
I've done some playing too...
Using an N channel mosfet as a level shifter with a 10k pull-up.
It doesn't work - the rise time is far too slow. I'll try changing it to 1k or 470 and let you know how it goes
-
1k pull-up for me works much better
-
I've tried it and for now it doesn't work. The first LED ist erratically setting colors while the rest stays dark.
When I set it to clear in hypercon. It switches off the first led after a delay of several seconds. When I set a certain color it cycles through all sorts of colors. So it's obviously communicating. I don't have an oscilloscope to really look into the signal unfortunately.I'm using a 1k pull down. Using the CE1 pin on the raspberry. The other spi device on CE0 is not wired up yet.
When setting spidev0.0 in the config, all LEDs stay dark. So that part seems to work.I've set the baudrate to 122000. So a clock cycle should be around 8ms.
The datasheet of the transistor states a Turn-On Delay Time of 11ns and a 250ns Turn-Off Delay Time
Also a rise time of 32 ns and fall time of 210ns.Any thoughts what might be the issue?
-
Won't it be 8 uSec ?
Did you use a gate resistor ? I didn't.
If you did, that will form an RC network and slowly down too.Triple checked the pinout and your writing ?
-
Yes I have.
Could it be the little extra voltage drop by R_DS(on)?
As the WS2801 is not really rated for operation at 3.3V. It worked without the Transistor, but that might have just been the little extra drop for it to not work anymore? -
Do you have some 74hctxx chips lying around ?
You could use some of them as a gated level shifter.
I used a 74hct138 as a level shifter and tied it's 3 enable lines high and low to force it on but could just as easily connected one of them to CE0 or 1
-
-
At 3.3v vcc yes
If you want to also benefit from a reliable level shifter you really need the "T"
The ahc/hoc have cmos level inputs and the threshold for "1" is 0.7xVCC = 3.5v and this is higher than the 3,3v gpio outputs.
The "T" variants are TTL compatible and have the threshold at about 2v
If you have a non "T" on hand, power it from 5v but use a diode to drop it to about 4.3v vcc.
This gives you a "1" threshold of 0.7x4.3 = 3.01v -
Oh and don't forget a pull-up on the data lines to the strip cos when the 125 is not enabled the outputs will be open/floating and will pick up noise.
-
Thanks for the heads up. I'll go get one
-
Finally got around to it. And good news it seems to work. So it seems like the 3.3V were in fact the problem.
At least without the other SPI channel being used.
I'll report back once I get that NRF24 chip working for a final conclusive green light.Thanks a lot for the suggestion with the 74HCT
-
Excellent !
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!