We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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...
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... In the 251, the Accumulator IS R11. Jon
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
I go into the serial peripheral window and enter the data into SBUF. Then I set the interrupt. I guess I missed this before. This WILL NOT WORK. Why don't you just type your data into the serial window and let the debugger generate the interrupt automatically? Or, use the SIN VTREG as follows:
SIN = 'A'
Thanks, Jon Problem solved. I was really pulling my hair out on that one. Now I can get into testing the stuff I churned out. Thanks again!!!!!!1 Jim