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.

how to calculate SPIBUF value

Status
Not open for further replies.

vinay shabad

Junior Member level 3
Joined
Dec 13, 2010
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,769
hii i saw aprogram in net where they wrote value of spibuf can any one explain me how to give value for this.



void readSPI()
{
unsigned int i;

_SPI_SS_PIN = 0; //Slave Select Enable bit (Master mode)
for (i=0; i<4; i++){};
SPI1STATbits.SPIROV=0; // resets TX buffer overflow
IFS0bits.SPI1IF = 0; // resets SPI Interrupt Flag
*********SPI1BUF = 0x5105;**************
}


can any one tell me how we get this value how to calculate this value
 

The data word written to SPIBUF is send to the SPI peripheral. To know it's meaning, you have to refer to the specfication of the slave device. The SPI interface (apparently of a 16-Bit PIC) is operated in unsual 16-Bit mode in this example.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top