Hi!
I don't know much about RR-Net programming, but I just tried out a bit.
And I found out that the right way to get data form RR-Net is like this (taken from Baccy's led flasher program):
Code:
;--------------------------------------
; look for crystal magic and version number
; the product id is located at packet page 0 - 3 and contains
; $0e $63 $00 VV
; where VV is the revision code of the chip
; Rev B : $05
; Rev C : $06
; Rev D : $07
; (i have no idea what happened to Rev A)
cs_detect:
lda #0 ;check for the first 2 magic bytes
jsr cs_readPage
cpx #<$630e
bne notfound
cpy #>$630e
bne notfound
lda #1 ;check for the second magic bytes
jsr cs_readPage
cpx #0
bne notfound
tya ;they also contain the version nr of the chip
ldx #2
detectVersion:
cmp revcode,x
beq found
dex
bpl detectVersion
notfound:
sec
rts
found:
clc
rts
revcode:
.DB $07,$08,$09
;--------------------------------------
; read the packet page register (a*2) to x(lo) and y(hi)
cs_readPage:
asl
sta CS_PacketPage
lda #0
rol
sta CS_PacketPage+1
ldx CS_PacketData0
ldy CS_PacketData0+1
rts
;--------------------------------------
You dont't need to access CS_PacketData1 because it obviously contains the same data like CS_PacketData0 after writing something to CS_PacketPage.
Instead you have to access the two registers $0000 and $0002 (adressed in 16 bit (low/high) via CS_PacketPage) in a row to suck the two 16-bit-values out of CS_PacketData0 which determine the revision number.
In SLANG it should look like this:
Code:
poke CS_PacketPage_a,0
Poke CS_PacketPage_b,0
Println CS_PacketData0_a
Println CS_PacketData0_b
poke CS_PacketPage_a,2
Poke CS_PacketPage_b,0
Println CS_PacketData0_a
Println CS_PacketData0_b
I tried this thing out myself with ACME and got $0e 63 00 09, exactly the value for revision D.
CU
Kratznagel