HI everyone!
I am workinf with Silabs 8051F020, and I need to use the uart1 shift register mode (mode 0). Everything seems to work fine, except that when I try to read the SBUF1 register and load it to a software buffer, i don't get anything. I am debugging on software, and loading myself the sbuf1 reg with a byte (0x51), and when i set the interrupt flag, it recognises a reception, but when it gets to the point
buffer = SBUF1;
i get 0x00 on buffer. i also checked that SBUF1 is loaded by posing the mouse over it's name Any ideas will be appreciated
Thanks
Now, when I try to read data from the serial port, I write with the debug tool, something on SBUF, anything, and i set the interrupt flag as if I had actually received something.
That makes no sense. If the peripheral is simulated, you don't have to flag the interrupt yourself. So odds are you are writing to the wrong VTREG when you're trying to simulate incoming data.
what you say does make sense haha
I flag the interrupt because i want to check that what the ISR does is what i want it to do, and as i am not recieving anything i try that.
so what can i do to simulate incoming data? Which reg should I write so i can read it from the reciece buffer SBUF1?
Which reg should I write so i can read it from the reciece buffer SBUF1?
You should write to VTREG S1IN, I think. And you should have found that out by yourself when you read the documentation looking for this information.