Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Assebmly I/O — Parallax Forums

Propeller Assebmly I/O

christopherchristopher Posts: 31
edited 2006-06-02 13:06 in Propeller 1
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

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,547
    edited 2006-06-02 01:09
    christopher,

    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.
  • Jim CJim C Posts: 76
    edited 2006-06-02 01:42
    Christopher,

    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
  • christopherchristopher Posts: 31
    edited 2006-06-02 13:01
    many thanks



    Chris
  • christopherchristopher Posts: 31
    edited 2006-06-02 13:06
    Good suggestion, Jim C

    Thanks

    Chris
Sign In or Register to comment.