View previous topic :: View next topic |
Author |
Message |
valemike Guest
|
rs232 hanging? |
Posted: Mon Apr 04, 2005 1:28 pm |
|
|
Hi,
I use the MAX232 with the hardware uart pins on a PIC18F458. I am lately experiencing intermittent hanging. I suspect it is either my RS232 or i2c getting overrun.
If it's the i2c, i will look at Mark's sample i2c code which handles such errors.
However, has anyone ever had a problem with a MAX232 hanging while using CCS's printf libraries? If so, is there something i can specify in the #use_rs232 statement to prevent this? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Apr 04, 2005 1:33 pm |
|
|
There's nothing to hang. It's just four level-translators in a package. |
|
|
valemike Guest
|
|
Posted: Mon Apr 04, 2005 1:51 pm |
|
|
okay, i guess it's something else in the code or i2c. |
|
|
theMagni
Joined: 21 May 2004 Posts: 48 Location: Victoria, BC
|
|
Posted: Mon Apr 04, 2005 4:42 pm |
|
|
I found that if I didn't put "errors" as one of the options, RS-232 would hang. When they upgraded the compiler, I found that I also had to put in "force_sw".
I hope that helps. _________________ In the 90's, I promised myself I'd never use a so-called "smiley icon". I hate what I've become. ;) |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Apr 04, 2005 5:07 pm |
|
|
Quote: | I found that if I didn't put "errors" as one of the options, RS-232 would
hang. When they upgraded the compiler, I found that I also had to put
in "force_sw". |
If you use FORCE_SW, then you're forcing the compiler to generate
code for a software UART on the hardware UART pins. In that case,
the ERRORS directive will have no effect. It only works with the
hardware UART. |
|
|
valemike Guest
|
|
Posted: Tue Apr 05, 2005 6:32 am |
|
|
Code: | #use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS) |
I tried appending "ERRORS" into my #use rs232 statement, but just get the following warning: Line 157(5,8): Variable never used rs232_errors
Why's that? Is there something i have to do in the code somewhere? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Apr 05, 2005 8:00 am |
|
|
Quote: |
I tried appending "ERRORS" into my #use rs232 statement, but just get
the following warning: Line 157(5,8): Variable never used rs232_errors |
This topic was recently discussed in the forum:
http://www.ccsinfo.com/forum/viewtopic.php?t=22342 |
|
|
|