Hi all,
I am wondering how to interface with this bus switch from a ESP32. I need to drive OE1 and OE2 LOW at 5v , see datasheet here : http://www.farnell.com/datasheets/22883 ... 1520888675
I know that I can only drive up to 3.3v from the ESP32 directly, so is there something I need in the middle here?
Also - Is it possible to drive both OE1 and OE2 pins low from one GPIO on the ESP32? It would be great to get a schematic for any suggested solutions - thanks!
How would I interface with this bus switch
-
- Posts: 19
- Joined: Tue Mar 06, 2018 2:08 pm
- Vader_Mester
- Posts: 300
- Joined: Tue Dec 05, 2017 8:28 pm
- Location: Hungary
- Contact:
Re: How would I interface with this bus switch
Hi,
My short answer is: Yes, you can drive them low, but because it is 5V, you will need an N-channel MOSFET.
A "schematic" is seen below. You need to set your GPIO high, to turn the MOSFET on, and drive the OE pin to ground. When the MOSFET is off (GPIO low), the 10kOhm resistor will pull the OE pin high, disabling it.
You can connect both OE pins together so they are controlled in the same time.
My short answer is: Yes, you can drive them low, but because it is 5V, you will need an N-channel MOSFET.
A "schematic" is seen below. You need to set your GPIO high, to turn the MOSFET on, and drive the OE pin to ground. When the MOSFET is off (GPIO low), the 10kOhm resistor will pull the OE pin high, disabling it.
You can connect both OE pins together so they are controlled in the same time.
Code: Select all
.
OE1 OE2
| |
Pullup |--------------------------|
5V---------10kOhm----------|
|drain
ESP GPIO ------------gate|E|
|source
|
GND
Code: Select all
task_t coffeeTask()
{
while(atWork){
if(!xStreamBufferIsEmpty(mug)){
coffeeDrink(mug);
} else {
xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
}
}
vTaskDelete(NULL);
}
Re: How would I interface with this bus switch
The datasheet says the control inputs are TTL compatible. That means anything over 2.0V should be recognised as 'high'. So I would say that there's no need for a MOSFET circuit.
BTW: as the 'on' resistance of each switch is about 4Ω, I don't understand how this device can do level shifting.
BTW: as the 'on' resistance of each switch is about 4Ω, I don't understand how this device can do level shifting.
- Vader_Mester
- Posts: 300
- Joined: Tue Dec 05, 2017 8:28 pm
- Location: Hungary
- Contact:
Re: How would I interface with this bus switch
I don't think it is used for level shifting, rather then contring some IOs or whatever.Archibald wrote:The datasheet says the control inputs are TTL compatible. That means anything over 2.0V should be recognised as 'high'. So I would say that there's no need for a MOSFET circuit.
BTW: as the 'on' resistance of each switch is about 4Ω, I don't understand how this device can do level shifting.
Code: Select all
task_t coffeeTask()
{
while(atWork){
if(!xStreamBufferIsEmpty(mug)){
coffeeDrink(mug);
} else {
xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
}
}
vTaskDelete(NULL);
}
Who is online
Users browsing this forum: Bing [Bot] and 173 guests