Main Site Documentation

Cerberus + Ethernet + LedStrip


#1

Hello everyone,

OK, I got a weird problem and I’m surely missing something. Maybe I’m still high from my trip at Amsterdam.

Here my setup:

  • The latest SDK
  • A cerberus with latest firmware
  • A ENC28 module on the pin 6
  • An extender on pin 5 with the LPD8806 led strip.

My program get some information from the WebServer, and send what to switch on/off to the led strip.

I tested, the web server works good.

But the led strip is totally out of control.

First, when I initialize it, I switch off the led. And it’s always all white and always switch on.

I checked with 4 differents code source, all with different implementation. All the same.

So, I tried my code deleting all the ethernet part, and removing the ENC28 module.
And it works. Almost. After almost one second I got the 4 first led in white.

So, I see 2 problems :

  • Why the ethernet module disturb the led strip writes ? I remember Gus talking about a bad design with pin 5 and 6, but I’m not sure it’s related.

  • Why after a little time, I got the first leds switch on ? I checked my code, I never write something. Do I need to always writes a array of zero values ?

Thanks in advance for your help.


#2

You need to add chip select to your led strip. Simple and gate will do, like we have on feztive.


#3

I’m not sure to understand.
I’m using the SPI from Gadgeteer.Interfaces namespace

Do you mean the first boolean value in the SPI.configuration constructor ?


#4

This was what Gus means - use a “AND Gate” IC to create a CS pin


#5

Erf, ok, now you totally lost me… Why do I need an AND Gate ?

The LedStrip I have is the one from AdaFruit, and in all the tutorials I read, I never saw talk about adding IC.

Even with the DaveDurant code.
What I’ve missed ?


#6

Those led strips don’t have a chip select pin so you cannot share them on a spi bus, they need exclusive access.

if you want to plug in other devices on the same spi bus like the ethernet you need to add a chip select circuit to the led strip. You do this by adding the and gate to mimic a chip select.


#7

(not a smart a$$ question, a genuine inquiry)
What if you don’t plug in other SPI devices, is the And gate still needed?


#8

The answer is in the text you quoted - if you want to SHARE access to the SPI bus, you need a CS. So if you don’t want to SHARE access, you don’t need a CS.


#9

Gotcha … I’ve never played with SPI or the like, so I am in sponge mode :wink:


#10

@ Justin - Haaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ok, now I understand. So I learnt something very interesting.

So for what I understand (sorry if it’s a recurring topic), socket 5 and 6 share the same SPI, and the led strip is receiving signals from the enc28 module, am I right ?

OK I got some reading with Google, now it’s more clear.

Does a “single input and gate” enough for me ? (the model 741G08 said wikipedia)

I’m looking the one @ Justin gave but I don’t find it in shop where I live… I thought I could get one this WE… snif…


#11

I thought a 741G08 is a single AND gate with two inputs?? An AND gate technically has to have two inputs.

If you want it this weekend, what can you get ? What shops do you have access to? Remember that a logic gate like this just has a truth table based on it’s inputs, so you can find ways to achieve the same thing if you want… NAND gates are awesome for doing this. http://en.wikipedia.org/wiki/NAND_logic shows how to generate different equivalent circuits with NAND.


#12

@ Brett - Hi, thanks, but I need to go to a shop, because at home, actually, I have nothing, not even a resistor…

Anyway, I found a shop nearby, I’ll go for a CMOS4082 if I’ve understood well.

Thanks everyone. I think it’s really time to get out all my school books…


#13

@ Exasperant - what shop are you going to, and if they have a website we can point something out…

don’t forget to get some 0 1uf caps as well.

you wont want the one from my schematic as its not prototype friendly, read small…


#14

@ Justin - I’ll buy this http://www.selectronic.fr/c/composants-electroniques/composants-actifs/circuits-logiques-peripheriques/circuit-cmos-4xxx/circuit-logique-cmos-4081.html
I choose reading this wikipedia entry : http://en.wikipedia.org/wiki/List_of_4000_series_integrated_circuits

(Lucky I just verified the datasheet, I was buying the 4082 which is not good)

I note for the capacity, so 0.1µF is enough ?

UPDATE:
(I’m trying to understand the schematic of the feztive module)


#15

The 0.1uf is a decoupling cap you place next to the and gate across vcc and gnd.

look forward to hearing and seeing your progress.


#16

Just to be sure, to the input gate, you go with the pin6 of the extender (CS) and pin 7 (mosi) or pin6 and pin 9 (clk) ?