Shop OBEX P1 Docs P2 Docs Learn Events
Duplicate mode registers — Parallax Forums

Duplicate mode registers

Bill FrankeBill Franke Posts: 20
edited 2009-07-07 17:42 in General Discussion
On page 173 of the "SX-Key/Blitz Development System Manual 2.0" it shows duplicate CMP_B, WKPND_B, WKED_B, and WKEN_B registers. They seem to share $08,$18; $09,$19; $0A,$1A; $0B,$1B addresses respectively.

I have some hand written notes (written several years ago) that say they are not the same registers and can't be interchanged. So which ones do I use? The book seems to use the lower addresses for the interrupts in it's examples, but then what are the higher ones for? Is this a typo? Would appreciate any help here.

Comments

  • BeanBean Posts: 8,129
    edited 2009-07-06 21:58
    They are not duplicates. On the SX48, the lower values are used to READ the register, the higher values are used to WRITE to the register.
    On the SX28, only the lower values are available, and they WRITE to the registers. Kinda weird, but that's how it works.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    The needy are many, the deserving are few.

    ·
  • Bill FrankeBill Franke Posts: 20
    edited 2009-07-07 00:12
    Then it must be a typo since the lower values say "write" or "exchange" just like the higher values do.
    Gunther must have cut and pasted because he has the exact same thing on page 220 of his book.
    Thanks Bean.

    Bill
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2009-07-07 17:42
    Bill,

    hmm...

    For "Exchange CMP_B with W" and "Exchange WKPND_B with W" you may set M to either $08, or $18 resp. $09, or $19 because such registers are exchanged, i.e. they are read and written within just one clock cycle, moving the current content of W into the selected !RB, returning with the former content of the !RB register in W.

    For M settings $0A, $0B, $1A, and $1B, I must admit that I simply took the information found in the SX48 datasheet, and replicated it in the table on page 220 of my book without really testing that. Let me check this on a real SX48, and I'll let you know the results later.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
Sign In or Register to comment.