Hello Alain,
thanks, both EEPROM and DATA, WRITE and READ are work well
regards,
Hello Alain,
thanks, both EEPROM and DATA, WRITE and READ are work well
regards,
hi ,can someone help to see where is problemes are
the output is only the first byte of data stored in a table
pic16f877A
ADCON0 = 0
ADCON1 = 7
define osc 20
trisB = 0 ' SET PORTB AS OUTPUT
PORTB = 0 ; SET PORTB t and C to 0
trisc = 0
portc = 0
trisd = 0 ; 2 pins of this port is for reset and clock
erasecode $500 ; erase code space @$500 (page 0)
B0 var word
StrAddr var word
F0 var byte
E0 var byte
k var byte
LOOP ; this loop display the value stored in the flash
b0 = 0 ; initial value
FOR StrAddr = 500 to 505 step 2 ; read a word
call display
NEXT StrAddr
goto loop
'--------------------
DISPLAY:
Peekcode StrAddr, b0 ; fetch a value from table
f0 = b0.lowbyte
e0 = b0.highbyte
call output1
return
'-----------
output1:
for k = 0 to 30 ; output 2 ports of B and C
call reset
portb = f0
portc = e0
call delay
next k
return
'-------------------------------------------------------
RESET: PORTd.2 = 1 ;RESET 4017 pin 16-PIC
@NOP
PORTd.2 = 0
RETURN
'-----------------------------------------------------------
DELAY:
pause 1 ;
portb = 0 ; reset portb , c
portc = 0
portd.3 = 1 ; clock the 4017 pin17-PIC
@nop
portd.3 = 0
return
end
pokecode @$500, $2a,$55 ,$55, $2a ,$55 ,$2a ; store data in flash mem
thnaks for all reply,
Bookmarks