View previous topic :: View next topic |
Author |
Message |
riggsy
Joined: 09 Sep 2008 Posts: 9
|
PIC->PIC via RS232 |
Posted: Wed Sep 10, 2008 12:21 am |
|
|
Hey there(first post, longtime lurker, you guys are great, I've written several apps that are in production just by reading through the posts here and bangin stuff out myself, kudos to all for your supportiveness!)
I'm somewhat new to serial communication ( I got an RS422 solution working in my last prototype, woot!).
In todays endeavor, I'm trying to get a serial hello world working between a 16F887 and 18F97J60. I'm using the hardware UARTs, and I'm making the assumption that if they are running on the same power supply, that I can connect RX -> TX and TX -> RX and be ok (but I haven't seen it done this way), without any other hardware.
Am I overlooking something?
If this should be ok, I'm happy to pound on the code some more on my own (there are enough serial hello world examples here that I can hole up a bit longer with the code and post what I have after I've attacked all avenues).
Regards
riggsy |
|
|
RLScott
Joined: 10 Jul 2007 Posts: 465
|
Re: PIC->PIC via RS232 |
Posted: Wed Sep 10, 2008 5:53 am |
|
|
riggsy wrote: | ..trying to get a serial hello world working between a 16F887 and 18F97J60. I'm using the hardware UARTs, and I'm making the assumption that if they are running on the same power supply, that I can connect RX -> TX and TX -> RX and be ok (but I haven't seen it done this way), without any other hardware... |
Yes, that should work as long as both PICs are operating from the same power supply. Normally you see serial ports connected to RS-232 level converter chips like the MAX232. That converts the logic level to +/- 9v and inverts the signal. That is done to interface to external RS-232 devices that expect this standard. But if you have two PICs and both are operating without a MAX232, then they will be just right for each other. _________________ Robert Scott
Real-Time Specialties
Embedded Systems Consulting |
|
|
riggsy
Joined: 09 Sep 2008 Posts: 9
|
|
Posted: Wed Sep 10, 2008 11:25 am |
|
|
Hey thanks for the confirmation( knowing you're not screwing it up is half the battle)
I've got it all working as of this morning.
Regards
riggsy |
|
|
Ttelmah Guest
|
|
Posted: Wed Sep 10, 2008 2:52 pm |
|
|
There is also a big difference in the ability of the RS232 (as opposed to normal logic) signals, to withstand noise, and protect the main processor from damage.
Direct connection is 'fine', and indeed common, for links over a few inches inside a single piece of kit, but if you want to go more than a few feet, RS232 signalling, will still work with several volts of noise on the signal wires, and most chips offer several thousand volts of protection from ESD. Big difference.....
Best Wishes |
|
|
Gerhard
Joined: 30 Aug 2007 Posts: 144 Location: South Africa
|
|
Posted: Thu Sep 11, 2008 3:00 pm |
|
|
I worked with the 232 chips on a 5 meter length of cable and the maximum baud rate i could achieve was 115200 on that length. However by just changing from a 232 chip to a 485 chip I was able to double the baud rate on a 20m length of cable and the code was exactly the same. Just maybe in future something to look at if that could be needed. |
|
|
|