Atmel Studio 7, Atmega16, Simulator problem with UART interrupt

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

Hello everyone
I have a problem with simulation in Atmel Studio 7.
I'm trying to debug simple code written in assembler, where I simulate UART RXC interrupt.

When, in the I/O registers, I manually set the flag RCX and press "next step", the program doesn't jump to the interrupt routine, but it clears the interrupt flag.
I also tested the same code in AVR Studio 4.18 and everything works fine.

 

Could someone give me some suggestions about this problem?
Thanks

 

.include "m16def.inc"

.CSEG

.ORG 0x0000                ;(RESET)
RJMP Reset

.ORG 0x0016
RJMP RX_OK                 ;(USART,RXC) USART, Rx Complete

.ORG INT_VECTORS_SIZE      ;End of interrupt table

;----------------------------------------------------------------------
; Here we do something with interrupt
RX_OK:
    IN	R16, UDR
    RETI                   ; end of interrupt usng command RETI
;----------------------------------------------------------------------

Reset:
	LDI R16,Low(RAMEND)	; initialize stack
	OUT SPL,R16
	LDI R16,High(RAMEND)
	OUT SPH,R16

	SEI			; Allow interrupts globally
	LDI R16,(1<<RXCIE)	; Allow interrupt when received a byte by uart
	OUT	UCSRB, R16

M1:
	NOP
	NOP
	NOP
	RJMP M1

 

Attachment(s): 

This topic has a solution.
Last Edited: Sat. Mar 21, 2020 - 05:21 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Tools/Options/Tools/Mask interrupts on step

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

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

Thank you very much.

Your solution worked.