need help with PASM
TimH
Posts: 48
This is my first attempt at PASM with the propeller. I've studied various examples in this forum but have hit a wall.
I want to monitor a pin (15) for a pulse - (high). When detected I want to output another pulse after a delay on pin 16.
The output section works fine if I comment the 3 lines after :loop.
I'm sure its a simple error but I cannot see it.
I want to monitor a pin (15) for a pulse - (high). When detected I want to output another pulse after a delay on pin 16.
The output section works fine if I comment the 3 lines after :loop.
I'm sure its a simple error but I cannot see it.
Comments
Try this:
You could also use this to the same effect:
Another variation:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propeller Tools
- Propalyzer: Propeller PC Logic Analyzer
- BMA: An on-chip PASM Debugger
- SPUD: Spin Source Level Debugger
Post Edited (jazzed) : 9/3/2009 3:30:00 AM GMTThe first change did not work but the 2nd did.
I need to go back to the manual and try to figure out why.
alternative I added last takes 100ns, waitpeq detects smaller pulses .... How much smaller? Don't remember.
Glad you have something working.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propeller Tools
In your original code change...
...so that it reads...
... and that will solve your error.
The way it is, pinmask_key is assigned to the read_port value and gets overwritten when you change read_port which corrupts the pinmask_key value.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 9/3/2009 4:29:09 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propeller Tools
Thanks for your help - there's certainly plenty of scope for errors with PASM. I'm sure once you've spend a few hours tracking a problem its not easily forgotten though.
Tim