EEVblog Electronics Community Forum

Electronics => Microcontrollers => Topic started by: aiq25 on June 03, 2015, 07:05:14 pm

Title: Reading flash (NVM) memory on Freescale S12G microcontroller
Post by: aiq25 on June 03, 2015, 07:05:14 pm
Hi. I'm using a Freescale S12G family micro. I'm trying to get the ADC reference voltage to work. I'm looking to read the internal voltage reference of the micro (already have this working) and comparing it with the stored value to get the actual VRH (in my case VCC) of the ADC. This is to compensate any variations in the VRH (in my case VCC).

I'm looking at the datasheet and it says the following:
VRH = (StoredReference/ConverteredReference)*5V

I have the ConvertedReference done but I can't read the stored reference. The datasheet says it's in NVM memory IFR location 0x0_4022/0x0_4023. Can anyone give me some pointers on how to read that memory location? I'm still a beginner at programming, that's why I'm a little confused. I'm using CodeWarrior IDE.

Thank You.