Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,178
Helped
14,199
Reputation
28,657
Reaction score
12,888
Trophy points
1,393
Location
Bochum, Germany
Activity points
279,134
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top