Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

microcontroller serial IO port voltage levels

Status
Not open for further replies.

neazoi

Advanced Member level 6
Advanced Member level 6
Joined
Jan 5, 2008
Messages
4,155
Helped
13
Reputation
26
Reaction score
15
Trophy points
1,318
Location
Greece
Activity points
37,164
Hello,
I have an atmega88 programmed to communitace with a PC (interchanging data) through serial port.
The author of the circuit does not use a max232 chip as a buffer as shown here https://obrazki.elektroda.pl/79_1258865852.gif (is this correct diagram?) but he communicates the micro directly with the PC port.

I was wondering if the max232 will do any good (voltage levels?) or I just leave it out.
 

UART logic level to RS232 need level conversion and inversion. Level conversion would at least involve a voltage divider for processor RxD. RS232 can receive 5V CMOS level at worst case, although the specification requires +/-3V level.

Inversion does require additional logic however, it's not provided by ATmega processors. Or you have to use software UART.

It seems like regular UART communication hasn't enough thrill. So you want to try weird designs.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
UART logic level to RS232 need level conversion and inversion. Level conversion would at least involve a voltage divider for processor RxD. RS232 can receive 5V CMOS level at worst case, although the specification requires +/-3V level.

Inversion does require additional logic however, it's not provided by ATmega processors. Or you have to use software UART.

It seems like regular UART communication hasn't enough thrill. So you want to try weird designs.

So would you suggest using the max232 just to make sure?
the author of the circuit has not used it at all so I do not know what he has done in software. What if he performs inversion in software? then the max232 may re-invert the signal?
 

The logic level must be inverted and have proper voltage level, if he did it in software (and hardware for voltage level), no you won't need the MAX232. If there is no "translation" in software, then yes, use a MAX232. Do you have the code? is there a "RS232 language translation" in the code?
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
The logic level must be inverted and have proper voltage level, if he did it in software (and hardware for voltage level), no you won't need the MAX232. If there is no "translation" in software, then yes, use a MAX232. Do you have the code? is there a "RS232 language translation" in the code?

The code is a little bit compicated, so I cannot figure it out.
here are the project files and schematic.
I would appreciate your suggestion on this.
 

Attachments

  • schematic.png
    schematic.png
    1.7 MB · Views: 109
  • 090159-11.zip
    324.1 KB · Views: 80

On the schematic there is no MAX232 or something similar, he must have done it in the code.

BUT, you can add a MAX232 if you like, it will be easier for you. It's your decision.

Do you have to use only his code or can you also make some of your own?
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
On the schematic there is no MAX232 or something similar, he must have done it in the code.

BUT, you can add a MAX232 if you like, it will be easier for you. It's your decision.

Do you have to use only his code or can you also make some of your own?

I do not hink I can write assembly to implement a BASIC interpreter, no, not at all, so I have to use his code.
Even if he has done inversion in software the MCU cannot do level shifting, I do not know if it will work say on older PCs
 

Okay so you don't have many options.
You can try to find the interpreter in his code if there is one, or you can connect it to the serial port of the PC and see if it works, if it doesn't, try with the MAX232.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
Okay so you don't have many options.
You can try to find the interpreter in his code if there is one, or you can connect it to the serial port of the PC and see if it works, if it doesn't, try with the MAX232.

yes, I think I will try-and-see. It will probably work, since it has been tested by him.
Thanks a lot
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top