Shop OBEX P1 Docs P2 Docs Learn Events
Accessing the pins — Parallax Forums

Accessing the pins

christopherchristopher Posts: 31
edited 2006-05-29 17:25 in Propeller 1
Using Spin with dira and outa I have been able to configure and set as output and toggle all of ·the propeller·pins. However when I switch to another cog and use assembly I can only toggle p0-p7 and p8 using

mov dira,#$ffffffff··· ; to set all pins as output
mov outa,#$ffffffff·· ;to set all pins high

But this code only set p0-p7 and p8 high.·Where am I going wrong?


Thank You

Christopher·

Comments

  • CJCJ Posts: 470
    edited 2006-05-29 14:54
    the problem is that the literal source value is limited to 9 bits, to toggle all the pins you would have to use another register to store the value and point to it with the source instruction as attached

    edit: noticed an error in my syntax fixed and added a loop that toggles the pins once a second

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Who says you have to have knowledge to use it?

    I've killed a fly with my bare mind.

    Post Edited (CJ) : 5/29/2006 5:02:59 PM GMT
  • christopherchristopher Posts: 31
    edited 2006-05-29 15:08
    Many thanks for the quick response, Great!
    lol.gif

    Chris
  • CJCJ Posts: 470
    edited 2006-05-29 17:04
    fixed an error in my previosly posted code

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Who says you have to have knowledge to use it?

    I've killed a fly with my bare mind.
  • SSteveSSteve Posts: 808
    edited 2006-05-29 17:25
    Chris: You aren't the only person to run into that problem. It stumped me for a while, too. Chip has said he will look into changing the Propeller Tool so that it will catch that and give an error message.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows
Sign In or Register to comment.