I'm new to C and am trying to write a byte to the internal EEPROM in a 18F45k20. I've done this in the past using assembly but now I'm working in C I figure there should be a function for doing this. I've found reference to write_b_eep and read_b_eep on the net but cannot see any reference to these in the MPLAB C18 Compiler Libraries documentation. What is the way to approach this? thanks
MCC18 / PIC C18 - how to write to internal EEPROM?
Started by ●March 12, 2010
Reply by ●March 12, 20102010-03-12
"Royston Vasey" <royston@vasey.com> wrote in message news:a-udnb-tSKYqVQTWnZ2dnUVZ_hudnZ2d@westnet.com.au...> I'm new to C and am trying to write a byte to the internal EEPROM in a > 18F45k20. > > I've done this in the past using assembly but now I'm working in C I > figure there should be a function for doing this. > > I've found reference to write_b_eep and read_b_eep on the net but cannot > see any reference to these in the MPLAB C18 Compiler Libraries > documentation. > > What is the way to approach this? > > thanks > > > >ok - I tried the following: Write_b_eep(0,my_var); //code to save my_var to eeprom Looking at the EEPROM memory at location 0x00 is not changed. It compiles fine and during execution I can see the code jump into the Write_b_eep function located in write_b.c Is there some documentation somewhere that will help me with this function??
Reply by ●March 12, 20102010-03-12
Royston Vasey wrote:> "Royston Vasey" <royston@vasey.com> wrote in message > news:a-udnb-tSKYqVQTWnZ2dnUVZ_hudnZ2d@westnet.com.au... >> I'm new to C and am trying to write a byte to the internal EEPROM in a >> 18F45k20. >> >> I've done this in the past using assembly but now I'm working in C I >> figure there should be a function for doing this. >> >> I've found reference to write_b_eep and read_b_eep on the net but cannot >> see any reference to these in the MPLAB C18 Compiler Libraries >> documentation. >> >> What is the way to approach this? >> >> thanks >> >> >> >> > > ok - I tried the following: > > > Write_b_eep(0,my_var); //code to save my_var to eeprom > > Looking at the EEPROM memory at location 0x00 is not changed. > > > It compiles fine and during execution I can see the code jump into the > Write_b_eep function located in write_b.c > > Is there some documentation somewhere that will help me with this function?? > > > > > > >google is your friend http://my.opera.com/raphman/blog/show.dml/266030 hamilton
Reply by ●March 13, 20102010-03-13
"hamilton" <hamilton@nothere.com> wrote in message news:hndj9c$r76$1@news.eternal-september.org...> Royston Vasey wrote: >> "Royston Vasey" <royston@vasey.com> wrote in message >> news:a-udnb-tSKYqVQTWnZ2dnUVZ_hudnZ2d@westnet.com.au... >>> I'm new to C and am trying to write a byte to the internal EEPROM in a >>> 18F45k20. >>> >>> I've done this in the past using assembly but now I'm working in C I >>> figure there should be a function for doing this. >>> >>> I've found reference to write_b_eep and read_b_eep on the net but cannot >>> see any reference to these in the MPLAB C18 Compiler Libraries >>> documentation. >>> >>> What is the way to approach this? >>> >>> thanks >>> >>> >>> >>> >> >> ok - I tried the following: >> >> >> Write_b_eep(0,my_var); //code to save my_var to eeprom >> >> Looking at the EEPROM memory at location 0x00 is not changed. >> >> >> It compiles fine and during execution I can see the code jump into the >> Write_b_eep function located in write_b.c >> >> Is there some documentation somewhere that will help me with this >> function?? >> >> >> >> >> >> >> > google is your friend > > http://my.opera.com/raphman/blog/show.dml/266030 > > hamiltonThanks hamilton, google threw me a couple of dud results....your suggested link works great. At the learning stage I'm at, discerning the crap from the good is difficult. Thanks