Problem with SETINT and the Simulator

Aresby

New Member
Hi!

I'm new to the PICAXE world and have just completed my first 08M project - but I discovered what I can only think is an anomaly with the simulator whilst doing it.

If anyone can tell me whether the following is the expected behaviour?

I have a setint 000000, 001000 instruction that simply looks for a low value on C.3 at which point the interupt routine resets things.

During simulation, even though the pin is clicked (and goes yellow) and the pinsC clearly shows 001000 (decimal 8) on the simulation panel the interupt routine is followed. This happens everytime. My interpretation is that the interupt should only be triggered when the c.3 value is zero not 1.

During actual program execution (on the chip) this does not happen (I'd know because a beeper goes off when the interupt routine runs) and everything works "as expected".

So, as it works in real life but not on the simulator does anyone know whether this is a known issue or is there something I ought to do?

Best Regards
Ralph Bacon
 
Last edited:

hippy

Ex-Staff (retired)
Welcome to the PICAXE Forum.

It seems to work as it should for me, so perhaps post your code then others can test it.

Your "setint 000000, 001000" should be "setint %000000, %001000" but by incredible coincidence the bottom 5 bits of decimal 1000 are %01000 !

Code:
#Picaxe 08M

Main:
  Gosub InterruptEnable
  Do
    Low 2
  Loop

Interrupt:
  High 2

InterruptEnable:
  SetInt %000000, %001000
  Return
 

Aresby

New Member
Sample program to show what I'm experiencing

Thanks for the quick reply - but I don't get the result you seem to be reporting.

I've attached a sample test program that highlights exactly my observed behaviour - the SETINT command immediately causes the INTERRUPT routine to be invoked immediately even though it's only supposed to be looking at LOW values.

If you run the attached program in Simulation Mode following the instructions contained within it I'll be fascinated to see what happens on your PC!

There must be something I'm not aware of, or doing wrong. Any pointers gratefully received!

(Yes, this message editor stripped off the leading percent sign and some zeroes from my previous post but the important bits were still visible and logical!)
 

Attachments

hippy

Ex-Staff (retired)
If you run the attached program in Simulation Mode following the instructions contained within it I'll be fascinated to see what happens on your PC!
All worked as expected for me. Pin C.3 input set high executes the SETINT and enables interrupts, then Pin C.3 taken low activates the interrupt. Some 4 minutes later, if Pin C.5 is again taken high, the program then encounters the END and simulation terminates.

Check you've got the latest Programming Editor version 5.4.3 installed.
 

Aresby

New Member
Check you've got the latest Programming Editor version 5.4.3 installed.
The simplest of things... My version was 5.4.0 and whilst the update history for 5.4.3 (and all the revisions in-between) don't specifically mention this problem it has most definitely been resolved!

So thanks for confirming that my understanding was correct, my version of the simulator was buggy and for pointing me to a new version (I shall have to check more frequently, I'm too used to programs 'pushing' their updates at me automatically).

Excellent! My first project a success and now my first cry for help well and truly sorted. Thank you. Appreciated.
 
Top