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.
That depends on volume of data that will come/go from/to both RS-232 devices.
One option will be to connect the more important device to hardware UART (with serial port interrupt ON) and the other device to software UART (see Philips application notes for software UART, with INT0/1 ON).
You can also consider sharing the hardware UART (4 NAND gates + 1 mcu pin per RX or Tx) but this option will require some kind of synchronization.
Regards,
IanP
You can implement a software UART via bit-banging. Essentially, you use timer interrupts to synchronize data transfer to IO pins. A simple google search gave **broken link removed**.
1. periodic timer interrupt at a rate 4-32x higher than the baudrate.
+ fullduplex, even multichannel could be possible
+ does not require dedicated pin
+ under certain conditions can run from the same timer1 as the HW UART
- permanently occupies significant % of processor time
2. receiver triggered by an edge-triggered external interrupt (special: a counter set to roll over on the first edge); then sampled using timer timed at baudrate.
Transmitter simply using timer at baudrate.
+ low software overhead
- dedicated (extint) pin needed for Rx
- fullduplex requires 2 timers
3. only receiver or only transmitter by performing the sampling in a loop in main program
+ simple
- only 1 direction
- uses up 100% of processor time
- virtually excludes using other interrupts simultaneously
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.