I could be completely wrong here but it looks like it uses 5 bit addresses for the config registers.
Looking through the MRF89XA Datasheet further in section 2.11.1 (SPI CONFIG), figures 2-12 (Write Register Sequence) and 2-13 (Read Register Sequence) on page 24, it looks like the address bytes only use 5 bits for the address and 2 bits for a preamble and 1 bit for a postamble for a total of 8 bits.
The Preamble bits look to be the following:
Bit 1: is a start bit and it is a 0
bit 2: is a R/W bit. 0=Write, 1=Read
The Postamble Stop Bit is a 0
So, if I interpret the timing diagrams correctly if you are trying to Write to register 0x00 your address byte will be 0x00. But, to read Register 0x00 your address byte will be 0x40 (%01000000) noting that the DS states all data is received and sent MSB first.
Bit 7: Start bit = 0
Bit 6: R/W bit = 1
Bit 5: Address bit 4 = 0
Bit 4: Address bit 3 = 0
Bit 3: Address bit 2 = 0
Bit 2: Address bit 1 = 0
Bit 1: Address bit 0 = 0
Bit 0: Stop bit = 0
Carrying on further, if you want to Write to and Read from register 0x09, I think these are the address byte values to use.
Register 0x09
Write: 0x12 (%00010010)
Bit 7: Start bit = 0
Bit 6: R/W bit = 0
Bit 5: Address bit 4 = 0
Bit 4: Address bit 3 = 1
Bit 3: Address bit 2 = 0
Bit 2: Address bit 1 = 0
Bit 1: Address bit 0 = 1
Bit 0: Stop bit = 0
Read:0x52 (%01010010)
Bit 7: Start bit = 0
Bit 6: R/W bit = 1
Bit 5: Address bit 4 = 0
Bit 4: Address bit 3 = 1
Bit 3: Address bit 2 = 0
Bit 2: Address bit 1 = 0
Bit 1: Address bit 0 = 1
Bit 0: Stop bit = 0
If these assumptions are correct you can just AND your address with with the appropriate mask for the preamble and postamble bits for Write or Read.
Hope I am not taking you down a rabbit hole....




Bookmarks