Using USART of ATmega128

Hi guys!

I’m trying to use USART0 of ATmega 128 but I have soma troubles: I’m quite sure to initialize in right way the USART setting the correct values in the status and control registers. Debugging the code with AVR Studio i seems to work in the right way. But when I try to read from COM1 of the PC using Hyper Terminal I can’ read anything!

Can anybody help me please?

Thank U! :smiley:

There could be any number of problems here.

  1. Check that hyper term is set to the correct baud and port settings.

  2. Check the port configuration in Windows dev manager to make sure the baud and port settings are the same as what you’ve got setup in hyper term.

  3. Check to make sure you are using the correct baud rate divisor in your code.

  4. (and this is a stretch), check your chip! I actually broke the TX pin on my Mega169 the first time I inserted it into the STK502. We couldn’t figure out what was wrong until we put a scope on it.

Let me know if that doesn’t help and I’ll dig up some code I wrote for my 8515 setup.

Did you change the M103C fuse? The ATmega128 comes with this fuse set for ATmega103 compatibility mode. One problem this will cause is stack corruption because in compatibility mode, there is only 4000 bytes of memory instead of 4096.

Don

donblake:
The ATmega128 comes with this fuse set for ATmega103 compatibility mode.

Compatibility mode is enabled by default? Seems wierd…

roach:
Compatibility mode is enabled by default? Seems wierd…

That's what I too thought. It is indeed enabled by default - I've seen numerous people having problems because they didn't disable it.

Don