dj.lambert
- 25th March 2009, 16:04
Hi All
I have a problem reading from AT93c46 eeproms
when i use the code below (hopefully) the first few locations come back as random garbage but the rest come back as values i expect..also the number of garbage locations change with each read.. I am more than a little confused.. any ideas as to the cause of this would be greatly appreciated,(although i have probably done something stupid with my code that i can't see)
thanks in advance
<code>
@ device pic16F877, HS_osc, wdt_on, pwrt_on, protect_off
define osc 16
define shift_pauseus 500
CS var portb.1
SCK var portb.2
SI var portb.4
SO var portb.5
trisb=%11101101
B0 var byte
B1 var byte
addr var byte
cs=0
pause 1000
for addr = 0 to 32
cs=1
pauseus 10
shiftout sI,sck,1,[%110\3,addr\6]
shiftin so,sck,2,[b0,b1]
serout portd.7,2, [b1,b0]
cs=0
next
serout portd.7,2, [10,13]
end
<\code>
I have a problem reading from AT93c46 eeproms
when i use the code below (hopefully) the first few locations come back as random garbage but the rest come back as values i expect..also the number of garbage locations change with each read.. I am more than a little confused.. any ideas as to the cause of this would be greatly appreciated,(although i have probably done something stupid with my code that i can't see)
thanks in advance
<code>
@ device pic16F877, HS_osc, wdt_on, pwrt_on, protect_off
define osc 16
define shift_pauseus 500
CS var portb.1
SCK var portb.2
SI var portb.4
SO var portb.5
trisb=%11101101
B0 var byte
B1 var byte
addr var byte
cs=0
pause 1000
for addr = 0 to 32
cs=1
pauseus 10
shiftout sI,sck,1,[%110\3,addr\6]
shiftin so,sck,2,[b0,b1]
serout portd.7,2, [b1,b0]
cs=0
next
serout portd.7,2, [10,13]
end
<\code>