Redirecting RS232 data using HW and SW USART on PIC18F4220
Posted: Wed Jun 23, 2004 9:27 am
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
Posted: Wed Jun 23, 2004 2:02 pm
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
Posted: Wed Jun 23, 2004 2:45 pm
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
Redurect B1/B2
Posted: Wed Jun 23, 2004 3:18 pm
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.
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