Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I am designing PIC16F877a based project that counts the number of people in a room and turn ON the relays in accordance with that number like if 5 persons in a room then One relay would be ON. I want user of the device to set the number according to their need therefore I want to store some integers variables (value defined by user) in a Flash memory on uC at runtime using C code. I have searched on Google but did not find any suitable answer.

share|improve this question
3  
Your PIC has 256 bytes of EEPROM; you can use that to store your variables. Depending on the compiler, it may have some built-in function to read/write the EEPROM memory. – m.Alin May 12 at 8:35
@m.Alin I am using HI-TECH C compiler. What built in functions are available for it. – Farid-ur-Rahman May 12 at 8:39
unsigned char eeprom_read (unsigned int address); void eeprom_write (unsigned int address, unsigned char value); | You should include the htc.h header file – m.Alin May 12 at 8:48
1  
I know "Use Google" answers are frowned upon, but re: I am using HI-TECH C compiler. What built in functions are available for it. Seriously, just google "Hi-tech c pic eeprom" and the easily first 10 results are exactly what you want. – Connor Wolf May 12 at 10:46
2  
@Connor : that search works because you already know one search term that wasn't in the original question! – Brian Drummond May 12 at 13:21
show 1 more comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.