du.chci1990
Newbie level 5
- Joined
- May 12, 2012
- Messages
- 8
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- Bangalore, India
- Activity points
- 1,358
hello all :smile:,
i need to debug my embedded C program on Keil for a hardware project.
Now i don't know how to debug the serial communication parts of the program. I open the UART window, but it just shows the output. Now if i have to send any character to the UART, where do i type it? (UART window doesn't seem to take in any characters, unable to type there.)
the program will enter a loop when the serial buffer receives a certain character. So, how do i send the character to the receive buffer??
A snipet of the code is given below:
-------------------------------------------------------------------------------------------------------------
RECV_DATA=SBUF;
RI=0;
if(RECV_DATA=='+')
{
:
: //some action
}
if(RECV_DATA=='#')
{
center_locking = DISABLE; //a port pin of 8051
:
:// more action
}
if(RECV_DATA=='-')
{
while(recevier_d0);//a pin of 8051// Waiting for the Wireless Transmitter to be ON
// pins of 8051 are being set/reset
Sprayer = ENABLE;
center_locking = ENABLE;
car_rear_coil1 = ENABLE;
delay_in_half_seconds(20);
while(1); // Infinite loop Press reset to come out of this mode
}
}
------------------------------------------------------------------------------------------------------------------------------------
So is there any special serial communications window in KeiluVision4 where i can type the characters "#" or "+" and make the program function???
Please help! thanks in advance!!
PS: have attached a snap-shot of the UART window i used in debugging. i cannot type in characters here.
i need to debug my embedded C program on Keil for a hardware project.
Now i don't know how to debug the serial communication parts of the program. I open the UART window, but it just shows the output. Now if i have to send any character to the UART, where do i type it? (UART window doesn't seem to take in any characters, unable to type there.)
the program will enter a loop when the serial buffer receives a certain character. So, how do i send the character to the receive buffer??
A snipet of the code is given below:
-------------------------------------------------------------------------------------------------------------
RECV_DATA=SBUF;
RI=0;
if(RECV_DATA=='+')
{
:
: //some action
}
if(RECV_DATA=='#')
{
center_locking = DISABLE; //a port pin of 8051
:
:// more action
}
if(RECV_DATA=='-')
{
while(recevier_d0);//a pin of 8051// Waiting for the Wireless Transmitter to be ON
// pins of 8051 are being set/reset
Sprayer = ENABLE;
center_locking = ENABLE;
car_rear_coil1 = ENABLE;
delay_in_half_seconds(20);
while(1); // Infinite loop Press reset to come out of this mode
}
}
------------------------------------------------------------------------------------------------------------------------------------
So is there any special serial communications window in KeiluVision4 where i can type the characters "#" or "+" and make the program function???
Please help! thanks in advance!!
PS: have attached a snap-shot of the UART window i used in debugging. i cannot type in characters here.