View previous topic :: View next topic |
Author |
Message |
test153
Joined: 09 Feb 2009 Posts: 28
|
Software RS232 |
Posted: Mon Mar 23, 2009 11:18 am |
|
|
I'm using bit-bang RS232 on a pic12F629 with is connected without a level converter (such as the max232). Should I use the INVERT option or not?
In the CCS C help I found this:
Quote: | Check the level conversion. When using a driver/receiver chip, such as the MAX 232, do not use INVERT when making direct connections with resistors and/or diodes. You probably need the INVERT option in the #USE RS232. | Perhaps they should do a spell check on that statement as it isn't clear what they mean. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Mar 23, 2009 11:34 am |
|
|
Quote: |
I'm using bit-bang RS232 on a pic12F629 with is connected without a
level converter (such as the max232). Should I use the INVERT option or not? |
Yes, with a direct connection, you should use the INVERT parameter.
Then connect the Rx pin of your soft UART (on the PIC) to pin 3 on
the PC's DB9 connector with a 22K series resistor, as shown in this
schematic:
http://www.instructables.com/files/orig/FVI/TR35/VW1EP27VUPP/FVITR35VW1EP27VUPP.gif
The Tx pin on the PIC (from a software UART) should connect to pin 2 on
the DB9 connector. This is not shown on the schematic. You must also
have a ground connection between your board and pin 5 on the DB-9
connector. |
|
|
test153
Joined: 09 Feb 2009 Posts: 28
|
|
Posted: Mon Mar 23, 2009 11:43 am |
|
|
Thanks.
Finally I think I can make my RS232 working. |
|
|
test153
Joined: 09 Feb 2009 Posts: 28
|
|
Posted: Tue Mar 24, 2009 3:21 am |
|
|
As for the GND connection, as you pointed out it must be present or funny things start to happen...
But what if I decide to use for example the FTDI FT232R should I then connect the ground to the USB port? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Mar 24, 2009 1:12 pm |
|
|
You should refer to their documentation. On this page,
http://www.ftdichip.com/Documents/Schematics.htm
you can download this zip file:
It has a PDF schematic of the FT232R and an RS232 level converter chip.
They all use the same common ground, referred to as "GND" on the
schematic. This GND would also connect to your PIC ground (Vss pin).
Almost all board level circuits require a ground connection between devices. |
|
|
|