Trigger A, B & C Occured error message - DEMOQE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Trigger A, B & C Occured error message - DEMOQE

2,878 Views
Rodo55
Contributor I
Hello,
 
I'm using a DEMOQE board with a QE8 MCU, Running CW 6.1 .
I'm receiving an error message Trigger A, B & C occurred when I run an RTC ISR program. It occurs after 103 loops through what should be an endless loop. Just before that the error message says the Freq. Changed to 0Hz. I suspect a memory over run but I don't see in my code where that is happening. Does anyone have any suggestions as to what and maybe where to look?
 
I have not set any triggers in the debugger either.
 
I attached a file with the code in case someone can see where I went wrong.
 
The error message is at the bottom of the file.
 
Thanks,
 
Rodo
 
 
Added p/n to subject


Message Edited by NLFSJ on 2008-06-30 02:29 PM
Labels (1)
0 Kudos
Reply
8 Replies

865 Views
peg
Senior Contributor IV
Hello Rodo,

After a very quick look I can see two issues:

1: STATE_3 can fall through into the RTI ISR, probably not intended.

2: You are jumping out of an ISR without a RTI this will not de-stack the stuff stacked on interrupt entry.

Stack Overflow!


0 Kudos
Reply

865 Views
Rodo55
Contributor I
Hi Peg,
 
I am a beginner at this so I made a beginners mistake.
 
It never came out of the ISR because I didn't clear the RTC Interrupt flag. I cleared the flag and now it returns.
 
Thanks for your help.
 
Rodo
0 Kudos
Reply

865 Views
Rodo55
Contributor I
Thanks Again Peg and Mac.
 
A beginner mistake from a beginner.
 
I have a follow-up question about the BSET RTIF,RTCSC.
 
Since RTCSC is a high address ($1830) when I use that command I get the error:  A13003: Value is truncated to one byte.
 
I figured that was normal since it's a high address?
 
I used this instead so I don't get an error:
 
LDA RTCSC
ORA  #%10000000
STA RTCSC
 
It seems to work fine but I was wondering if the error I got is a real error or is there an option or definition I need to set?
0 Kudos
Reply

865 Views
peg
Senior Contributor IV
Hi Rodo,

Yes, this is what you need to do.
BSET only works within page zero (address 00 to FF)
I am not familiar with this device and the manual does not give you the address within the relevant section, so I lead you astray here, sorry.
At least you now have learnt something else.

0 Kudos
Reply

865 Views
Rodo55
Contributor I
Hi Peg,
 
No, you didn't lead me astray, you set me straight and got me running again. Thanks!
 
I asked the question because the smart people like yourself sometimes have tricks of the trade they know that can help beginners like me. I was thinking you may have known about an option or macro that would make that command work with higher addresses.
 
Thanks Again,
 
Rodo
0 Kudos
Reply

865 Views
Rodo55
Contributor I
Thanks Peg,
 
There's more code than what I included, so that's why it looks like it could fall through from State_3.
 
As far as the RTI, I originally wrote it that way but the program gets caught in a loop where it switches back and forth between the NOP and the RTI. It never returns from the ISR. When I stop the program and do an assembly step it's always stuck between the RTI and NOP. It didn't make any sense to me so I put the JMP there to get it to State_1.
 
Any thoughts as to why it wouldn't return with the RTI?
 
Rodo
0 Kudos
Reply

865 Views
bigmac
Specialist III
Hello Rodo,
 
Unless the interrupt flag for the RTC is cleared, the ISR will be continuously re-entered.
 
Regards,
Mac
 
0 Kudos
Reply

865 Views
peg
Senior Contributor IV
Hi Rodo,

That's because additionally you are not clearing the source of the interrupt.
Something like BSET    RTIF,RTCSC at the start of the ISR should do the trick.

0 Kudos
Reply