Jun 8, 2011 #1 V 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
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
Jun 8, 2011 #2 FvM Super Moderator Staff member Joined Jan 22, 2008 Messages 52,485 Helped 14,756 Reputation 29,794 Reaction score 14,121 Trophy points 1,393 Location Bochum, Germany Activity points 298,363 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.
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.