PULSIN about PropBASIC
caskaz
Posts: 957
Hi, everyone.
TASK alarm's LED is blinking, but main's LED is not on .
Sometimes P18 is on soon. but,Sometime after 2-5minutes.
Why does it ocurr?
TASK alarm's LED is blinking, but main's LED is not on .
Sometimes P18 is on soon. but,Sometime after 2-5minutes.
Why does it ocurr?
DEVICE P8X32A,XTAL1,PLL16X XIN 5_000_000 P0 PIN 0 INPUT P18 PIN 18 LOW alarm TASK time_count VAR Long Start: cogstart alarm Main: DO PULSIN P0,0,time_count P18 = 1 LOOP GOTO Main END TASK alarm LED17 PIN 17 LOW s PIN 0 INPUT DO IF s = 0 THEN LED17 = 1 ELSE LED17 = 0 ENDIF LOOP ENDTASK
Comments
I don't see anything wrong with it, so I'm not sure why it's not working.
When I get a chance, I'll wire it up and see if it works for me.
P.S. In the alarm task, you can just use "LED17 = ~s" instead of the IF..THEN...ELSE...ENDIF lines.
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
·
Nothing of Program line is my copy-miss.
Reason P18 is not on is "Program Start LMM".
P18 is on, when "Program Start".
".
Actually "PULSIN" don't also work under program exceeding 492Longs.
I combined to pbasic files.
When I compile "ONKYO.pbas", error occur "PropClock.spin - Error at (1,5) Symbol Init is already defined".
How does error solve?
I'll add "INIT" to the invalid variable name file.
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There are two rules in life:
· 1) Never divulge all information
Post Edited (Bean) : 3/31/2010 1:42:05 AM GMT
Error has gone.
And, cannot calculation substract constant from variable?
For example, it omit declare etc below.
Result is c = 800123456 e=1000.
Why is this?
Post Edited (caskaz) : 3/31/2010 11:17:11 AM GMT
Hmmmm, That is a bug. I will fix that in the next release.
Thank you for finding it and letting me know about it.
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There are two rules in life:
· 1) Never divulge all information
I finished to translate from spin to pbas for your help.
Code size is 1866Longs, and it's bigger than spin(about 1100Longs).
I think PropBASIC is not needed, because this program don't need speed.
But,this is good object for PropBASIC's lerning for me.
Maybe you make more simple code.
My request to next version:
1.multiline comment like spin's {{...}}
2.case instruction
3.lookkup instruction
How does about PULSIN and LMM?
Thanks!
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There are two rules in life:
· 1) Never divulge all information
Next release about PULSIN and LMM?
The code looks right, so it took me awhile to figure out that the loop is just too tight for LMM (it takes too long to get back to the WAITCNT instruction which makes it hang up).
I'll fix that in the next release. I will make the granularity 2uSec. So the value will STILL be in 1uSec units, but the value always be even.
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There are two rules in life:
· 1) Never divulge all information
This version fixes the PULSIN problem when using LMM.
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There are two rules in life:
· 1) Never divulge all information