This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to copy SBUF in SPIDAT

Hi everybody !

I'm currently working on a project with a ADuC847 and I would like to copy the content of SBUF (data register of UART) to SPIDAT (data register of SPI).
Here is a part of my code:

T3CON = 0x83; //9600 Baud rate

T3FD = 0x12;

SCON = 0x52; // UART enable, variable baud rate.

SPICON = 0x2C; // SPI enable, slave mode

while(!RI); //interrupt flag of UART (Set when SBUF is full)

if(ISPI==0 && RI==1)

{ SPIDAT = SBUF; // This line doesn't work. Value is still egual to 0

value = SPIDAT; }

RI = 0; ISPI = 0;

Someone would have any idea ?
thanks in advance,

Guillaume.

Parents
  • "So do you think that SPIDAT = SBUF is correct ?

    Have you found any errata for the processor saying that the UART is broken, and that it isn't possible to read from SBUF?

    Have you found any errata for the processor saying that the SPI device is broken, and that it isn't possible to write to SPIDAT?

    Exactly why do you question the possibility of reading from SBUF or writing to SPIDAT? Do you think the UART have special tracking to know where the data read from it is sent? Do you think the SPI device has special tracking that checks where the data to send comes from?

    Don't you think you should take two steps back and find other ways to figure out why your code and/or hardware doesn't work as expected, than questioning if the processor has a serious design issue?

Reply
  • "So do you think that SPIDAT = SBUF is correct ?

    Have you found any errata for the processor saying that the UART is broken, and that it isn't possible to read from SBUF?

    Have you found any errata for the processor saying that the SPI device is broken, and that it isn't possible to write to SPIDAT?

    Exactly why do you question the possibility of reading from SBUF or writing to SPIDAT? Do you think the UART have special tracking to know where the data read from it is sent? Do you think the SPI device has special tracking that checks where the data to send comes from?

    Don't you think you should take two steps back and find other ways to figure out why your code and/or hardware doesn't work as expected, than questioning if the processor has a serious design issue?

Children