Re: 16F84 zápis do EEPROM
Lukáš Grepl
luky.ol
Středa Březen 17 11:49:15 CET 2004
This is a multi-part message in MIME format.
------=_NextPart_000_00BB_01C04DC4.CF1284C0
Content-Type: text/plain;
charset="iso-8859-2"
Content-Transfer-Encoding: 8bit
Na začátku rutiny je BSF STATUS, RP0, což je přepnutí druhé stránky paměti.
Tj. nas konci musi byt BCF STATUS, RP1. Prikladam INCcko pro cteni/zapis
EEPROM, jak ji pouzivam ja.
S pozdravem Lukas Grepl, OK2WDT
> rutinu pro zápis:
> BSF STATUS,RP0
...
> BCF EECON1,WREN
> stránku registrů toto:
>
> Message[302] D:\MPLAB\EXAMPLE\CASOVAC.ASM 77 : Register in operand not in
> bank 0. Ensure that bank bits are correct.
------=_NextPart_000_00BB_01C04DC4.CF1284C0
Content-Type: application/octet-stream;
name="Eeprom.inc"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Eeprom.inc"
ReadEEPROM movwf EEADR
bsf STATUS, RP0
bsf EECON1, RD
EERDLoop btfsc EECON1, RD
goto EERDLoop
bcf STATUS, RP0
movfw EEDATA
return
WriteEEPROM movwf EEADR
bsf SWR, RP0
movlw 55H
movwf EECON2
movlw 0aaH
movwf EECON2
bsf EECON1, WR
EEWRLoop btfsc EECON1, WR
goto EEWRLoop
bcf SWR, RP0
return
------=_NextPart_000_00BB_01C04DC4.CF1284C0--
Další informace o konferenci Hw-list