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.
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?
"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...
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.
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'
en.wikipedia.org/.../Hyperbole
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.
Seems reasonable. Also highly likely if that code reviewer calls himself a consultant ;)
View all questions in Keil forum