64Mb to 2Gb of memory. Very simple interface. The program below demonstrates writing one byte to a location in ram and then reading it back. Schematic attached. Works at baud rates of 300 to hundreds of k, but tested at 2400 because this is simple for an 08M.
Traps - watch that you don't bump the top of the memory module otherwise the ram chip can half pop out and then it doesn't work.
Code:
high 1 ' must start with a high
pause 1000 ' wait for module to boot (300-400ms)
serout 1,T2400,("U") ' sets baud rate to whatever send U at
serin 2,T2400,b13 ' read back ack or nak
w1=123 ' set up address msb to lsb = b3,b2,b1,b0 w1*65536+w0 0-64Mb or up to 2Gb
w0=3124
serout 1,T2400,("@A",b3,b2,b1,b0) ' set address to write to/read from
serin 2,T2400,b13 ' read back ack or nak
b4=37 ' test byte to write
serout 1,T2400,("@w",b4) ' write a byte - this increments counter
serin 2,T2400,b13 ' read back ack or nak
serout 1,T2400,("@A",b3,b2,b1,b0) ' resend the address counter
serin 2,T2400,b13 ' read back ack or nak
serout 1,T2400,("@r") ' read a byte
serin 2,T2400,b13 ' get the byte to read back
debug ' display it
Traps - watch that you don't bump the top of the memory module otherwise the ram chip can half pop out and then it doesn't work.
Code:
high 1 ' must start with a high
pause 1000 ' wait for module to boot (300-400ms)
serout 1,T2400,("U") ' sets baud rate to whatever send U at
serin 2,T2400,b13 ' read back ack or nak
w1=123 ' set up address msb to lsb = b3,b2,b1,b0 w1*65536+w0 0-64Mb or up to 2Gb
w0=3124
serout 1,T2400,("@A",b3,b2,b1,b0) ' set address to write to/read from
serin 2,T2400,b13 ' read back ack or nak
b4=37 ' test byte to write
serout 1,T2400,("@w",b4) ' write a byte - this increments counter
serin 2,T2400,b13 ' read back ack or nak
serout 1,T2400,("@A",b3,b2,b1,b0) ' resend the address counter
serin 2,T2400,b13 ' read back ack or nak
serout 1,T2400,("@r") ' read a byte
serin 2,T2400,b13 ' get the byte to read back
debug ' display it
Attachments
-
93.5 KB Views: 869