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 CCS Technical Support

PIC->PIC via RS232

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



Joined: 09 Sep 2008
Posts: 9

View user's profile Send private message

PIC->PIC via RS232
PostPosted: Wed Sep 10, 2008 12:21 am     Reply with quote

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

View user's profile Send private message

Re: PIC->PIC via RS232
PostPosted: Wed Sep 10, 2008 5:53 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Sep 10, 2008 11:25 am     Reply with quote

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







PostPosted: Wed Sep 10, 2008 2:52 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Thu Sep 11, 2008 3:00 pm     Reply with quote

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.
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