4
\$\begingroup\$

CD4504BE Datasheet: http://www.ti.com/lit/ds/symlink/cd4504b.pdf

I've been searching all over the web for a proper example of the use of this IC, but I haven't found anything. My basic application is to shift the 5V SPI signals from ATmega328P (Master) to the 3.3V ESP8266 (Slave).

The below diagram shows how I believe it should be connected:

CD4504BE Connections

Questions:

  1. Are these connections correct? If not, how should these be connected?
  2. Regarding the MISO line, I show it as connected directly from ESP8266 to ATmega328P. This works, but ideally I would like to shift this 3.3V signal up to 5V. Is this possible with a single IC? My assumption is no, I would need a second CD4504BE. If it is possible, how should it be connected?
\$\endgroup\$
2
  • 2
    \$\begingroup\$ Can I suggest using a more modern part? You'll find that there are numerous bidirectional, 4-bit level shifters that very neatly solve your problem. For instance, the TI TXS0104. \$\endgroup\$
    – uint128_t
    Feb 16, 2017 at 2:42
  • \$\begingroup\$ It is a good suggestion, as I mentioned in my other comment the reason I selected the CD4504BE was because it was the lowest cost option available in a DIP package. \$\endgroup\$
    – Pat
    Feb 17, 2017 at 0:17

2 Answers 2

4
\$\begingroup\$

Are these connections correct? If not, how should these be connected?

Yes. Except that SELECT pin shall be connected to Ground.

I would like to shift this 3.3V signal up to 5V. Is this possible with a single IC? My assumption is no

You are right.

I would need a second CD4504BE. If it is possible, how should it be connected?

You can opt. for second IC, you have to swap VDD and VCC connection.
But, If you can use single IC solution, you can find many better solutions. As mentioned in the comment the 4 bit bidirectional level translator, TXS0104E, can do the job of both ICs.

Here is the block diagram with the voltage rating:
ESP device will be the system controller(block to the left) and Arduino will be the system (block in the right). Voltage ratings suggest that, it meets your expectation.

enter image description here

for MISO line
you can also consider this and works for sure.

Low Side - ESP  
High Side - Arduino  

enter image description here

The above circuit can be simply repeated thrice and you do not need the level shifter IC at all. You just have to swap Low side and High side for MOSI, CS and CLK pins.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you for the response. The reason I selected the CD4504BE was because it was the lowest cost option available in a DIP package. Appreciate the info on the TXS0104E, it certainly is the better solution. \$\endgroup\$
    – Pat
    Feb 17, 2017 at 0:12
1
\$\begingroup\$

On page one, when SELECT is pulled down, it does CMOS to CMOS conversion. Since the Arduino and the ESP8266 are both CMOS uC, you should pull the SELECT pin down. Vss goes to ground.

You will need 2 of these ICs. For going from Arduino to ESP8266:

Vdd as shown in the table in page 2 should be the voltage level of the ESP8266 (3.3V) and Vcc Arduino 5V.

For ESP8266 to Arduino:

Vdd should be 5V and Vcc 3.3V.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you for the additional information, I will connect it accordingly and add a second IC if required. \$\endgroup\$
    – Pat
    Feb 17, 2017 at 0:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.