Shop OBEX P1 Docs P2 Docs Learn Events
Will this do what I think — Parallax Forums

Will this do what I think

Mike WMike W Posts: 105
edited 2005-05-06 12:33 in General Discussion
I would like to start out today by saying· ”YOU GUYS ARE GREAT” you really sound like a learned and experienced group. I really appreciate having a place to ask questions and get good answers usually with in hours if not minutes.
Thank You Everyone !!!!
·*********************************************************
If I include this code in an SX/B program as I think I understand it, this would turn on the pull up resistors for RA.2 and RA.4. Am I correct?

Start:
· PLP_A = %1010

I have downloaded all the SX/B documentation I could find, and I have the books that came with the kit, but seem to have a hard time understanding all of it.
Are there any books out there that are solely writer for Pbasic, or even just basic? Say something easier to learn from with more extensive explanations and examples.

Thanks again

Mike W

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-05-05 22:32
    Mike,

    A zero in that register activates a pull-up, so PLP_A = %1010 actually activates the pull-ups on RA.0 and RA.2.

    A lot of SX/B names match those in the SX so the documentation from Ubicom will always be useful.· And don't forget to checkout the books from our pals Guenter and Al (references are in the help file).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • pjvpjv Posts: 1,903
    edited 2005-05-05 23:18
    Mike;

    You might want to check, because I don't know if SX/B requires you to manually deal with the mode register or not.

    If you must, then prior to setting PLP_A, mode M must be $0E for the SX28, and must be $1E for the SX48/52.

    Perhaps the compiler already does this for you. However, it's still good to know in case you tackle the assembler.

    Have fun,

    Peter (pjv)
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-05-05 23:38
    When SX/B compiles that line the M register is dealt with -- here's the output:

    Start:·························· ;Start:
    · MODE $0E······················ ;· PLP_A = %1010
    · MOV !RA,#%1010···············

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • pjvpjv Posts: 1,903
    edited 2005-05-06 04:09
    Thanks Jon;

    I wasn't sure; guess I could have checked, but it is good in anycase to have folks aware of the different mode requirements for theSX28 vs SX48/52.

    Thanks for clearing that up.

    Peter (pjv)
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-05-06 12:33
    SX/B 1.2x is SX48/52 aware now, so it deal with those micros appropriately as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
Sign In or Register to comment.