Electronics > Microcontrollers

PIC UART Level Issue

(1/5) > >>

Joseph1:
Want to connect PIC 16F628A directly to SIM800L (without any level converters) as in the schematic. The design works @ home, but in site condition it wont work.

All the trouble comes in SIM800L Transmitt path (When GSM modules recieves a call & SMS) in site condition the PIC won't recieve data properly.But when PIC transmit data (send call, send sms) it works nicely.

I have attached voltage levels of both PIC & SIM800L modules.

Are those levels matching?

jpanhalt:
Welcome to EEVBlog

At what voltage are you running the 16F628A?  If 5V, then 0.8VDD = 4V for hi (see DO41), so there may be a problem with that.  The 628A will operate at lower voltages, but at 3V its maximum operating frequency is lower.  Newer chips are available that operate fully at 3.3V and would require little, if any additional programming.  Although, I don't know (doubt) there is a pin compatible version.

JPortici:
It's 3.3V nominal, he already posted the same question in the microchip forum.

Have you (OP) tried looking at the data with an oscilloscope? In any case there is little margin for it to work, i would rather put a level translator (it can be as simple as two resistors and a mosfet)

Joseph1:
Thanks both of you.

My supply voltage for PIC is 3V3. After reading the comments I planned to change the design to power the PIC from 5V & add a level shifer.


--- Quote from: JPortici on October 08, 2021, 11:26:08 am ---It's 3.3V nominal, he already posted the same question in the microchip forum.

Have you (OP) tried looking at the data with an oscilloscope? In any case there is little margin for it to work, i would rather put a level translator (it can be as simple as two resistors and a mosfet)

--- End quote ---

You got it.My design is in marginal level.I guess that's why its why it is not working in noise environments.
I planned to add a level shifter & check.Here is my drawing.

How can I supply the low side Voltage for the level shifter? What voltage need & do I need another regulator for that?

MIS42N:
I think your original scheme should work. The Voh output is minimum 2.7V, The required input to the 628A is 2.64V. Close but still within specification. If noise is your problem it is probably the earth connection between the two chips. It is better to fix that than redesign.

If you do want to redesign, this might be useful. Many years ago, I made a Sidereal clock. http://www.cashin.net/sidereal/circuit.html, it shows how I used the 2N7000.

Most device outputs are capable of sourcing and sinking current, so you shouldn't need a pull up resistor on low side.  The gate voltage has to be a similar level to the low side high signal, so the 2N7000 is not conducting. This has to be balanced against the need to conduct with gate to low side low turning it on. You could determine it by experiment, but I would go for a gate voltage of 3.3V or thereabouts. You could provide it by a divider off the 5V rail and a bypass capacitor, the gate doesn't draw significant current.

Unfortunately, the 628A USART input doesn't have a weak pullup. In my circuit one of the outputs (the 1pps signal) goes to a pin that does have a weak pullup, so no additional pullup was required.

If you feel like doing something weird and had spare I/O pins, you could set up a comparator with input from the SIM800L and a reference voltage of say 2V, and send the comparator output to a pin which is connected to the RX pin. Get your level shift for free.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version