Josuetas
- 15th September 2006, 19:47
Hi!!!
I am having this problem: my memory writes and reads fine until it has to write in a change page byte (around 64 bytes). The thing here is that my "data packet" is 24 bytes and while writing through 64 bytes I get wrong bytes.
this is my code for writing:
**********************************************
**********************************************
Writemem:
lcdout "Writing"
I2Cwrite SDAmem,SCLmem,$A0,addr,[reciboH, reciboL.byte1, reciboL.Byte0]
pause 10
addr= addr+3
I2Cwrite SDAmem,SCLmem,$A0,addr,[Numeromarc[CabRx*10],Numeromarc[CabRx*10+1],Numeromarc[CabRx*10+2],Numeromarc[CabRx*10+3],Numeromarc[CabRx*10+4],Numeromarc[CabRx*10+5],Numeromarc[CabRx*10+6],Numeromarc[CabRx*10+7]_
,Numeromarc[CabRx*10+8],Numeromarc[CabRx*10+9]]
pause 10
addr= addr+10
I2Cwrite SDAmem,SCLmem,$A0,addr,[RTCDay, RTCMonth, RTCYear, Hourinicio[Cabrx], minsinicio[Cabrx], Secsinicio[Cabrx]]
pause 10
addr=addr+6
I2Cwrite SDAmem,SCLmem,$A0,addr,[hourscall[Cabrx],minscall[Cabrx],secscall[Cabrx]]
pause 10
addr=addr+3
I2Cwrite SDAmem,SCLmem,$A0,addr,[TotalActCab [Cabrx]]
pause 10
addr= addr+2
write regsmemHm, addr.byte1 'proxima dirección de mem a escribir
write regsmemLm, addr.byte0
'**************AUMENTAR NUMRECIBO
if reciboL = 65535 then
reciboH=reciboH+1
reciboL=0
else
reciboL=reciboL+1
endif
write reciboHm, reciboH
write reciboLlowm, reciboL.byte0
write reciboLHighm, reciboL.byte1
return
**********************************************
**********************************************
What should I do? do i have to write one byte at the time?
Thanks in advance!!
DAVIDCAS
I am having this problem: my memory writes and reads fine until it has to write in a change page byte (around 64 bytes). The thing here is that my "data packet" is 24 bytes and while writing through 64 bytes I get wrong bytes.
this is my code for writing:
**********************************************
**********************************************
Writemem:
lcdout "Writing"
I2Cwrite SDAmem,SCLmem,$A0,addr,[reciboH, reciboL.byte1, reciboL.Byte0]
pause 10
addr= addr+3
I2Cwrite SDAmem,SCLmem,$A0,addr,[Numeromarc[CabRx*10],Numeromarc[CabRx*10+1],Numeromarc[CabRx*10+2],Numeromarc[CabRx*10+3],Numeromarc[CabRx*10+4],Numeromarc[CabRx*10+5],Numeromarc[CabRx*10+6],Numeromarc[CabRx*10+7]_
,Numeromarc[CabRx*10+8],Numeromarc[CabRx*10+9]]
pause 10
addr= addr+10
I2Cwrite SDAmem,SCLmem,$A0,addr,[RTCDay, RTCMonth, RTCYear, Hourinicio[Cabrx], minsinicio[Cabrx], Secsinicio[Cabrx]]
pause 10
addr=addr+6
I2Cwrite SDAmem,SCLmem,$A0,addr,[hourscall[Cabrx],minscall[Cabrx],secscall[Cabrx]]
pause 10
addr=addr+3
I2Cwrite SDAmem,SCLmem,$A0,addr,[TotalActCab [Cabrx]]
pause 10
addr= addr+2
write regsmemHm, addr.byte1 'proxima dirección de mem a escribir
write regsmemLm, addr.byte0
'**************AUMENTAR NUMRECIBO
if reciboL = 65535 then
reciboH=reciboH+1
reciboL=0
else
reciboL=reciboL+1
endif
write reciboHm, reciboH
write reciboLlowm, reciboL.byte0
write reciboLHighm, reciboL.byte1
return
**********************************************
**********************************************
What should I do? do i have to write one byte at the time?
Thanks in advance!!
DAVIDCAS