REAL TIME monitoring

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

I currently using AT90S8515 micro with STK200. How can I
test an interrupt program in simulator program without using a
real hardware?
Besides that, how can I view the timer/counter
value in the simulator software when running.
During the program running in the real hardware,
how can I watch the register value or data in selection address eg. R16,R17 etc. in the micro?
Why the register in R0 until R15 cannot be access? I try to store a number inside these register
but fail. Thanks.

admin's test signature
 

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

Hi Alan,

When you're running a program in a real device, you must have overhead code in order to being able to see the values of your various registers. A typical example with the starter kits, is dumping the register contents to the port connected to the LEDs. Remember that a lighted LED indicates logical '0'.

In the AVR Studio simulator (which I assume you're referring to) there are several limitations regarding real-time operation, as you've probably noticed. If you want a step-by-step visualization of your code bein run, the "Multi-step" option is usually best. To check when your interrupts are triggered, one normally inserts a break point at the beginning of the Interrupt Service Routine (ISR). The timer/counter values are transparent in the simulator by means of the I/O view, as are the registers with the register view etc.

Some registers aren't immediately accessible for all operations. There are design considerations to account for this. The complete AVR instruction set is available here, and contains a specification as to which registers may be used. An example is the ldi instruction:

Operation: Rd

As you can see, only registers r16-r31 are available for this instructions. Please note that there may be individual differences for each device. If this is the case, these differences are specified in the "Instrucion Set Summary" at the end of each datasheet.

Best regards,

Morten, AVR tech. support, Atmel FAE

admin's test signature
 

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

As for the first question, to test an interrupt without the hardware just make a slight modification to the handler and treat it like a function/subroutine call.

admin's test signature