Propeller Assebmly I/O
christopher
Posts: 31
mov dira,#255
:here mov outa,#0
mov outa,#255
jmp :here
The above code works with a nice pulse on pins
This code belowdoes not work ...no pulse on pins
mov dira,#255
:here mov outa,#255
mov outa,#0
jmp :here
Can anyone suggest why?
Thanks
Chris
:here mov outa,#0
mov outa,#255
jmp :here
The above code works with a nice pulse on pins
This code belowdoes not work ...no pulse on pins
mov dira,#255
:here mov outa,#255
mov outa,#0
jmp :here
Can anyone suggest why?
Thanks
Chris
Comments
In both cases, the line that reads...
jmp :here
...should read...
jmp #:here
...See the tricks and traps documentation about this.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I tried out your problem. Here is what I did, which is similar, but with a couple changes:
Way 1:
_Start mov dira,PortBits
:here mov outa,#0
mov outa,_Pin
jmp #:here
Way 2:
_Start mov dira,PortBits
:here mov outa,_Pin
mov outa,#0
jmp #:here
PortBits long %11111111_11111111_11111111_11111111
_Pin long 65536 ' Same as %00000000_00000001_00000000_00000000
I set it up to flash pin 16, as I have a demo board and the LED row starts at pin 16. Also, I'm finding it's alot easier to figure out what's happening, and it works more predictably, if constants are used.
Out of interest, I also tried to get it to work without the # in the 'jmp #:here' line. It actually lit pin 16 with Way 1 (without the #), but I think that's an artifact, rather than a correct way: with Way 2 (without the #), pin 16 comes on, but it's REALLY dim.
Jim C
Chris
Thanks
Chris