CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

RS232 Question

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








RS232 Question
PostPosted: Tue Aug 16, 2005 2:00 pm     Reply with quote

I have a PIC18F452 and a MAX232 connected to PC RS232.

When I send data from PC to PIC it works fine. But, when I try to receive data from PC it doesn't work. It remain waiting forever in getc() function.

Im using:
#USE_RS232(BAUD=9600, XMIT=PIN_C6, RCV=PIN_C7)

Is necessary to use the MAX232 IC with PIC18F452 or can I connect it directly to PIN 2, 3 of DB9 connector?

I have verified the pin levels PIN_C7 is high and PIN_C6 is low.

Thank you.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Aug 16, 2005 2:28 pm     Reply with quote

Quote:
Im using:
#USE_RS232(BAUD=9600, XMIT=PIN_C6, RCV=PIN_C7)

Is necessary to use the MAX232 IC with PIC18F452 ?

Yes. You are using the hardware UART. It does not have
an option to invert the output signal. So, you must provide
the inversion by adding a MAX232-type chip to your circuit.
Guest








PostPosted: Tue Aug 16, 2005 2:38 pm     Reply with quote

Ok. thank you.

any suggestion to solve my problem ?.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Aug 16, 2005 2:50 pm     Reply with quote

1. Check the connections in your MAX232 circuit.

2. Add the ERRORS parameter to your #use rs232() statement.
Example:

#USE RS232(BAUD=9600, XMIT=PIN_C6, RCV=PIN_C7, ERRORS)
Guest








PostPosted: Tue Aug 16, 2005 2:58 pm     Reply with quote

I tried with my desktop instead of my notebook and it runs ok.
I guest that is related to the different volt levels to each other.

Does anyone has experience with that ?
Thak you
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue Aug 16, 2005 6:46 pm     Reply with quote

Anonymous wrote:
I tried with my desktop instead of my notebook and it runs ok.
I guest that is related to the different volt levels to each other.

Does anyone has experience with that ?
Thak you


If you have used a max232 chip then the most likely cause of the problem is that the max 232 chip is not generating the -ve correctly. This happens if there is a soldering problem between the MAX chip and the 4 x 1uF capacitors. Meaure the voltage between pin 6 and gnd. It should be -9volts when run from a 5v supply. Similarly the voltage between pin 2 and ground should be +9 volts.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group