25LC640?

picaxester

Senior Member
Has anyone used an 25LC640 EEPROM?
http://www.hvwtech.com/products_view.asp?CatID=99&SubCatID=222&SubSubCatID=0&ProductID=457
And here is a PDF data sheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/21223G.pdf


eric
 

picaxester

Senior Member
I wrote this a while ago but never bought the chip, so I don't know if it works. It's a data logger that uses an 08M and a 25LC640:


high 4

gosub wren

main:
for w6 = 0 to 8191
readadc 2, b0
gosub writespi
pause 1000
next w6

for w6 = 0 to 8191
gosub readspi
sertxd (b0)
next w6

goto main

wren:
low 1
low 4
let b0 = 6 'WREN
gosub shftout
high 4
return

readspi:
low 1
low 4
let b0 = 3 'READ
gosub shftout
let b0 = b13
gosub shftout
let b0 = b12
gosub shftout
gosub shftin
high 4
return

writespi:
low 1
low 4
poke $50,b0
let b0 = 2 'WRITE
gosub shftout
let b0 = b13
gosub shftout
let b0 = b12
gosub shftout
peek $50,b0
gosub shftout
high 4
return

shftin:
let b0 = 0
for b1 = 1 to 8
b0 = b0 * 2
pulsout 1,1
if pin3 = 0 then skip
b0 = b0 + 1
skip: next b1
return

shftout:
for b1 = 0 to 7
low 0
if bit7 = 0 then zero
high 0
zero: pulsout 1,1
b0 = b0 * 2
next b1
return
'pin3 = data in
'output1 = clock (SO = falling edge)(SI = rising edge)
'output0 = data out
'output4 = chip select (low enable)
'address = w6

Edited by - picaxester on 18/03/2007 02:07:47
 

jplinteau

New Member
Hi,

I would strongly suggest that you use 24LC64 instead, this is directly compatible with picaxe i2c implementation.

If you absolutely need to interface with 24LC640, you will need to do some bit banging. You will find some usefull informations here <A href='http://www.phanderson.com/picaxe/picaxe.html' Target=_Blank>External Web Link</a>. There is some documents explaining how to interface component using SPI.

J-P
 
Top