awan
Advanced Member level 4
- Joined
- Jun 11, 2004
- Messages
- 106
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,296
- Location
- Los Angeles
- Activity points
- 815
pic spi
Hi;
I am trying to send data from PIC16F88 to a slave Jennic Microcontroller.
PIC16F88 can only send 8bits of data on SPI in one go. But for jennic to receive data, it should first get 0x02(status) and 0x00(zero padding for Jennic to reply) and then it expects the length of data being sent before the actual data can be sent.
I am not sure but, i dont receive any data on Jennic, Can someone please guide me on this. Could it be that PIC sends data over SPI in 8bits and Jennic expects a continuous burst. I send data like this:
SSPBUF=0x02; //Status for Jennic to receive data
while(!BF);
test=SSPBUF;
SSPBUF=0x00; // Zero padding for jennic to reply
while(!BF);
test=SSPBUF;
SSPBUF=0x01; //32 bit length of word being sent
while(!BF);
test=SSPBUF;
SSPBUF=0x01; //Next 4 bits of data
while(!BF);
test=SSPBUF;
SSPBUF=0x02;
while(!BF);
test=SSPBUF;
SSPBUF=0x03;
while(!BF);
test=SSPBUF;
SSPBUF=0x04;
while(!BF);
test=SSPBUF;
Thanks,
Hi;
I am trying to send data from PIC16F88 to a slave Jennic Microcontroller.
PIC16F88 can only send 8bits of data on SPI in one go. But for jennic to receive data, it should first get 0x02(status) and 0x00(zero padding for Jennic to reply) and then it expects the length of data being sent before the actual data can be sent.
I am not sure but, i dont receive any data on Jennic, Can someone please guide me on this. Could it be that PIC sends data over SPI in 8bits and Jennic expects a continuous burst. I send data like this:
SSPBUF=0x02; //Status for Jennic to receive data
while(!BF);
test=SSPBUF;
SSPBUF=0x00; // Zero padding for jennic to reply
while(!BF);
test=SSPBUF;
SSPBUF=0x01; //32 bit length of word being sent
while(!BF);
test=SSPBUF;
SSPBUF=0x01; //Next 4 bits of data
while(!BF);
test=SSPBUF;
SSPBUF=0x02;
while(!BF);
test=SSPBUF;
SSPBUF=0x03;
while(!BF);
test=SSPBUF;
SSPBUF=0x04;
while(!BF);
test=SSPBUF;
Thanks,