Naseer Ahmed
Newbie level 5
- Joined
- Feb 19, 2015
- Messages
- 9
- Helped
- 0
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 3
- Location
- Islamabad, Pakistan, Pakistan
- Activity points
- 113
Hello dear friends,
Please guide me against the following problem:
I am trying to develop uart communication between PIC 16F877A (20 MHz crystal) and PC using hyper terminal.
I wrote the following simple code in mikroc Pro v.6.5.0 compiler to run:
But it is not working.
I have tested the serial cable and MAX 233 IC by shorting TX and Rx together and these are working properly.
The protocols are also same:
Baud rate of both PC and code are 9600 bps each
data bits 8
No parity bit
stop bit 1.
Can you kindly tell the point of problem?
Thanks
Regards
Naseer Ahmed
Please guide me against the following problem:
I am trying to develop uart communication between PIC 16F877A (20 MHz crystal) and PC using hyper terminal.
I wrote the following simple code in mikroc Pro v.6.5.0 compiler to run:
Code:
char RS;
void main()
{
TRISC = 0xF0;
Uart1_Init(9600);
while(1)
{
if (uart1_data_ready()==1)
{
RS = uart1_read();
uart1_write(RS);
}
}
}
But it is not working.
I have tested the serial cable and MAX 233 IC by shorting TX and Rx together and these are working properly.
The protocols are also same:
Baud rate of both PC and code are 9600 bps each
data bits 8
No parity bit
stop bit 1.
Can you kindly tell the point of problem?
Thanks
Regards
Naseer Ahmed