I’m using a 28X2 and trying to read and write the scratchpad memory. However, when I do it appears that I can only either write or read the upper 256 bytes from address 768 to 1023. I’ve reduced the problem to a short piece of test code (see below) that “puts” a 0 in the first 256 bytes, a 1 in the next 256 bytes, a 2 in the third 256 bytes and a 3 in the last 256 bytes. When I go to read back what I’ve written the debug window only shows what I’ve written in the last 256 bytes (3). I can see the address register (w1) cycle through 0 – 1023, but the byte b0 never changes from the value of 3.
This code works in the simulator but not on the 28X2 itself. Could it be a compiler problem.
Any help will be appreciated.
Thanks,
John Gavlik
LearnOnLine, Inc.
www.learnonline.com
#picaxe 28X2 'don't change this!!!
Test:
for w1 = 0 to 255
b0 = 0
put w1,b0
next
for w1 = 256 to 511
b0 = 1
put w1,b0
next
for w1 = 512 to 767
b0 = 2
put w1,b0
next
for w1 = 768 to 1023
b0 = 3
put w1,b0
next
for w1 = 0 to 1023
get w1,b0
debug
next
goto test
This code works in the simulator but not on the 28X2 itself. Could it be a compiler problem.
Any help will be appreciated.
Thanks,
John Gavlik
LearnOnLine, Inc.
www.learnonline.com
#picaxe 28X2 'don't change this!!!
Test:
for w1 = 0 to 255
b0 = 0
put w1,b0
next
for w1 = 256 to 511
b0 = 1
put w1,b0
next
for w1 = 512 to 767
b0 = 2
put w1,b0
next
for w1 = 768 to 1023
b0 = 3
put w1,b0
next
for w1 = 0 to 1023
get w1,b0
debug
next
goto test