EE.Read stops interrupts

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
Gordon_h
Posts: 55
Joined: Fri Apr 06, 2007 8:55 pm
Location: Boulder, Colorado

EE.Read stops interrupts

Post by Gordon_h » Tue Jan 06, 2009 1:31 am

I am using an 18F4620, and when I read from EEPROM, it seems to stop all interrupts, and the processor "hangs". The code compiles fine. The offending subroutine is:

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?

Gordon_h
Posts: 55
Joined: Fri Apr 06, 2007 8:55 pm
Location: Boulder, Colorado

Solved!

Post by Gordon_h » Wed Jan 14, 2009 6:39 pm

It was something else :D

Post Reply