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

Serial Data lost

I wrote an aplication that receives data from the serial interface (80251)
When running under the uvision dscope debugger I go into the serial peripheral window and enter the data into SBUF. Then I set the interrupt. My input data is displayed in the serial window, and the interrupt triggers my ISR. The only problem is that the SBUF data never gets copied into my global variable of my program.
In C ,I have the statement rcv_data = SBUF

In assembly I get MOV A,SBUF(0x99)
MOV rcv_data(0x12F),R11
The instruction to move the SBUF (loc 0x99) to the Accumulater gets ignorred
Since memory location 0x99(SBUF) does not get pulled into the accumulater, the data never gets into my variable.
I set breakpoints all over this area and I can't understand why the instruction doesn't seem to move the data over. I can write to the accumulator with no problem in the command window (ie. A=0x49). (setting a break at this address within the interrupt.
Does anyone know what could cause this...

Parents
  • Jon,
    Thanks for the reply.
    I'm a little surprised that the compiler uses the A and R11 symbols, and not just R11, but the fact remains that I can see my data get into the SBUF (address 0x99) but never gets written to the accumulator (symbol A in the assembly code; and it is set to 0), so it's no surprise that when R11 gets moved in my variable it is set to 0.
    Just as an aside, maybe this means something, after I load my code into d-scope I have to inline assemble an ejmp serialIntr? into the vector table because a plain jmp is used.
    Thanks in advance for your suggestions.

    jim

Reply
  • Jon,
    Thanks for the reply.
    I'm a little surprised that the compiler uses the A and R11 symbols, and not just R11, but the fact remains that I can see my data get into the SBUF (address 0x99) but never gets written to the accumulator (symbol A in the assembly code; and it is set to 0), so it's no surprise that when R11 gets moved in my variable it is set to 0.
    Just as an aside, maybe this means something, after I load my code into d-scope I have to inline assemble an ejmp serialIntr? into the vector table because a plain jmp is used.
    Thanks in advance for your suggestions.

    jim

Children
No data