Shop OBEX P1 Docs P2 Docs Learn Events
Is it possible to read a WKEN_B register? — Parallax Forums

Is it possible to read a WKEN_B register?

Bill FrankeBill Franke Posts: 20
edited 2006-03-22 02:09 in General Discussion
To read the contents of the WKPND_B register, a “mov !rb, w” instruction is used to copy the contents of the pending reg. into W (reverse transfer). (I found that this is also how to “read” the read registers of the SX48/52 timers by the way.) Does anyone know if this works on the WKEN_B registers, also? How about a TRIS register?

Specifically, I want to be able to change only one bit of the WKEN_B register without affecting the other bits. If I can read it, I can AND mask it to change the specific bit that I want.

It’s too bad Parallax didn’t make it possible to do a “ setb !rb.6 ” instruction.

Comments

  • James NewtonJames Newton Posts: 329
    edited 2006-03-21 21:06
    You have to keep a "shadow" register which records the state of any changes made to the WKPND_B register. In each place where you change WKPND_B, first change the shadow register. Then when you want to change a bit, you do it in the shadow, and copy that to WKPND_B.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ---
    James Newton, Host of SXList.com
    james at sxlist,com 1-619-652-0593 fax:1-208-279-8767
    SX FAQ / Code / Tutorials / Documentation:
    http://www.sxlist.com Pick faster!



  • BeanBean Posts: 8,129
    edited 2006-03-21 21:28
    Bill,
    · On the SX48 the TRIS registers are readable and writeable. You can read the register, change one bit, and write it back.

    · But the WKPND_B is one of the rare registers that are write-only on the SX48.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module"·available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module"·available from Parallax for only·$49.95 http://www.parallax.com/detail.asp?product_id=30015
    Product web site: www.sxvm.com

    Coming soon... Cheap 4-digit LED display with driver IC·www.hc4led.com

    "Sometimes it is better to remain silent and be thought a fool, than to speak and remove all doubt."
    ·
  • Bill FrankeBill Franke Posts: 20
    edited 2006-03-22 02:09
    Thanks guys

    Bill F
Sign In or Register to comment.