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

Redirecting RS232 data using HW and SW USART on PIC18F4220

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



Joined: 23 Jun 2004
Posts: 24

View user's profile Send private message

Redirecting RS232 data using HW and SW USART on PIC18F4220
PostPosted: Wed Jun 23, 2004 9:27 am     Reply with quote

I am interfacing with a device connected to a PIC18F4220 and want to communicate with the device by using RS232 from a Host computer.

The device is connected the PIC18F4220 using pins B2 and B1.

B1 is reading data transmitted from device and B2 is sending data to device.

I am using the onboard USART to communicate with the Host computer via RS232 on pin C6 and C7.

I want to take the data on pins B2 or B1 and redirect the data to or from the USART.

I would appreciate any feedback on any methods to accomplish this. Thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jun 23, 2004 2:02 pm     Reply with quote

Quote:
The device is connected the PIC18F4220 using pins B2 and B1.

What is the communication standard used on Pins B1 and B2 ?
Is it i2c, or RS232, or something else ?

Does the data from this "device" arrive in 8-bit bytes ?
Guest








PostPosted: Wed Jun 23, 2004 2:45 pm     Reply with quote

Communications for the device on pins B1 and B2 is RS232.

And yes it does transfer data in 8 bit Bytes.

I have had the device connected directly to my computer serial (COM1) and am able to transfer data with no problem.

Only this time, I will need to go through the PIC's USART and redirect to the data through pins B1 and B2. This is where I need some ideas in how to accomplish this.
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

Redurect B1/B2
PostPosted: Wed Jun 23, 2004 3:18 pm     Reply with quote

What you want to do can't be done to my knowledge. What I have done in the past is use an RS232 multiplexer chip to switch B6/B7 between multiple RS232 sources. I did this to service 5 different LCD displays and it worked fine. The only limitations are that you cant have the different channels transmitting/receiving at the same time and they must all be the same bits/stop bits. You have to service them sequentially to use the mux..

Your only other option is to use a chip with two hardware USARTS.
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