Vbriel
03-19-2012, 05:11 PM
I'm trying to work with I/O ports in assembly and I've run into a problem.
I can set single pins with 'or outa, myregister' no problems, but I need to change the direction of P8-P15 to output, place a byte on those pins, then after a delay turn the direction back to input only on P8-15
What I tried to do was:
mov dira, dbusout 'make P8-P15 output
or outa, #$55
nop
mov dira, dbusin 'change pins back to input
dbusout long $FF<<8
dbusin long $00<<8
I'm totally missing something. Also, I've read a few of the "beginning asm for the propeller tutorials" but I'm looking for something that can explain controlling the ports a little better. I've been using the ATmega chips and defined 8 bit ports. I just need a little nudge in the right direction on this.
Vince
I can set single pins with 'or outa, myregister' no problems, but I need to change the direction of P8-P15 to output, place a byte on those pins, then after a delay turn the direction back to input only on P8-15
What I tried to do was:
mov dira, dbusout 'make P8-P15 output
or outa, #$55
nop
mov dira, dbusin 'change pins back to input
dbusout long $FF<<8
dbusin long $00<<8
I'm totally missing something. Also, I've read a few of the "beginning asm for the propeller tutorials" but I'm looking for something that can explain controlling the ports a little better. I've been using the ATmega chips and defined 8 bit ports. I just need a little nudge in the right direction on this.
Vince