I am testing a routine with serial interrupt and I notice that the value is not transferred from SBUF. I notice this in uVison debug. What's happen? Please help me. follow my parcial intr routine
if(RI) { c = SBUF; //<-- here is my problems RI = 0; if (istart + ILEN != iend) { inbuf[iend++ & (ILEN-1)] = c; } }
c = SBUF; //<-- here is my problems if this statement do not copy SBUF into c your hardware is faulty. I believe you do not have anything in SBUF Erik
I notice that the value is not transferred from SBUF How do you notice this? Jon
Hi, Jon I notice within uVision2 debug. tks
Yes Mr. Schdmit i am facing the same problem. is there any one to help us.
i am facing the same problem. is there any one to help us. How can you be helped with a problem that does not exist? q = SBUF; WILL move SBUF into q, there is no way around it. If there is nothing in SBUF, then, of course nothing get moved into q. Is it possible that you are confusing the output and input sections of SBUF, if so, you better read up on it in "the bible" Erik
here are the links to "the bible" Chapter 1 http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_ARCH_1.pdf chapter 2 http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_PROG_GUIDE_1.pdf chapter 3 http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_HARDWARE_1.pdf
If you do this //code up to here //c=SBUF; c = iend; //rest of code what does your buffer look like after execution? does it make sense? If you run the simulator then execute this command SIN = 0xAA then stop what does your buffer look like?
I am 83.42% certain that the problem here is not understanding that SBUF is not one buffer. That is why I refer to "the bible" Erik
Ok, Erik! Thank you
I am 83.42% certain that the problem here is not understanding that SBUF is not one buffer. I think that's very likely as well. Another problem is that some variable names (A, B, C, R0-R7) are overloaded. For example, if you enter A in the command window, the debugger cannot determine whether you mean your variable A or the accumulator. The same goes for B, and C (the carry), and so on. Jon
Hi, Mr. Barry a matter of fact the command SIN do not make my program to work, and the c = iend do not change anything. But thank you for your time. Marcio Schmidt
Tks Mr Jon, but I am realy not using the debug command. I just use the debug to execute my C program. rgds Marcio Schmidt
Both those things make sense if c is overloaded, did you change the variable name and retry the simulation?
but I am realy not using the debug command. I just use the debug to execute my C program. OK, then how do you inspect the value of the variable c? Jon
Hi, I think in C language it is irrelevant, isn't it? tks Marcio Schmidt