sleep walking in SXSim
hi Sxers
I have written a very simple program 'sleeper' shown below to investigate the SLEEP mode for the SX28 and simulated it with the SXSim.
When I RUN this program, SXSim stops at the SLEEP instruction but wont reset with MIWU input on port rb.
If I WALK or STEP this program, SXSim ignores the SLEEP instruction but jumps to the interrupt routine with MIWU input on port rb.
Is the SXSim working as the SX28 would be during sleep and wake up ?
Are SX program examples or application notes on using the SLEEP command available on this web site?
Regards
electronic
ID 'sleeper'
device SX28L,turbo,bor42
device protect, optionx
reset wake_up
interrupt mov M, #$09 ; set MODE register pending
mov !rb, #0 ; clear pending register move to w
reti
wake_up mov M, #$09 ; set MODE register pending
mov !rb, #0 ; clear pending register move to w
mov M, #$0B ; set MODE register enable WKEN_B
mov !rb, #0 ; enable interrupts on rb port
sleep
nop
run inc 15
jmp run
Post Edited (electronic) : 1/10/2007 12:01:38 PM GMT
I have written a very simple program 'sleeper' shown below to investigate the SLEEP mode for the SX28 and simulated it with the SXSim.
When I RUN this program, SXSim stops at the SLEEP instruction but wont reset with MIWU input on port rb.
If I WALK or STEP this program, SXSim ignores the SLEEP instruction but jumps to the interrupt routine with MIWU input on port rb.
Is the SXSim working as the SX28 would be during sleep and wake up ?
Are SX program examples or application notes on using the SLEEP command available on this web site?
Regards
electronic
ID 'sleeper'
device SX28L,turbo,bor42
device protect, optionx
reset wake_up
interrupt mov M, #$09 ; set MODE register pending
mov !rb, #0 ; clear pending register move to w
reti
wake_up mov M, #$09 ; set MODE register pending
mov !rb, #0 ; clear pending register move to w
mov M, #$0B ; set MODE register enable WKEN_B
mov !rb, #0 ; enable interrupts on rb port
sleep
nop
run inc 15
jmp run
Post Edited (electronic) : 1/10/2007 12:01:38 PM GMT
Comments
sorry, for now SXSim does not correctly simulate the SX wake up feature. I have put it on the TODO list, so let me see if I can implement this in the next version.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
That explains it, can I also assume that SXSim only sleeps in the RUN mode ?
I will test my SX28 sleeping routines using hardware.
SXSim is a very usefull program, any exhancements would be a bonus.
Best Regards
electronic
The current version of SXSim does not actually "sleep" in RUN mode - it simply terminates the Run mode - IOW, you can't wake it up via MIWU pins for now. I think this should be possible though without too much coding.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
Terminating the SXSim RUN mode on an SX SLEEP instruction is sufficient for most debuging purposes but full MIWU functionality would be really cool !
Best Regards
electronic
Could give us an estimate as to when a new version might be available?
Thanks,
Alex.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fear not that your project does not work, for it will,
Fear not if you see·a long dark path ahead, but follow it,
Fear not if what worked now refuses to,
For the only thing that's perfect is imperfection.
please understand that I have developed SXSim as Freeware. So I can only work on new versions when I have enough spare time between my regular business. Right now, I'm pretty "overloaded" with "income-generating" work, so it is hard for me to give an estimate when the next version of SXSim will be released. I can only ask you to be patient, and to stay tuned.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G