Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

sharing uart PIC16F877 for transceiver and RS232

Status
Not open for further replies.

shotstuffz

Newbie level 4
Joined
May 30, 2011
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,317
Hi...I'm using two pic and implementing a transceiver module. The problem is I need more than two uart as two is already in use for the transceiver and I need to connect RS232 to the PC therefore requiring the use of another uart. I'm wondering if anyone has suggestions to solve this problem. I don't want to use another pic as that would just be an overkill...
 

Hi,

You are using the Hardware Usarts of the chip, if you want more Usarts then simply use any standard i/o's with your own custom Software Usart.
Thats how they did it before chips had Hardware Usarts built in.

Details here of how to do it in Assembler, for other languages just Google.
PIC Tutorial* Seven - RS232
 

You could link the two PICs via I2C or SPI, saving the UARTs for RS-232. I2C only requires two wires and most PIC compilers having existing libraries making it fairly easy to implement.

Or as wp100 suggested implement a soft UART.

I2C is not difficult to implement and use, I've used it quite often for interPIC communication.
 

Software UARTs are the answer as long as you have the processing power to do it in real time. I'm using 16F628A devices which are similar to the 877 in performance and use the hardware USART at 38,400 bauds and a software UART at 9600 bauds simultaneously without problems. If your other software routines make it too slow to emulate a UART, look at the MAX3100 device as a 'bolt-on' UART, its very easy to use and connects via microwire which is simple to control and not dependant on speed.

Brian.
 

hello....thanks again for the info, bigdogguru, I would use I2C if I could but for this I have to specifically use transceiver, software uart sounds like a good solution though it would be a big help if someone can guide me on software uart. I'm using C language to program the PIC by the way..
 

I've attached a softUART Demo adapted from Hi-Tech's example.

I've tested it successfully on a PIC16F84A at 1200 and 4800 BAUD at 9600 BAUD it's a little dicey and very susceptible to noise. Keep your leads short.

The routine needs tweaking at higher speeds.

After wiring up you proto circuit, initial test it at 1200 BAUD and work your way up to 9600 BAUD.

Hope this example gets you started in the right direction
 

Attachments

  • SoftUART.zip
    49.6 KB · Views: 86

Thank you for sharing, I am currently using IAR embedded workbench. I noticed that it's different from the example attached. Is there one for IAR? if not I will try to modify based on the example you have given me if it's possible..
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top