UART in AtmelStudio6

Guest #2901895
Rate this post
• ▲ useful
▼ not useful
Greetings to all readers!

I have a nice problem and I am happy for all your answers.

Preliminary:

I tried to send data from my atmega8 to HTerm 0.8.1 beta but it received 
only \0\0\0...
Hence, I concentrated on the simulation in AtmelStudio6: The code I used 
is visible on http://www.mikrocontroller.net/articles/AVR-Tutorial:_UART 
under "Senden von Zeichen" and in the attachment.

Symptoms in the Simulator of AtmelStudio6:

When debugging I observed some effects that are hopefully interrelated:
- URSEL stays at 0.
- No changes can be observed in UDR.
- UDRE wont come back to 1...not after 1200 steps.
- TXC stays at 0, too.
- Only two loop-cycles ('T' and 'e') are run through, then UDRE is set 
to 0...and the program wont exit the serout-sub-routine.

I read the fantastic mannual and browsed the forum but couldn´t find a 
hint to make the uart work.

Thank you for your comments and ideas!

Best regards

max
Attached files:
Guest #2903636
Rate this post
• ▲ useful
▼ not useful
I found an answer to the UDR and the TXC "problem" and probably also for 
the URSEL "problem" in the Atmel Studio6 Manual:

"In some cases, read and write access go to different hardware 
locations. The effect ot this may be that attempting to change a 
register/bitfield has no visible effect even if the register is actually 
written (like the USART UDR register in many devices), or that the 
effect is delayed by one or more cycles (like registers with double 
buffering)"

...to be continued...

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.