electronicsman
Full Member level 5
- Joined
- May 4, 2012
- Messages
- 291
- Helped
- 11
- Reputation
- 22
- Reaction score
- 12
- Trophy points
- 1,298
- Activity points
- 3,737
...yes, it's 0x02...Your text doesn't say what data is transmitted...but I assume it's 0x02 again
Yes, but it's effectively only possible in slave mode. You can't transmit in master mode without rewriting SPIxBUF.the same data is transmitted repeatedly if not changed by the user
void TransmitReceiveSpiData(uint16_t *a_tx_data_u16, uint16_t *a_rx_data_u16 )
{
while(!SPI1STATbits.SPITBF); /* Wait till the spi1 txb buffer is empty to load the data */
SPI1BUF = *a_tx_data_u16; /* Load the data into the SPI1 buf to start transmission */
/* immediately start reading the data it is mandatory else overflow will happen */
/* read only when the rxb buffer is filled with data */
while(!SPI1STATbits.SPIRBF);
*a_rx_data_u16 = SPI1BUF;
}
Please be VERY CAREFUL when reading FRM sections that they do actually relate to the SPECIFIC MCU that you are using. As it says in that document (in the note at the tip of Page 2:No it is master mode. Please find the document attached. Page number is 13 and note 3.
Therefore it would help f you identify the device you are using completely.Depending on the device variant, this manual section may not apply to all dsPIC33/PIC24 devices.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?