- Fri Mar 10, 2006 11:24 am
#10859
First, the problem:
I need to interface a bunch of parts to an ATmega128. They are:
- USB interface (cp2103 from sparkfun)
- Motor controller (polulu micro dual serial motor controller, here)
- Wireless receiver (more on that here).
All of these devices communicate via serial RX/TX. Ideally, I'd like to get them all talking on a single UART. Theoretically this should be possible, because:
-The USB module should override all other modules, disabling communication to the motor controller and wireless receiver. Assume the uC would "know" when the USB module is active (by some magic I have yet to figure out).
-The motor controller only listens, never talks, so it doesn't need access to the RX pin on the UART.
-The wireless receiver only talks, never listens, so it doesn't need access to the TX pin on the UART.
I'm certain there's some kind of pulldown transistor setup I could implement (possibly from the 3.3V output of the cp2103 to NPN base) to disable the signals to the wireless receiver and motor controller when the USB connection is active, but I'm just not bright enough to figure it out.
I think the basic problem is that I just don't know enough about transistors. What is the difference between a PNP and an NPN transistor? Every time I try to read up on this, terms like "gallium arsenide", "doping", "current gain", and "Bell Labs" induce a loud humming noise in my brain until I fall unconscious. What is the fundamental, functional difference between the two? If I connect the 3.3V output from the cp2103 to base, will that be enough to trigger the transistor if the voltage at the collector is VLOGIC (5V)? Does that last question even make sense?
How can I get multiple devices talking on an RX/TX "bus"-type architecture, without busting my brains trying to code a comms protocol?
Before anyone jumps in with an immediate solution, here's what I've got so far:
- No, I'm not interested in coding a software UART, thanks.
- And yes, I know that having multiple devices on an RX/TX line is less than ideal. Unfortunately, I can't control the bricks, only the mortar I use to put them together
I need to interface a bunch of parts to an ATmega128. They are:
- USB interface (cp2103 from sparkfun)
- Motor controller (polulu micro dual serial motor controller, here)
- Wireless receiver (more on that here).
All of these devices communicate via serial RX/TX. Ideally, I'd like to get them all talking on a single UART. Theoretically this should be possible, because:
-The USB module should override all other modules, disabling communication to the motor controller and wireless receiver. Assume the uC would "know" when the USB module is active (by some magic I have yet to figure out).
-The motor controller only listens, never talks, so it doesn't need access to the RX pin on the UART.
-The wireless receiver only talks, never listens, so it doesn't need access to the TX pin on the UART.
I'm certain there's some kind of pulldown transistor setup I could implement (possibly from the 3.3V output of the cp2103 to NPN base) to disable the signals to the wireless receiver and motor controller when the USB connection is active, but I'm just not bright enough to figure it out.
I think the basic problem is that I just don't know enough about transistors. What is the difference between a PNP and an NPN transistor? Every time I try to read up on this, terms like "gallium arsenide", "doping", "current gain", and "Bell Labs" induce a loud humming noise in my brain until I fall unconscious. What is the fundamental, functional difference between the two? If I connect the 3.3V output from the cp2103 to base, will that be enough to trigger the transistor if the voltage at the collector is VLOGIC (5V)? Does that last question even make sense?
How can I get multiple devices talking on an RX/TX "bus"-type architecture, without busting my brains trying to code a comms protocol?
Before anyone jumps in with an immediate solution, here's what I've got so far:
- No, I'm not interested in coding a software UART, thanks.
- And yes, I know that having multiple devices on an RX/TX line is less than ideal. Unfortunately, I can't control the bricks, only the mortar I use to put them together