Guys, I need some advice on basic storage locations as I'm running round in circles...
Pic: 18F4620
Task: To load a set of pre-set values for a project that has 16 channels when first programmed. Each channel has an on time, an off time and a maximum value for the level. All of these are word variables can then be set by a user via menu options, so for argument sake all the on times can be pre-set to 14:00 hrs and then the user can set channel one to 15:00 hrs, then channel two to 16:00 hrs etc. Then in the event of a power fail these user values are saved and then read back in.
At the moment I can have used the normal READ and WRITE statements to keep track of the user set variables, but its been suggested that I need to use the DATA statement to write the initial data to the EEPROM. The only thing is I'm not that clear on how to do this correctly.
My current read write statements start at location 8
Code:
write 8,CH1_Max.lowbyte
write 9,CH1_MAX.highbyte
write 10,CH2_Max.lowbyte
write 11,CH2_Max.highbyte
write 12,CH3_Max.lowbyte
.....
write 102,CH16_off_Time.lowbyte
write 103,Ch16_off_Time.highbyte
No I know that the DATA statement uses a similar arrangement for location, so would I simply substitute the WRITE command for DATA ?
Code:
DATA 8,CH1_Max.lowbyte
DATA 9,CH1_MAX.highbyte
DATA 10,CH2_Max.lowbyte
And does the READ statement work with DATA statement, or do I need to use EEPROM statement is some way ?
Sorry if this seems a noob question, but in my previous projects I've never bothered with worrying about saving the settings as it was often quick enough to re-enter them manually as there were not so many values to set..but 96 entries is just a tad to much...
Bookmarks