Code: Select all
Public Sub readCommonCal() ' Set the calibration values to sensible defaults
EE.Read(eVpM,VpM) ' Slope coefficient for Vp calculation
EE.Read(eIpM,IpM) ' Slope for Ip calculation
EE.Read(eIpR,IpR) ' Offset for Ip calculation
EE.Read(eVgM,VgM) ' Slope for grid voltage calculation
EE.Read(eVgR,VgR) ' Offset for grid voltage calculation <-
EE.Read(eIgM,IgM) ' Slope for grid current calculation <-
EE.Read(eIgR,IgR) ' Offset for grid current calculation
EE.Read(ePEBS,PEBS) ' Electronic bias switching threshold in tenths of a watt
EE.Read(eG1,G1) ' "backed off" grid DAC setting
EE.Read(eG2,G2) ' "full on" grid DAC setting
EE.Read(eLED1,LED1) ' Green LED threshold, tenths of a mA
EE.Read(eLED2,LED2) ' Red LED threshold, tenths of a mA
End Sub
The two "flagged" lines are the worst= if I comment them out, the code runs fine.
I call this sub only once, at the beginning of the program, before interrupts are initialized, and after a 2.5 second delay from reset.
I read the 4620 data sheet and errata, but there is no mention of any problems like this. I note there is an interrupt EEIE,EEIF etc. that can be used during EEPROM write to signal the end of the write timing pulse. But no mention of any restrictions on reading, or any other interrupts that might be going off.
Has anyone seen behavior like this before?