UART and simulator

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm desperately trying to simulate UART-reception in a 2313 using AVR Studio, and the UART is set up correctly.

I've even used sample code found here, but the RXC-bit never gets set, although my stimulus-file contains a valid set of data.

Does the simulator simply not support stimulus input to the UART?

Kind regards,
Morten Jensen

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Allow me to reply to my own posting...

It seems as if AVR Studio's simulator is quite buggy regarding the UART :

RXEN bit reversed.
Baud rate missing the divide-by-16
Start bit detection faulty. Even if there's no startbit, the UART begins receiving.
All bits receives as 1's.

Can anybody confirm this, or am I just waaaaaaaay out there?

Kind regards,
Morten Jensen

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have never had any problem with the UART in AVR Studio that wasn't my own doing. I use the 2313 extensively, as well as the 8515 and 8535, all UARTS work pretty much as expected. Maybe your problem rings a bell with someone else, but I would take another look at your code and hardware.

Good luck,
j.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't have any hardware yet, that's why I use AVR Studio's simulator.
I tried my own code, and 2 different sample codes found in this forum, and the problems persist in all 3 cases.

Guess I'll have to do without simulating the UART part of my code... :-(

Kind regards,
Morten Jensen

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oops, should read a little closer. Hopefully my comment didn't through you off.

Good luck,
j.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Actually I've never made the UART to work properly inside the simulator. Try port logging... in my case I get nothing, same for input :(

same goes for the AD (while I'd never expected a stream of data, it would have been nice to see the interrups work)

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Received this from Atmel today :

>There is a problem with the Software UART with respect to external stimuli files
>and interrupt generation. Please try to find an alternative way to debug this code.

Kind regards,

Morten