Testing DIRA
I am trying a simple test with DIRA register in ASM but it seems to·fail.
I am trying to test PIN2 direction status, but I get always zero, despite it is changing in·a Spin routine from 1 to 0 periodically.
My code in the Spin routine does the following:
dira[noparse][[/noparse]2]~~ 'change PIN2 to OUTPUT
MyRoutine
dira[noparse][[/noparse]2]~·· 'change PIN2 to INPUT
etc,etc
this routine is called in a loop.
In a separate COG, there is an ASM code that performs the following tests:
MyCheck
······················· test mask, dira wz
······················· if_z jmp #MyCheck······ 'while pin2 is not an·INPUT·it waits
mask LONG %100
I get always zero,·so the loop continues forever.
Any explanation for this ? Am I·missing anything obvious ? :-(
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I am trying to test PIN2 direction status, but I get always zero, despite it is changing in·a Spin routine from 1 to 0 periodically.
My code in the Spin routine does the following:
dira[noparse][[/noparse]2]~~ 'change PIN2 to OUTPUT
MyRoutine
dira[noparse][[/noparse]2]~·· 'change PIN2 to INPUT
etc,etc
this routine is called in a loop.
In a separate COG, there is an ASM code that performs the following tests:
MyCheck
······················· test mask, dira wz
······················· if_z jmp #MyCheck······ 'while pin2 is not an·INPUT·it waits
mask LONG %100
I get always zero,·so the loop continues forever.
Any explanation for this ? Am I·missing anything obvious ? :-(
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Comments