SPI reading

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
Flouch
Posts: 29
Joined: Thu Oct 18, 2012 10:19 am
Has thanked: 6 times
Been thanked: 1 time
Contact:

SPI reading

Post by Flouch »

HI, i try to read some register in SPI, the problems is i always got 255 in value in my LCD (not in simulation). Whereas when I look at the oscilloscope my slave is sending the data i need. My problems is i can't do something with this data like my PIC don't understand.

Image
Here is the screen : - yellow clock - blue master - purple slave. So my program works i can read but i can't acces this data

So i don't understand why the value don't go in my LCD.
Below my program
thanks
Attachments
Flowcode1.fcf
S
(13.23 KiB) Downloaded 250 times

Kenrix2
Flowcode v5 User
Posts: 211
Joined: Tue Feb 19, 2013 9:51 pm
Has thanked: 72 times
Been thanked: 177 times
Contact:

Re: SPI reading

Post by Kenrix2 »

Looking at your nice picture it seems that the purple line is lifted up enough to trip the transistors to an on state, which would give you the 255 value. Try a 4.7k ohm pull down resistor on that data line. Just connect one end to that data line and the other to ground. As a rule I try to keep a low line below .5 volts. Reading your data it looks like the yellow line is 10100011=A3=163 and the purple is trying to be 11101010=EA=234, but the zero's are so high level it is read as all one's=FF=255. I wish i had your equipment, all i have is the logic tool on a pickit2 and a digital volt meter. Good luck on your project.

Post Reply