Truncated match.
PICList
Thread
'Help EEPROM'
1997\05\24@130113
by
Francesco Cembrola
Hello PIC'ers,
I need some help. Despite my best efforts, I have not been able to write to
the EEPROM of the PIC16C84. What I really would like is a written program of
how this is done.
Please could anyone show me how to do this? It is hard when you are a novice!
Thank you all,
Francesco Cembrola
spam_OUTfcembrolaTakeThisOuT
aol.com
1997\05\24@133055
by
Tony Matthews
|
Francesco Cembrola wrote:
>
> Hello PIC'ers,
>
> I need some help. Despite my best efforts, I have not been able to write to
> the EEPROM of the PIC16C84. What I really would like is a written program of
> how this is done.
>
> Please could anyone show me how to do this? It is hard when you are a novice!
>
> Thank you all,
>
> Francesco Cembrola
> .....fcembrolaKILLspam
@spam@aol.com
Display this reply full screen for proper formatting.
Are you sure you are not writing? but maybe reading wrong?Do you
include eeprom data in your program listing? are you switching bank
bits like you are supposed to ? Clip a relative piece of code for us to
look at.Are you writing sequential bytes or just one?
I read:
BCF STATUS,RPO ; shift to bank zero
MOVLW D'5' ; register eeprom addres
s for ONES_BATCH
MOVWF EEADR ; load address of eedata
needed
BSF STATUS,RPO ; shift to bank one
BSF EECON,RD ; eeread bit set
BCF STATUS,RPO ; shift to bank zero
MOVF EEDATA,W ; eedata in w register
MOVWF ONES_BATCH ; preset the register fr
om eeprom value
I write :
INCF ONES_BATCH,F ; increment the ones_bat
ch register
BSF STATUS,RPO ; shift to bank one
BSF EECON,WREN ; write enable bit
BCF STATUS,RPO ; shift to bank zero
MOVLW D'5' ; address of BATCH eepro
m byte
MOVWF EEADR ; address register eepro
m
MOVF ONES_BATCH,W ; load value of ONES_BAT
CH variable to EEPROM
MOVWF EEDATA ;
BSF STATUS,RPO ; bank 1
MOVLW H'55' ; write 55h
MOVWF EECON2 ; ""
MOVLW H'AA' ; write aah
MOVWF EECON2 ; ""
BSF EECON,WR ; set WR bit begin write
CLEARED IN HDW
BCF EECON,WREN ; DISABLE EEPROM WRITES
BCF STATUS,RPO ; shift to bank zero
Some of this can no doubt be eliminated if the states on entry are known
but this as a call from anywhere routine works ok.
More... (looser matching)
- Last day of these posts
- In 1997
, 1998 only
- Today
- New search...