Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top