PIC18f2550 SSPBUF problem in assembly

Status
Not open for further replies.
According to my code


Code C - [expand]
1
2
3
4
5
6
7
SSPBUF = SPIData;
     while(!SSPSTAT.BF);
     SSPSTAT.BF = 0;
 
     inByte = SSPBUF;
     
     return inByte;



data to be sent out is placed in SSPBUF and it automatically starts getting out 1 bit at a time with MSB first out. Also data from SDI is filled from bit 0 of SSPBUF simultaneously. After all 8 bits are transferred out BF bit is set and it comes out of the while loop. Then BF flag is cleared and the data which was received in SSPBUF is copied to inByte and the function returns the inByte.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…