- Tue Apr 06, 2010 7:04 pm
#97923
I have two SPI button boards hooked up to an atmega164p.
I found that when I pulled CS low in between frames like the data sheet says, it didn't work. When I kept CS high for the duration of both boards' frames of data, it lit up properly, so that's what I'm doing.
Now I'm trying to get button feedback and failing.
I've soldered 2-pin headers on the Input and Output of both boards, and I've tried both running a wire from b.0 output to b.1 input, and the other way around. No dice. I've tried taking the output from the MOSI of b.0 and instead from the MOSI of b.1, still doesn't work. The datasheet seems to contradict itself. Can anyone straighten me out?
* *
On the datasheet contradicting itself, here's what it says:
Code: Select all
I've successfully convinced both of them that they're in a two-board system (i.e. LED 1 lights up at startup). I can send signals for the lights and make either or both boards light up. I've numbered them in the illustration above according to which frame of data they respond to. /--------\ /--------\
|MOSI -- MISO | | | |
AVR |MISO -- MOSI | b.1 |E =| b.0 |
| SCK -- SCK | |E =| |
| CS -- CS | | | |
\--------/ \--------/
I found that when I pulled CS low in between frames like the data sheet says, it didn't work. When I kept CS high for the duration of both boards' frames of data, it lit up properly, so that's what I'm doing.
Now I'm trying to get button feedback and failing.
I've soldered 2-pin headers on the Input and Output of both boards, and I've tried both running a wire from b.0 output to b.1 input, and the other way around. No dice. I've tried taking the output from the MOSI of b.0 and instead from the MOSI of b.1, still doesn't work. The datasheet seems to contradict itself. Can anyone straighten me out?
* *
On the datasheet contradicting itself, here's what it says:
The red line illustrates the feedback wire. This must be added by the user, and is required for button status feedback. To add this wire to your system, simply solder a wire from the OUTPUT 2 pin header of the last board in your system, to the INPUT 2 pin header of the first board in your system. The last board of your system is the one that receives an input from another board, but doesn't send an output; while the first board in the system is that one that outputs data to another board but doesn't receive an input. If a feedback wire is not connected to the system you will not receive the button status of the system.In the picture (which I can't duplicate here), the wire is yellow not red, and it looks to be going from the (2-pin) INPUT of the USB button pad (board #2, highest numbered is the last board, right?) to the (2-pin) OUTPUT of board #0 (first board). The last board in the picture (#2) is the one which has a board connected to its (7-pin) Output header, but none connected to its (7-pin) Input header.