Page 1 of 1

SPI reading

Posted: Thu Feb 14, 2013 11:21 pm
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

Re: SPI reading

Posted: Sun Feb 24, 2013 10:00 am
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.