Tx/Rx lines as bus and also power

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

Hi All,

I Was thinking of making a USB/RF module where there would be 3 connections on the Tx Rx UART lines (all at 5v TTL level) but I'm thinking only 2 devices will be active at a time and I don't wont the third to interfear so I should disable it right?
The connections would be
- Tx/Rx lines header pins connection for the ATmega
- Tx/Rx lines connection for FT232R USB chip
- Tx/Rx lines connection for RF tranceiver module

What I want to be able to do is:-
- use USB to RF (nothing connected to the uC header connection), should be no problem
- uC to RF, nothing connected to USB but not sure what the state of the USB chips connections will be so should disable using the reset pin (no chip select), no problem
- ATmega to USB, disable RF module so doesn't interfear with possible received random grabage however does not have a chip select pin so will disable the supply voltage.

Is the way I'm thinking of handling the above 3 scenarios adequate?
I think it should be ok, its just like a bus, only enable the parts that are communicateing so you don't get bus conflict with multiple devices trying to drive the bus.
Does anyone have any ideas or thoughts of a better way to do this?

Also I would like to power it via USB when USB is connected and via the power suply on the ATmega board when the headerpins are connected
what would be the best way to do this? use a jumper to select the power? Or would a simple diode be enough? such as
Option 1) USB power ---->|---- microcontroller +5v
Option 2) USB power ---->|---- +5v ----|<---- microcontroller

Thanks for your responses

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

At a guess, you'll have to do a little more than just turn on/off power to the rf unit. You'll most likely need a multiplexer to flip around the rx and tx pins depending on what mode you want. Start with a table that outlines what needs to connect to what in each of the modes. Then look at how you would configure a multiplexer ic like a 4052 to switch the various combinations. You'll then need to figure out a means of detecting what configuration you want to run at a given time.

Diodes to gate the usb and other power source should be fine. You might want to use schottky diodes for less voltage drop - something like a 1N5817

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

thanks for the reply Kartman, your right, I started lay out of schematic and realised for 3 devices can't just hook up the Tx & rx lines to them, they have to be swapped around for some connections, I was thinking of just using jumpers (a few) as it would be simple. but changing from 1 configuration to the other would have to be done manually which wouldn't be too bad but be better if the uC could select usb or RF. I'll look at the multiplexer you mentioned, thanks for the feed back