Easypic4 rs232 problem

General discussion on mikroC.
Post Reply
Author
Message
scastagnoli
Posts: 16
Joined: 02 Dec 2006 13:37

Easypic4 rs232 problem

#1 Post by scastagnoli » 24 Jan 2011 19:57

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

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Easypic4 rs232 problem

#2 Post by filip » 26 Jan 2011 14:24

Hi,

Have you tried the RS232 example supplied with the compiler ?
Do they work ?

Regards,
Filip.

scastagnoli
Posts: 16
Joined: 02 Dec 2006 13:37

Re: Easypic4 rs232 problem

#3 Post by scastagnoli » 26 Jan 2011 17:34

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?

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Easypic4 rs232 problem

#4 Post by filip » 27 Jan 2011 13:27

Hi,

Please try the supplied example using the USART terminal, supplied with the compiler and inform of the results.

Regards,
Filip.

scastagnoli
Posts: 16
Joined: 02 Dec 2006 13:37

Re: Easypic4 rs232 problem

#5 Post by scastagnoli » 28 Jan 2011 15:26

Hi,
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

Post Reply

Return to “mikroC General”