Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

writing 0x3f to eeprom in pic16f84

Status
Not open for further replies.

d@nny

Full Member level 5
Joined
May 28, 2011
Messages
246
Helped
11
Reputation
22
Reaction score
11
Trophy points
1,298
Activity points
3,238
i want to write 0x3f to eeprom
is my code ok or having errors


processor 16f84

include <p16f84.inc>

__config _RC_OSC & _WDT_OFF & _PWRTE_ON
org 00h
goto main
main:
banksel TRISB
movlw 00h
movwf TRISB
banksel INTCON
bcf INTCON , GIE
banksel EECON1
bsf EECON1 , WREN
banksel EEDATA
movlw 0h
movwf EEADR
movlw 0x3f
movwf EEDATA
banksel EECON2
movlw 55h
movwf EECON2
movlw AAh
movwf EECON2
bsf EECON1 , WR
wait:
btfss EECON1 , EEIF
goto wait
banksel PORTB
movlw B'11111111'
movwf PORTB
fin:
goto fin
END




one erroe is that the symbol aah is not previously defined

---------- Post added at 18:47 ---------- Previous post was at 18:34 ----------

Error[113] C:\USERS\DANNY\DESKTOP\EEEE.ASM 24 : Symbol not previously defined (AAh)

---------- Post added at 18:59 ---------- Previous post was at 18:47 ----------

Ohhhhh
i have successfully read and write data in the eeprom after changing aah with 0aah
now i have only one problem
i can understan eeif
??????????At the completion of the write cycle, the WR bit is
cleared in hardware and the EE Write Complete
Interrupt Flag bit (EEIF) is set. The user can either
enable this interrupt or poll this bit. EEIF must be
cleared by software.?????????????
 

The 16F84 Datasheet has all the info you need, Reference pg 33, Section 7.0 DATA EEPROM MEMORY:

PIC16F8X Datasheet

Here is a short tutorial as well:

EEPROM Data memory

The info should get you started in the right direction.[/QUOTE]

By the way, what programmer/debugger are you using to program the PIC16F84? Microchip now longer supports this PIC with their programmer/debuggers with their latest release of IDEs and firmware. The EEPROM in the PIC16F84 is one of the major issues as to why it was dropped from support.

For instance here is the latest Device Support List for the PICkit2.

**broken link removed**

No PIC16F84.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top