2
\$\begingroup\$

I have a CAN circuit from another project, and I want to reuse it and connect to my microcontroller, however it is a 5V transceiver and my microcontroller is 3.3 V, is it OK to connect TX and RX directly to my microcontroller?

Microcontroller: http://www.st.com/content/ccc/resource/technical/document/datasheet/03/b4/b2/36/4c/72/49/29/DM00071990.pdf/files/DM00071990.pdf/jcr:content/translations/en.DM00071990.pdf

Transceiver: http://ww1.microchip.com/downloads/en/DeviceDoc/20001667G.pdf

The pins I want to use are pin 93 and pin 163.

Microcontroller output:

Enter image description here

\$\endgroup\$
  • 3
    \$\begingroup\$ If and only if the mcu's pins are 5V-tolerant. Check from datasheet. \$\endgroup\$ – Rohat Kılıç Aug 7 '17 at 22:15
  • \$\begingroup\$ @RohatKılıç I checked the I/O structure, they are 5v tolerate I/Os \$\endgroup\$ – yxing Aug 7 '17 at 22:44
  • 2
    \$\begingroup\$ You also need to verify that the specified output high voltage of the MCU running on a 3.3v rail comfortably exceeds the input high threshold of the CAN. Often this is the case, but not always - you should actually compare the VOH of the MCU data sheet to the VIH of the CAN data sheet at the intended supply voltage for each. \$\endgroup\$ – Chris Stratton Aug 7 '17 at 23:03
  • 1
    \$\begingroup\$ You need to compare the VIH and VOH specs. For example the VIH of your transceiver is listed at 2 volts, ie, it needs this voltage or higher to reliably interpret a "high". Probably the STM32 output will exceed that on a 3.3v supply, but it would be a good exercise to find the line in the data sheet that says so conclusively. \$\endgroup\$ – Chris Stratton Aug 7 '17 at 23:41
  • 1
    \$\begingroup\$ @yxing I know that your goal is to re-use your circuit for the CAN transceiver that you listed above, but just FYI, the MCP2562 does the RX/TX level shifting for you. Check it out: ww1.microchip.com/downloads/en/DeviceDoc/20005167C.pdf Figure 1-2, page 6. \$\endgroup\$ – Daniel Aug 8 '17 at 23:59
4
\$\begingroup\$

It should indeed work

The Vih on the TXD pin of the CAN transceiver you're using is 2.0V, while the Voh for the STM32 is 2.4V; considering that the STM32 family has 5V tolerant input pins for most of its digital-only I/Os (including the ones you're using assuming we're talking about the LQFP176 package here), you're good on both sides of the deal here.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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