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.

Any PICS with serial at CMOS levels?

Status
Not open for further replies.

PhilM

New Member
Are there any pics (Similar to the 16F628), that are availble with the serial at CMOS levels (3v?) as opposed to the traditional TTL (5v) levels?

Saves using a MAX232 chip I hope.

Thanks!
 
Ahh, I See....so if I supply it with 3v, the outputs will be at 3v levels? Doh, woulden't have thought of that!

Thanks Nigel, I appreciate your help :)
 
PhilM said:
Ahh, I See....so if I supply it with 3v, the outputs will be at 3v levels? Doh, woulden't have thought of that!

Thanks Nigel, I appreciate your help :)

The LF series chips are devices designed to run at less than 5V, but a normal F series will probably be OK anyway?.
 
Phil,

How are you expecting to not need a MAX232 by running the PIC at 3V? You only need a MAX232 if you want to generate the 9V or 12V for the PC signal.

But you can get away with not needing a MAX232 by using MOSFETs. Another Mike on here gave the suggestion to me and it works beautifully whether I run the PIC at 3V or at 5V.

Mike
 
The other thing that the MAX chips do, beside change the voltage level, is invert the signal. This is not a problem if you want to connect two pic chips together but is a big problem when connecting a pic to a PC. The only solution I know of is to bit bang the serial and invert it in software.

Mike.
 
um, when you use the hardware UART with a max232, it works just fine with a PC without any additional inverters. if you bit-bang it, just make sure to use the same logic levels as the UART does and you're fine (active high, and hold the line high between packets...). (yes, the max232 is inverting, but you also have to remember that in RS232, a negative voltage is a 1 and a positive voltage is a 0, so you WANT it to be inverting, in a sense)

also, if you look at sparkfun.com they have a discrete level shifter that uses only transistors, a diode, a cap, and some resistors, and can be built extremely small (and is much cheaper than a max232) not to mention, it typically works fine at all baud rates, and looks like it even maintains proper RS232 logic levels. i haven't gone back to max232's since I started using that circuit.
 
Hi Evandude,

I've gone to sparkfun.com but could not locate the said decrete level shifter RS232 interface in their website.

Can you possibly post a link or a schmetic?

Thanks.
 
This is not the SparkFun circuit but it's the simplest and most reliable I've found using only four parts... I've only used it up to 115,200 baud...

Regards, Mike
 

Attachments

  • rs-232_circuit_for_16f819.jpg
    rs-232_circuit_for_16f819.jpg
    48.7 KB · Views: 787
https://www.electro-tech-online.com/custompdfs/2005/06/RS232-Shifter.pdf

not quite as simple as the one posted above, but I know from personal experience it works great (and it uses components that just about anyone should have in their parts bin)

the sparkfun guys claim to use it up to 115200 baud as well, which seems like enough to me. in my experience, with hyperterminal at least, every time i send serial data at a high rate to my computer it garbles it anyway... (ie - often I have to wait 10, 20, 50 mS or more between packets)
 
Thanks Evandude.

I have some doubts with the pdf that you have posted. The signal TX on the header4 is connected to the output(collector) of a transistor. So I think it should be Rx instead but after I read the bottom of the pdf, it said TX is connected to the uP RX pin so no more problem there.

In my archive I also discovered I had the following circuit which bears some similarity with the pdf circuit that you have posted.

**broken link removed**
 
read the note right below the schematic in that PDF. it says that TX and RX are relative to the board... in other words, the RX pin connects to TX on the PIC, and vice versa.

the TTL signal for RS232 interfacing with "inverting" level shifters can be somewhat confusing, because the line should be normally high (when not transmitting) so you'd expect the logic to be active low, but it's actually still active high.

anyway, this page:
**broken link removed**
was everything I needed to know for all my serial interfacing, including UART and bit-banging. about halfway down the page, there's the two diagrams of the waveforms (at logic level, and at RS232 level)

but if you do it with those logic levels, it will work properly with a MAX232 or those transistor circuits (for instance, notice how a logic 1 is +5v for TTL, and -10V for RS232... in the transistor circuit, a +5v signal to the transistor would pull that line DOWN to a negative voltage, therefore you know that the signals don't need any extra inversion)
 
Yes. My fault about the pdf. :oops:

Got it. Basically, the max232 chip do the inverting so replacing it with the transistor/mosfet would not induce any extra inversion so no manual inversion is required in the data before sending out to the UART.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top