English Amiga Board


Go Back   English Amiga Board > Support > support.Hardware > Hardware pics

 
 
Thread Tools
Old 10 June 2017, 08:56   #1
migrant
 
Posts: n/a
Troubles Occurred When Programming PIC18F25K8

Good day~everybody

I met some troubles when I working in the program about EEPROM of PIC18F25K8.( the datasheet of PIC18F25K8 )

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.In the situation of simulation,I feel the reading and writing is normal( the value is right). However,there are two problems.
3). The data can’t change as following my writing when I see MPLAB in the situation of simulation. This is odd!
4). 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.
unsigned char EE_Read (unsigned char EE_Address)
Code:
{
        EEADR = EE_Address;
        EEADRH = 0;
        EECON1bits.EEPGD = 0;
        EECON1bits.RD = 1;
        return EEDATA;
        }
This is the program I wrote which referring the others’ routine.

Code:
void EE_Write (unsigned char EE_Address, unsigned char EE_Data)
{
//*************************************************
//*single bytes EEPRO write program
//*address:EE_Address  
//*data: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
Please help me solve problems!

Best regards~
 
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception "Line 1111 Emulator" ($2C) at $B66 occurred. subone support.Hardware 14 25 September 2016 04:32
A4000D Troubles Ami_GFX support.Hardware 5 28 June 2014 03:02
Network troubles Doc Mindie support.Other 7 10 April 2013 17:17
IGame troubles N-Ed support.Apps 4 21 September 2012 16:47
Floppy troubles petemaxi support.Hardware 2 19 May 2011 09:16

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:32.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.23587 seconds with 15 queries