Is it normal for a PIC to freeze during operation?
My PIC16F88 is configured as follow:
Internal RC @ 4MHz
RA1, RA2 & RA3 = Analogue measurements
RA0, RA6 & RA7 = Digital input signals
RA4 = Digital Output signal
(RA5 not used as IO, used for MCLR and Vpp for ICSP)
PORTB used for 2*20 line HD44780 type LCD
All three AI measurements are displayed on the LCD. The code also includes a real time clock, a number of starts counter and elapsed runtime timer. The circuit is used to control temperature using one AI as MV (Measured variable), one AI as SP (Set Point) for operation and the 3rd AI is used for ambient temperature indication. The SP has a hysteresis value of X°C less than SP (i.e. SP - Hyst) to switch the pump off. The SP is adjustable via a POT but the hysteresis value is called from a table in steps of 5°C. I have a counter that increments from 0 to 9 and that represents 5°C up to 50°C. This hysteresis value is stored in EEPROM to retain the last value in case of power failure or PIC reset.
The output signal is connected to another control circuit via a opto-isolator to galvanically isolate the two circuits.
The circuit run for about 2 days (I can’t pinpoint the exact time) before it just freezes up and the LCD becomes static with last shown values. No switch input or change to any of the temperature sensors can make the circuit to start up again. I’ve gone as far as to put a “heartbeat” indication on the LCD so that I can monitor the circuit. The only thing remaining is to do a reset. (Power off or MCLR).
My timer circuit (16F628) controlling my house lights and irrigation system has been running non-stop for years now. Why does the 16F88 freeze up?
Anybody willing to see what stupid mistake(s) I've made?
Thanks
View attachment AI_Measure.pdf Complete circuit diagram
View attachment AI_measure.zip MPLAB asm source code
Indication of normal LCD display (* = Heartbeat)
Runtime and no of starts counter indication
Hysteresis and real time indication
My PIC16F88 is configured as follow:
Internal RC @ 4MHz
RA1, RA2 & RA3 = Analogue measurements
RA0, RA6 & RA7 = Digital input signals
RA4 = Digital Output signal
(RA5 not used as IO, used for MCLR and Vpp for ICSP)
PORTB used for 2*20 line HD44780 type LCD
All three AI measurements are displayed on the LCD. The code also includes a real time clock, a number of starts counter and elapsed runtime timer. The circuit is used to control temperature using one AI as MV (Measured variable), one AI as SP (Set Point) for operation and the 3rd AI is used for ambient temperature indication. The SP has a hysteresis value of X°C less than SP (i.e. SP - Hyst) to switch the pump off. The SP is adjustable via a POT but the hysteresis value is called from a table in steps of 5°C. I have a counter that increments from 0 to 9 and that represents 5°C up to 50°C. This hysteresis value is stored in EEPROM to retain the last value in case of power failure or PIC reset.
The output signal is connected to another control circuit via a opto-isolator to galvanically isolate the two circuits.
The circuit run for about 2 days (I can’t pinpoint the exact time) before it just freezes up and the LCD becomes static with last shown values. No switch input or change to any of the temperature sensors can make the circuit to start up again. I’ve gone as far as to put a “heartbeat” indication on the LCD so that I can monitor the circuit. The only thing remaining is to do a reset. (Power off or MCLR).
My timer circuit (16F628) controlling my house lights and irrigation system has been running non-stop for years now. Why does the 16F88 freeze up?
Anybody willing to see what stupid mistake(s) I've made?
Thanks
View attachment AI_Measure.pdf Complete circuit diagram
View attachment AI_measure.zip MPLAB asm source code


