picprojects.net Forum

picprojects.net Forum
It is currently Fri May 26, 2017 5:35 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: EEPROM of PIC18F25K80 was reset after power down
PostPosted: Tue Apr 11, 2017 7:19 am 
Offline

Joined: Tue Apr 11, 2017 7:10 am
Posts: 1
Respected sir:
Thank you for taking time to read my post.I met some troubles when I working in the program about EEPROM of PIC18F25K80.
Firstly I think I need to explain to you that my English is so terrible,so any inconvenience in language please forgive me.
Let’s go into the subject.
I read and wrote the EEPROM of PIC18F25K80 according to the routine.This is the PIC18F25K80's datasheet: http://www.kynix.com/uploadfiles/pdf65976/PIC18F25K80-E2fMM_659162.pdf . In the situation of simulation,I feel the reading and writing is normal( the value is right). However,there are two problems.
1). The data can’t change as following my writing when I see MPLAB in the situation of simulation. It's odd!
2). I found tha EEPROM was reset after power down!

Before that I guess that the data I wrote didn’t save in the EEPROM.However,the following program which is read,very simple but what it shows is different from MPLAB’s.
Code:
unsigned char EE_Read (unsigned char EE_Address)
{
        EEADR = EE_Address;
        EEADRH = 0;
        EECON1bits.EEPGD = 0;
        EECON1bits.RD = 1;
        return EEDATA;
}

The following program I wrote which referring to others’ routine.

Code:
void EE_Write (unsigned char EE_Address, unsigned char EE_Data)
{
//*************************************************
//*单字节EEPRO写程序
//*地址:EE_Address 
//*数据:EE_Data
//*************************************************

        PIR4bits.EEIF = 0;
        EEADR = EE_Address;
        EEADRH = 0;
        EEDATA = EE_Data;
        EECON1bits.EEPGD = 0;
        EECON1bits.WREN = 1;
        INTCONbits.GIE = 0;

        _asm
                MOVLW        0X55


Your help will be appreciated!
Wishes~


Top
 Profile  
 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group