Hi everyone,
I've some problem storing the data in register on C lang. My SBUF was stored with some data and i want to view what data was inside. I want to store my SBUF value into R0 but i not sure how to write the code in C lang.
I know that in asembly lang, it was MOV R0, #01H<<<<<example
Can anyone help me on this? Thanks alot
The last 4 or so lines of code don't make sense to me, but I'm not going to spend any more time looking at it, just throw out a few questions.
Why are you reading SBUF when you don't know that anything is there? Shouldn't you look for RI or receive data ready first?
you while on RI==0? so there is where you wait for the next char? and then go back up and re-initialize everything at the top of the loop? Maybe I'm missing something, but that seems wrong.
Can you read out of SBUF twice? or does it clear the first time you read from it? I don't remember.
You're not doing anything with either of those variables anyway, except viewing them in the debugger. How does that data get to the LCD?
Using a delay loop in a high level language is frowned upon.
... because it will, quite likely, not do what you expect!
See: www.8052.com/.../162556