Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Pic16F877A eeprom to (system_variables)

Status
Not open for further replies.

Chilly

New Member
Using HiTech C. I have a program that has a 6 case menu. Each case displays system settings that are currently running. There's 4 buttons controlling
menu up, menu down, value up and value down which controls the 5 system variables.
I've added a case whereby I can save the current settings to eeprom. I'm also able to read back the settings. What I'd like to do is insert into system variables my settings. I have an if statement. Interrupt is setup. Something like,
Code:
                If button down{
                     change(system_variables) with (eeprom_settings) ;
                   }
I've tried searching but don't exactly know what I'm looking for. If someone could point me in the right direction.
 
Write two functions void WriteEEPROM(uint8 add,uint8 dat) and uint8 Read EEPROM(uint8 add) and use them to read and write your variables.

Mike.
 
Thanks Mike. It's late here and I probably didn't make myself clear. I have those routines and successfully write to and retrieve data to/from eeprom. No problem.
Where I'm stuck is how to convert the eeprom data back into a system variable. It seems like it would be simple as
if(!button_down){
(system_variable) = eeprom_read(0x01) ;
}


I'm thinking I just answered my own question.
 
Last edited:
Mike,
I just tried it and it worked. Looking at what I needed to do helped a great deal. I'll chalk it up to old age.
Thanks.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top