this program works with PAUSE, but does not compile with DELAY_MS...why?
I'm experimenting with 2 versions of a program.·
One version has PAUSE 200 in main program.· The program works.
Then I commented that statement out and replaced it with DELAY_MS 200.· The program does not compile.
DELAY_MS works in a different program and works well (i.e. bug free).· (I'm borrowing it from JonnyMac).
So I don't understand why·replacing a PAUSE statement·with·a bug-free SUB would cause the program to not compile.
The two programs are attached.
Any insight would be appreciated.
One version has PAUSE 200 in main program.· The program works.
Then I commented that statement out and replaced it with DELAY_MS 200.· The program does not compile.
DELAY_MS works in a different program and works well (i.e. bug free).· (I'm borrowing it from JonnyMac).
So I don't understand why·replacing a PAUSE statement·with·a bug-free SUB would cause the program to not compile.
The two programs are attached.
Any insight would be appreciated.
Comments
When you say "won't compile" what happens? What error gets thrown?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
The error message is:· Unable to assemble due to errors in source code.
The differences between the 2 files is in Main program, not ISR.·
In·one version, I use PAUSE 200 for timing of main LED blinking on & off.
In the other version, I use DELAY_MS 200.
Thanks.
Have you tried to just COMPILE with out PROGRAMing the SX chip? This worked fine for me.
' Use: DELAY_MS duration
' -- replaces PAUSE
SUB DELAY_MS
\ SB __PARAMCNT.1
\ CLR __WPARAM12_MSB
PAUSE __WPARAM12
ENDSUB
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
When all else fails.....procrastinate!
Yes, I tried just Compile. It does not compile. It gives error message.
Shawn,
I used that DELAY_MS you listed above. It still does not compile.
Thanks for your suggestions.
Is my ISR too long?
You can do two things:
· 1) Just put "ADDRESS $400" AFTER the PROGRAM line.
· 2) Use a jump to get to your ISR code.
"INTERRUPT 1000"
"GOTO Mark_ISR"
then the SUB declarations
then the ISR code starting with the "Mark_ISR:" line.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"A government big enough to give you everything you want, is big enough to take away everything you·have."·· Thomas Jefferson
"It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter
www.iElectronicDesigns.com
·