Continue to Site

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.

ENC28J60 @ 3V to 18Fxxxx @ 5V how do you do the level translation?

Status
Not open for further replies.

blueroomelectronics

Well-Known Member
Looking for a simple solution for the SPI bus between ENC28J60 and a 5V PIC. Since the ENC28J60 is 5V input tolerent that's easy 100 ohm resistor, but can I hook the SPI directly to the PICs SPI DI port? Can I do it with a couple of transistors?
 
How about this as a quick and dirty solution.

**broken link removed**

When 3V is transmitting, diodes conduct so,
0 -> 1.4
3 -> 4.4
When 5V transmitting,
5 -> tolerant anyway.
0 -> 0

Mike.
 
Last edited:
Try here:

https://www.sparkfun.com

Theres a schem and tutorial on the news on the main page.

Worked for me, but impractical for more than a few lines. If the lines are unidirectional I believe some 74 series (LVHC?) buffers can run down to 3v, but the inputs have up to 7v input protection, making them ideal for 5v -> 3.3v conversion.

Blueteeth
 
Great solutions all around, much thanks.

The PIC is running at 5V for two reasons, speed and compatibility with my 5V ICD.

Hmm looking through and a reply from the Microchip forums seems the logic high for a 5V PIC is 2.0v and the logic high output from the ENC28J60 is 2.6V (3.3V-0.7) so it should work directly, if so then why do most schematics include some sort of level conversion?

It's going to a 18F2620 (64K Flash bytes) and I may avoid using an external EEPROM in the design since the 18F has those great table instructions.
 
Last edited:
blueroomelectronics said:
Looking for a simple solution for the SPI bus between ENC28J60 and a 5V PIC. Since the ENC28J60 is 5V input tolerent that's easy 100 ohm resistor, but can I hook the SPI directly to the PICs SPI DI port? Can I do it with a couple of transistors?

It will not work directly, because on PIC high level starts from 0.7 Vdd and up.

On one project I hooked MMC flash card to 5V PIC via 5V tolerant 3.3V powered 74 series AND gates. Worked as a charm.

Don't mind the attached picture.
 

Attachments

  • pic-input-voltage.jpg
    pic-input-voltage.jpg
    131.1 KB · Views: 594
Last edited:
dipmicro said:
It will not work directly, because on PIC high level starts from 0.7 Vdd and up.

On one project I hooked MMC flash card to 5V PIC via 5V tolerant 3.3V powered 74 series AND gates. Worked as a charm.

Don't mind the attached picture.
Pictures are great, I love em. I read that picture differently, the 0.8 VDD +.25 is for less than 4.5V the 5V spec says 2.0 volts min. Maybe I'm reading it wrong...

MMC cards are not 5V tolerent... the ENC28J60 is.
 
Last edited:
I'm guessing that level transition was (and still is) needed for 16 series as these operate on 0.7Vdd (3.5V). The 18 series appear to have been designed to work with 3V logic.

Mike.
 
you'd think Microchip would have an app note detailing an easy way to connect one of their 3.3v products to one of their 5v products?

Papabravo hit the nail on the head according to Microchip;

The ENC28J60 is a 3.3V part; however, it was designed to be easily integrated into 5V systems. The SPI CS, SCK and SI inputs, as well as the RESET pin, are all 5V tolerant. On the other hand, if the host controller is operated at 5V, it quite likely will not be within specifications when its SPI and interrupt inputs are driven by the 3.3V CMOS outputs on the ENC28J60. A unidirectional level translator would be necessary.

An economical 74HCT08 (quad AND gate), 74ACT125 (quad 3-state buffer) or many other 5V CMOS chips with TTL level input buffers may be used to provide the necessary level shifting. The use of 3-state buffers permits easy integration into systems which share the SPI bus with other devices. Figure 2-5 and Figure 2-6 show example translation schemes.

alternately, how about using one of the sexy new 18F's with the ethernet mac and phy built in!? The PIC18F67J60 has 128KB of flash on board!
 
The 18F67J60 is 3.3V and the TQFP package is really tricky to hand solder, really nice part though.

Looks like I'll use the 74HCT solution. I do think the diode version is pretty cool.
 
blueroomelectronics said:
I read that picture differently, the 0.8 VDD +.25 is for less than 4.5V the 5V spec says 2.0 volts min.

Actually, the parameter D040 is with TTL buffer. The SDI pin does not have a TTL buffer, so that parameter is irrelevant for your application and parameter D041 (RC3 and RC4) applies.

blueroomelectronics said:
MMC cards are not 5V tolerent... the ENC28J60 is.

Correct. One can connect directly to ENC but has to clamp the voltage to flash card:

**broken link removed**

But that was not your question. I understood you were asking about path from ENC to PIC.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top