USART switcher

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi !

on my board are:

1.ATmega328
2.wireless module
3.Serial-to-Ethernet module

they all are connected between each other by USART.

ATMega328 is "master" and should somehow control USART.

E.g. :

1. ATMega328 wants some data form PC :
in order to do this must somehow disable USART lines to wireless module(since they are USART bonded)

2. ATMega328 sends data to PC over Serial-to-Ethernet module and receives data

3. ATMega328 disables USART lines to Serial-to-Ethernet module and sends data to wireless module

and so on...(you understand me)

Any idea how to do this ?

Thank you for answers !
Regards !

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It sounds as if your Wireless module is soldered to the TXD, RXD pins.
The simplest method would be to use different pins for the Serial-Ethernet and use a Software UART.

If your Wireless and Ethernet modules possess Chip-select pins, you could wire them both to TXD, RXD and enable each module as required.

Or you use a multiplexer chip to connect the appropriate pins.

Note that UART is active-low protocol. So you can connect an external pull-up resistor to RXD and connect the module TX pins via diodes.

Life is much simpler if you say which modules you have. And a schematic of your AVR board.

Most Ethernet chips talk via SPI rather than UART.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Use an AVR with multiple serial ports? (mega324 or mega2560)

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Look at Maxim Semiconductors website. They made at one time an rs 232 ic that had enables on the drivers and receivers that could do what you are looking for.

Since you want to switch TTL level signals though. You could use the good old CD4066 silicon bilateral switch.

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you're using them at different times and don't expect to receive anything other than when you want it then there's no reason why you can't just use some switch ICs toggled by IO lines on the chip. I've done it without problems on a tester pcb that I made.