SPI tranmit register load problem(pic45k20) in isr

Status
Not open for further replies.

Anniyan_x

Member
hi im using interreupt driven spi transfers in slave mode.

when i called my spi data tranfer api, the first nesessary settings is done like clearing flag regarding spi and then the "first byte" to be transferred is written into the spi buffer(data register)@SSPBUF, and the remaining bytes are written in the isr routine, the remaining bytes are written after the first byte transfer is complete which will generate a interrupt,so in isr the next byte is written and goes on like this untill completed the total bytes.. i also clear the BF bit before each write, my problem is the SSPBUF, the spi the buffer still holiding the first byte which is written to it, and the subsequent bytes which are loaded into the SSPBUF in ISR rountine never gets "updated or loaded" into the SSPBUF, and the previous byte(the first byte) is still tranferreds although im loading a new byte into the SSPBUF. im also clearing the SSPIF, SPI interrupts flag bit and doing a dummy read on the SPI buffer(SSPBUF) before each write to clear the BF flag, but still in the isr my data is not loaded into teh SSPBUF and the first byte is still in teh sspbuf.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…