How would I interface with this bus switch

renegadeandy
Posts: 19
Joined: Tue Mar 06, 2018 2:08 pm

How would I interface with this bus switch

Postby renegadeandy » Tue Mar 13, 2018 11:39 am

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!

User avatar
Vader_Mester
Posts: 300
Joined: Tue Dec 05, 2017 8:28 pm
Location: Hungary
Contact:

Re: How would I interface with this bus switch

Postby Vader_Mester » Tue Mar 13, 2018 3:02 pm

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.

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);
}

Archibald
Posts: 110
Joined: Mon Mar 05, 2018 12:44 am

Re: How would I interface with this bus switch

Postby Archibald » Tue Mar 13, 2018 6:55 pm

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.

User avatar
Vader_Mester
Posts: 300
Joined: Tue Dec 05, 2017 8:28 pm
Location: Hungary
Contact:

Re: How would I interface with this bus switch

Postby Vader_Mester » Wed Mar 14, 2018 7:11 am

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.
I don't think it is used for level shifting, rather then contring some IOs or whatever.

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: alifepretend and 174 guests