PLease, make it start. ** Problem solved **
Pliers
Posts: 280
First let me say I enjoy reading this forum. You guys are great.
I really do try to figure this stuff out on my own.
On to my situation… I have a PPD board.
I’m using a scope, so I can watch my input and output pins.
If I comment out the waitpeq, I can see P0 pulse high.
Where did I go wrong?
Post Edited (Pliers) : 12/1/2008 2:33:37 PM GMT
I really do try to figure this stuff out on my own.
On to my situation… I have a PPD board.
I’m using a scope, so I can watch my input and output pins.
If I comment out the waitpeq, I can see P0 pulse high.
Where did I go wrong?
PUB IOTEST cognew(@IO_TEST, 0) DAT ORG 0 IO_TEST MOV DIRA, #%0001 'Set PO as output waitpeq %0000, %0100 ' wait for P2 to go low MOV Outa, #1 ' Pulse P0 high MOV Outa, #0 cogid temp cogstop temp temp long 0
Post Edited (Pliers) : 12/1/2008 2:33:37 PM GMT
Comments
You have the target state in register 0, and the mask in register %0100 ??
Pulses from code that executes once ?? Try putting a JMP at the end to make the code loop back.
WAITPEQ data, mask
data LONG %000
mask LONG %100
Post Edited (Pliers) : 12/1/2008 2:41:37 PM GMT
Why does this not work
"waitpeq %000, %100"
But this does?
WAITPEQ data, mask
data LONG %000
mask LONG %100
1) instr destreg, srcreg
2) instr destreg,#value
You can't write a literal value as first parameter (destreg), only as second parameter (srcreg), and this value can only be in the range 0..511. These is a result of the way, the bitfields in the 32 bit instruction are allocated.
For WAITPEQ you can use an immediate value as mask for the first 9 pins but not more, in all other cases you need registers (which have the full 32 bits).
But mostly you can use the same register for data and mask:
WAITPEQ pinmask,pinmask 'wait for pin(s) high
WAITPNE pinmask,pinmask 'wait for pin(s) low
Andy
Pliers, basically you need the "#" in front of the %100. As Ariba pointed out you can only do that for values up to 511 (9 bits).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
www.tdswieter.com