PDA

View Full Version : 18F4550 running 3.3V (serin2) and 16F877 running 5v (serout2), is possible?



Pimentel
- 25th January 2014, 18:32
Hello all,

Somebody knows solve it? I have a circuit based on 18f4550 as RX (serin2) using 3,3v as power, and other circuit using 18f877a running 5,0V. I puted a 1k resistor of the TX to the RX pins but sometimes the data fail. I thinnk that is necessary to use some converter. I alread put a divider resistor (15k and 10k without sucess.

Pimentel

Gusse
- 25th January 2014, 19:42
See old Philips I2C application note AN97055 (http://www.adafruit.com/datasheets/an97055.pdf), page 10 (Devices with different logic levels connected via the bi-directional level shifter).
In addition what they propose, you can use e.g BS170, 2N7000, etc...

aratti
- 25th January 2014, 21:25
Two diodes in series will give you a 1.2 volts drop just what you need!

Cheers

Al.

Gusse
- 25th January 2014, 21:51
I was already thinking the next generation version with both way communication (a step ahead) ;)
2 diodes in series is a good solution!

Pimentel
- 26th January 2014, 13:05
I tried using 2 diodes (1N4007) but did not work. I also tried to use signal diode 1N4148 but failed. Finally tried with two fast diodes (schotky) and did not work!
For now the best way of functioning was linking directly (1k resistor between tx(5v) and rx (3,3v) but I know this is wrong and yet sometimes fails!
Anyone have any more ideas?

Gusse
- 26th January 2014, 13:48
Sounds that you may have other problems than signal line and components between two PICs.
- Power supply and de-couplings (internal noise)?
- External noise coupling (shielding to transmission path between PICs)?
- Grounding of PICs (GND references)?
- Grounding between PICs (GDN reference)?
- Used TX speed (signal integrity)?
- etc...

Pimentel
- 27th January 2014, 10:54
Gusse,

You was rigth! My problem was grounding between PICs. My wiring was wrong! Sorry!
Using a 1k to 10k resistor between Tx(5v) and Rx(3,3v) it is working fine.
Then, I put 2 diodes without resistor and doesn't work. I removed 1 diode and works fine. Then I puted a 10k + 1n4007 and works fine too.
I tried with 2 diodes 1N4148 but its fail. Using just 1 signal diode fail also.
Now my circuit is 10k resistor in serie with 1 diode 1N4007! Do you think it is ok?
Thanks again!

aratti
- 27th January 2014, 12:50
I suggest to remove the diodes and leave the 10k, hence add a 20k resistor from the 3.3V input pin to ground, in order to create 1/3 divider network.

Cheers

Al.

Pimentel
- 28th January 2014, 14:21
Aratti,

I removed the diode and used your suggestion with sucess. Divider network was the better solution!
Thanks