Sunday, May 4, 2008

SSP/SPI

I spent the evening reacquainting myself with the SPI interface. The goal was to create an SPI PIC debugger with the E128 slaved to displaying information from the PIC. I have partially succeeded; communications are occurring, but the PIC is not successfully reading its own BF flag (buffer full).

I am currently managing the slave select line myself on the PIC. It should transmit, then set the flag high when the last data is shifted in. Problem is, it never does. As far as I can tell, the BF flag in the status register is never set, and the next transmission doesn't occur.

Ways to approach:
1. Hold SS low all the time for the debugging process
2. Put out the state of BF to a pin and watch it on the oscope
3. Check what the state of BF is normally and verify it does stay low.

Goal for tomorrow: finish debugging, take a look at the iButton. If ambitious, dump the iButton number onto the bus.

David out

1 comment:

David said...

I tried it out this morning. If we tie SS low, the E128 gets confused about what starts the communication routine and messes up the data. 4 became 21 and 52 became 125 today; hopefully the latest changes make this unnecessary.