This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

3.3V supply for ttl/rs232

Hi,
I find a problem when I wanted to run a ATMEGA32 with VCC supply of 3.3V, everything is okay except USART. I see that if supply voltage is 5V then USART works well. With the same ttl/rs232 module and supply voltage of 3.3V USART works fine with STM32 MCU. I used internal 8 Mhz clock both for AVR and ARM. what is the suggestion to overcome the problem in AVR?

  • You forgot the most important thing in your post. To mention exactly what transceiver chip you are using to convert between logic-level and RS232.

    A good transceiver chip designed for 3V3 supply voltage should work with both of your processors.

    Have you figured out if it's incomming or outgoing data that is the problem?

    An older 5V transceiver designed for TTL use does not give a full logic level swing that todays MOS chips does. This was ok, because a TTL "high" was about 2.4V when powered by 5V. Some microcontrollers supports very "sloppy" input signals to allow them to intermix with TTL logic when they are run at 5V. Some other microcontrollers wants full-swing input signals as intended for the CMOS standard.

    Anyway - the datasheet for your transceiver and the datasheet for your processor will clearly indicate the output high/low voltages produced, and the required input high/low voltages required. And an oscilloscope or multimeter can tell if an output signal for some reason is not fulfilling the datasheet specification - such as if you have a damaged output or input pin.

  • Don't know which ATMEGA32 you are talking about.

    Maybe see this:
    forum.arduino.cc/index.php

    I believe the Arduino fuse settings enable the Brown Out Detector for just over 4 volts. You may not be able to use 3.3V unless you can change the fuses.

    Check the ATmega328p specs for the maximum clock speed for a given voltage... At 1.8V you can clock upto 4MHz, at 2.7V upto 10MHz and 4.5V upto 20MHz.

  • Dear Per,
    Thanks for the points.
    I used both MAX232CSE and ST232C as transceiver module chips.
    I find problem when sending data to PC. The characters in terminal were like this '????'.
    In scope for both 5V and 3V3, I see a good -5V to 5V signal amplitude in the output of transceiver chip.
    Atmega32a voltage in datasheet is 2.7V to 5.5V.
    In Max232 datasheet the supply voltage is in range of 4.5V to 5.5V. If I need to run max232 with 5V why it works with 3V3 with STM32?

  • Dear John,
    It is ATMEGA32A AU 1315.
    The program runs in Atmega32A in 3V3 with no problem like SPI communication but just USART is not okay.
    Maybe I should use a transceiver designed for 3V3 supply voltage.

  • "In Max232 datasheet the supply voltage is in range of 4.5V to 5.5V. If I need to run max232 with 5V why it works with 3V3 with STM32?"

    When you operate anything outside its specified limits, the behaviour is undefined.

    That means it could do absolutely anything at all - without any apparent rhyme, reason, consistency or repeatability.

    You could say you just got "lucky" (sic) in the STM32 case - or you might consider it unlucky, as it led you to the false conclusion that everything was fine...

  • "In Max232 datasheet the supply voltage is in range of 4.5V to 5.5V. If I need to run max232 with 5V why it works with 3V3 with STM32?"

    Isn't that obvious?

    Because the two processors - when powered by 3.3V - may have slightly different high voltage levels for their ouputs. And different high voltage detection levels for their inputs. So one of them might just manage to get your MAX232 to correctly detect a high logic level while the other processor can't.

    Why do you think the world got transceiver chips designed for 3V3 use? The 5V transceivers were designed before the world moved towards 3V3 for microcontrollers.

    You should never have been in this situation in the first place, because you should never have designed the product without having walking through the datasheet for all used chips and then verified what supply voltages they support and what signal levels they support and supply. Your design is broken - so it isn't strange when you get bad results.

    Note that many processors have one set of documentation intended for the hardware designer. It focuses on voltages, temperatures, currents, rise/fall times etc. Then another document for the software developer, that describes registers etc. If you design hardware, then you need to walk through the hardware documentation before selecting which components to use.

    The data sheets are contracts. The manufacturer documents what they promise to deliver to the customer. If you violate the rules of the contract, then you can't expect the products to deliver the service that was documented in the contract. You broke your side of the contract, so the manufacturer/chip is free to break their side of the contract.

  • That means it could do absolutely anything at all - without any apparent rhyme, reason, consistency or repeatability.

    Anything at all??? Looks like you're in the realms of fantasy again.

    Even though I've had a large electrolytic capacitor fly past my ear when connected the wrong way round (actually, more than once), it's highly unlikely that an RS232 chip is going to spontaneously morph into an irresistible virgin when driven from too high a voltage.

  • OK, Thanks All.
    Reasonable enough to be convinced.

  • it's highly unlikely that an RS232 chip is going to spontaneously morph into an irresistible virgin when driven from too high a voltage.
    first we are discussing running from too low a voltage. Second with too high a voltage the result is more likely a brick than a 'virgin'

  • Hyperbole:

    So when a paid code reviewer says that your code is a pile of cow excrement, they probably mean to say that they noticed a typo in a comment.

  • "So when a paid code reviewer says that your code is a pile of cow excrement, they probably mean to say that they noticed a typo in a comment."

    No, I'd say Hyperbole is how that code reviewer described their skills before getting the job. Since it would be way better if the code reviewer managed a constructive report about what was found wrong and things to consider to improve the code.

  • No, I'd say Hyperbole is how that code reviewer described their skills before getting the job. Since it would be way better if the code reviewer managed a constructive report about what was found wrong and things to consider to improve the code.

    Seems reasonable. Also highly likely if that code reviewer calls himself a consultant ;)