HI, i hav written a piece of code tat executes continuously i.e. while(1) In this there r two condition statement: if(SBUF1==0x20||SBUF1==0x7F||SBUF1==0x0FF) { //Statements } else if(SBUF1==0x53||SBUF1==0x73) { //Statements } And in debug mode i change the value of SBUF1 SFR accordingly...however wen i do "step into" it just does not enter either of these loops. Please help in this regard.
yes, tats wat i did just now....finally i figured out tat data can be received in SBUF1 by using S1IN=XxXX in command window.... thnx everyone. If i get stuck somewhere again i will surely write back. And ,yes, the basic loop tat i mentioned in my first query is getting executed properly!!!
Instead of modifying SBUF in the simulation, you should use the VTREGs SxIN/SxOUT.
it does not do what i want it to do... and i m wondering how will readin(or comparing data)SBUF1 clear it unless another byte has been received in it? well, the bottomline is, i want to simulate SBUF1(reception). How do i write data into SBUF1 so that it will be treated as the data that has been received, and not data that is to be transmitted? is it a possibility in Uvision2?
does this do what you want? if(SBUF1==0x20||SBUF1==0x7F||SBUF1==0x0FF) { //Statements } else if(SBUF1==0x53||SBUF1==0x73) { //Statements } Reading from SBUF removes the char. The other compares will not see the same char. It gets worse if another char comes in.
but msc1210 is there in the list!!!!
The MSC12xx devices are most likely not covered in your old version. Therefore you need to upgrade the system that you have. Please contact your local distributor.
Spell the words, Avoid SMS [Reply] fine and now we get Alrite ppl why would anyone want to reply to such gibberish? Erik
Alrite ppl there is somthing i think i have figured out....if i write something in SBUF1 simulated register it implies, this data byte is the data that is to be transmitted (and not the data tat is received or can be copied into some variable e.g. i=SBUF1; ) So if we wish to receive data into SBUF1 then we hav to configure the correponding "receive port pin"; and then watever data we receive at this pin will be stored in SBUF1, one byte at a time..... i hope i m correct.Kindly comment on this.
I m using UVision2 and the link that you hav provided seems to be for UVIsion3... In UV2 this "UART simulation " feature is not present, however, we do have simulated serial ports, which do not hav SIN ,SOUT,etc. So my question is how do i realize the same thing while using UV2?
The serial port Virtual Simulation Registers (VTREG) are described here: http://www.keil.com/support/man/docs/uv3/uv3_sm_uartcommunication.htm
fine
Spell the words, Avoid SMS
I saw the figure on pg13 n i understand tat there r 2 SBUFs....but then how does one READ the value in SBUF tat has been fed in in the simulator????? Coz I dont find n e feature like SOUT or SIN registers....i see only SBUF...also, in Keil manual, ther is one chapter "Serial Interface"-There in a program they hav used SBUF itself!!!! Please throw some lite on this issue...
hey thanks erik and andy for the effort from ur sides i ll b readin from the links u both hav provided hope it solves my prob
See http://www.8052.com/forum/read.phtml?id=118327
View all questions in Keil forum