Hi everyone!
After a long time I tried to test again rs232 example for my Easypic4. I'm using the following code:
unsigned short i;
void main() {
USART_init(2400); // initialize USART module
// (8 bit, 2400 baud rate, no parity bit...
while (1) {
if (USART_Data_Ready()) { // if data is received
i = USART_Read(); // read the received data
USART_Write(i); // send data via USART
}
}
}//~!
The hardware is a 16F877A that works correctly with interrupts, leds and buttons.
I've connected JP7 to RC7 and JP8 to RC6.
Connecting with Putty to COM with 2400, 8, N, 1 or with integrated terminal of MikroC I cannot receive any answer from the board.
I've test my serial connection with NULL modem and everything works fine so I think I don't have PC-side problems.
Could anyone suggest me a solution please?
Thanks a lot in advance!
Regards,
Stefano
Easypic4 rs232 problem
Re: Easypic4 rs232 problem
Hi,
Have you tried the RS232 example supplied with the compiler ?
Do they work ?
Regards,
Filip.
Have you tried the RS232 example supplied with the compiler ?
Do they work ?
Regards,
Filip.
-
- Posts: 16
- Joined: 02 Dec 2006 13:37
Re: Easypic4 rs232 problem
Hi,
Thank you very much for your reply!
I've tried the project issued with compiler but I sent datas with Putty (2400 8 N 1 and no flow-control) but I cannot see anything on my Putty interface.
I've tried with a null-modem connection from PC to PC and cables works correctly.
What can I try?
Thank you very much for your reply!
I've tried the project issued with compiler but I sent datas with Putty (2400 8 N 1 and no flow-control) but I cannot see anything on my Putty interface.
I've tried with a null-modem connection from PC to PC and cables works correctly.
What can I try?
Re: Easypic4 rs232 problem
Hi,
Please try the supplied example using the USART terminal, supplied with the compiler and inform of the results.
Regards,
Filip.
Please try the supplied example using the USART terminal, supplied with the compiler and inform of the results.
Regards,
Filip.
-
- Posts: 16
- Joined: 02 Dec 2006 13:37
Re: Easypic4 rs232 problem
Hi,
The result is the following:
Connected to COM4
Sent: d
Anything is receiver.
I've attached the project I've tried.
Regards,
Stefano
The result is the following:
Connected to COM4
Sent: d
Anything is receiver.
I've attached the project I've tried.
Regards,
Stefano
- Attachments
-
- USART.zip
- (1.92 KiB) Downloaded 151 times