simulator

mtullock

New Member
Hi,
I have an 18M2 on order. However, I am confused about the simulator I am using all B pins as well as c.6, c.7, c.0, c.1 and c.3 as outpout and c.2, c.4 and c.5 as input. So far my code all simulates fine. However, when I try to use C.4 as an interrupt I cannot as the simulator forces it as an an analogue input. I have the line:

let adcsetup = %0000000000000000

present but the simulator insists on the yellow slider. Can I change this in the simulator?

cheers
Magnus
 

hippy

Technical Support
Staff member
Welcome to the PICAXE Forum.

C.4 is Serial In on the 18M2. To enable it to be used as an interrupt trigger you need to issue a DISCONNECT command at the start of your program -

Code:
#Picaxe 18M2

PoweronReset:
  Disconnect
  Gosub Interrupt_Enable
  Do : Loop

Interrupt:
  Toggle B.0
  Do : Loop Until pinC.4 = 0

Interrupt_Enable:
  SetInt %00010000, %00010000, C
  Return
 

mtullock

New Member
thats awesome cheers!!!

cheers
Magnus

Welcome to the PICAXE Forum.

C.4 is Serial In on the 18M2. To enable it to be used as an interrupt trigger you need to issue a DISCONNECT command at the start of your program -

Code:
#Picaxe 18M2

PoweronReset:
  Disconnect
  Gosub Interrupt_Enable
  Do : Loop

Interrupt:
  Toggle B.0
  Do : Loop Until pinC.4 = 0

Interrupt_Enable:
  SetInt %00010000, %00010000, C
  Return
 

mtullock

New Member
...also I cant seem to get a setint OR to work on the simulator, is this a bug? my code is as below and both wor individually but together the original setint does not work.

setint %0000000,%0100000, C
setint or %0010000,%0010000, C

any thoughts?

cheers
 
Top