Editor/Simulator can't count?
Editor/Simulator can't count?
Since I'm new here I took the time to put some info in my profile. Have a look to have a bit of an idea who your talking to
Here is the problem. I've tried various methods of shifting out data but, whatever I do, when I reach count %00000011 it always comes out as %00000101. Here is the code I'm using.
The interrupt routine is for upping the counter. The counter can be preset to a start value just before countout: starts. Here you can already set it to 03, so you instantly can see what I mean.
What is happening here
I am using the editor version 5.2.7
Fred
Editor/Simulator can't count?
Since I'm new here I took the time to put some info in my profile. Have a look to have a bit of an idea who your talking to
Here is the problem. I've tried various methods of shifting out data but, whatever I do, when I reach count %00000011 it always comes out as %00000101. Here is the code I'm using.
Code:
init: OUTPUT 0,2,4
INPUT 1,3
'Assign labels to in- and outputs
Symbol DAT = 0
Symbol CLCK = PIN2
Symbol EN = PIN4
Symbol PSSIN = PIN1
Symbol SRSIN = PIN3
'Assign names to registers
Symbol SHFTREG = b0
Symbol STEPS = b1
Symbol DATREG1 = b2
Symbol DATREG2 = b3
'Set here start value for data to be send
DATREG1 = $00
countout: 'Shift data out
let SHFTREG = DATREG1
STEPS = $FF
Do
OUTPIN0 = bit0
pulsout 2,100
w0 = w0/2
Loop Until STEPS = 0
pulsout 4,100
'Enable interrupt
SETINT %0010,%0010
goto countout
interrupt: 'First wait for button to be released
IF PSSIN = 1 THEN interrupt
let DATREG1 = DATREG1 + 1
return
What is happening here
I am using the editor version 5.2.7
Fred
Last edited: