Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Crashing Data - Logic Gate?

Status
Not open for further replies.

wuchy143

Member
I have attached a drawing of the issue I"m trying to get to the bottom of. The two chips of concern are the FT232RL chip and the PIC18F2450. They are both USB chips which are connected to a USB switch in the attached drawing. (ADG787) We will be switching between the two USB chips depending on the state of the switches in the dip switch in the top right of the drawing. The way I have it connected this system should work except the FT232RL and the PIC18F2450 will be receiving data at the same time creating data to crash into eachother. It would be nice to only have one of the chips populated at a given time but I don't have the luxury.

Is there a nice way to get around this? I was thinking of holding one of the chips in reset. I was also thinking of some sort of combinational logic. I feel like I'm leaving information out but don't want to explain it too much and confuse anyone. Let me know if more info. is needed.

Thanks

-mike
 

Attachments

  • crash.pdf
    251.9 KB · Views: 87

Papabravo

Well-Known Member
As I understand the USB protocol you absolutely cannot do what you are trying to do. It is exactly this kind of thinking that USB was designed to eliminate. If a USB function (their words, not mine) can "hear" activity on the bus then it must respond even before it has been assigned an address. If it cannot correctly hear the results of its actions then an enpoint(their words not mine) needs to STALL. In terms of the two devices correctly enumerating(their words, not mine), what is the problem with having both devices active at the same time but with different addresses assigned by the host. One device could remain idle while the host conducts business with the other one.

If you still feel the need to do switching, which I must confess seems dubious at best, in addition to holding one or more chips in RESET you may wish to consider switching VCC to one or both chips. You do need to worry about the off-state impedance of things connected together, but the current approach is problematical as it is.
 
Last edited:

wuchy143

Member
Hi,

Thanks for the response. I am a little confused. Please bare with me. The ADG787 is a chip made for this type of application. It's a USB switch. This is a design I"m about to go into layout with so I may need to proto it up to understand it better. Only one USB chip will be able to be seen by the host at a time. Though both chips will be populated at all times. I just want to protect myself from whatever the chip which isn't connected to the host is sending back up to the UART. If I am able to make something which fixes this fact I think it should work. Or not?
 

Papabravo

Well-Known Member
This part is not really a special purpose USB switch. OK it is USB1.1 compatible wheras most stuff nowadays is USB2.0 with USB 3.0 just starting to show up. It is still just an analog switch. What you are trying to do will cause chaos on the USB bus each time you try to make a switch. You still have not offered any convincing argument for why you cannot have both devices on the USB bus simultaneously.

I would consider ways to multiplex/demultiplex the RX/TX on your board since that is where the problem is, and let the USB stuff alone. For starters a single 2-Input AND gate implements the required logic if you can depend on the inactive device holding it's TX/RX line high. If not then a 2:1 logic mux is the answer in each direction with the other held inactive. Why won't that work?
 
Last edited:

wuchy143

Member
This part is not really a special purpose USB switch. OK it is USB1.1 compatible wheras most stuff nowadays is USB2.0 with USB 3.0 just starting to show up. It is still just an analog switch. What you are trying to do will cause chaos on the USB bus each time you try to make a switch. You still have not offered any convincing argument for why you cannot have both devices on the USB bus simultaneously.

I would consider ways to multiplex/demultiplex the RX/TX on your board since that is where the problem is, and let the USB stuff alone. For starters a single 2-Input AND gate implements the required logic if you can depend on the inactive device holding it's TX/RX line high. If not then a 2:1 logic mux is the answer in each direction with the other held inactive. Why won't that work?

Hi Papabravo,

A little background may help us. This is for a military keyboard which for the first 5-10 years of it's life it will be ran primarily as a USB/RS422 keyboard which can switch between the two. Later down the road they want the capability of being able to use our PIC18F2450 which we have written firmware for USB. This can be done by just dialing the DIP SWITCH to enable it. So you can think of the USB chips as mutually exclusive. Though, no matter what they both need to be in the keyboard whenever it runs. It's political why it is this way at my company..I don't agree with the implementation they want me to design..but it is what it is and it's my job to make it work :)

Are you saying to put a single logic gate on each Rx and Tx line for each USB chip? Also, how would you strap the gates? Should I think about a different mux instead of the 74hc4066. Seems like that is the starter of my problems.

-mike
 

Papabravo

Well-Known Member
I'm sorry you are in a psoition where politics trumps technology.

To help you see a way out of your problem. If you take two serial port signals, TX for example, and run them to an AND gate what you get by DeMorganizing is "a low or a low is a low". If you can depend on one of the inputs to be high while the other one beats up and down the output of the gate will follow the input that is beating up and down. Since you may not be able to depend on that here you need a 2:1 mux so you can select which input you will look at. You also need a 1:2 demultiplexer to take a singe input and route it to two different places.

The following components may work for you:
https://www.electro-tech-online.com/custompdfs/2009/11/sn74lvc2g157.pdf
https://www.electro-tech-online.com/custompdfs/2009/11/NL7SZ18-DPDF.pdf

Give those datasheets a whirl and see if they help you solve your problem.
 
Status
Not open for further replies.

EE World Online Articles

Loading
Top