Thanks for the reply, most of which went straight over my head !
I've uncommented the sections that were commented out from the 4ch version, so now the only thing that is different from the original 4ch version I used in this instant is a change to the LCD routine that simply displays the first channel and ignore the rest, and the menu for setting time and values so that it only loops round one time and not four for things like setting the target temp. It's now been set running, so will see if it's still running on the EP5 board in the morning, and if it's still showing the correct time.
My gut feeling is one of the following :
• The code was developed using PID libraries written by two other forum members - Whilst it was written for four channels, and had a means of running with just one channel by setting the value of a constant between 1 and 4, it was never tested using a single channel setting - so possibly a bug exists in the library file.
• The code needs all four channels, and by editing the code to remove channels 2,3,4 in parts of the main program, the library files are still functioning as if it's running 4 channels and something somewhere is corrupting, it's as if one of the interrupts isn't resetting when it overflows, and its filling up, and when it reaches it no longer runs that part of the code... The actual PIC must still be running because of the code
Code:
If alarm=1 then LCDOUT $FE,$80 + 15,("*"&FlashStar*$FF)|(" "&~(FlashStar*$FF)) ; flash a star to show sample time, but used to indicate Alarm settings monitored
FlashStar = !FlashStar
endif
My theory is that if the PIC wasn't running then this flashing asterisk would also stop. Anyway I squirted the re-compiled code to the PIC and left it running on the development board at 1am last night. This morning it was still running so I've placed the chip in the unit and will see how it goes. One thing I noticed is that I currently don't have a switch on the unit so it powers up when the plug is pushed into the mains socket, it took three attempts to get it to run stable without the temp and time display freezing with just the asterisk flashing... on most cases it would display the firmware version splash screen, then clear the screen and display the temp / time etc, and then reboot... but once it came back I could press the reset button (MCLR) and it then came back and would run fine...The MCLR pin is tied high via a 10K resistor, with push button to reset via grounding the MCLR pin. Could there be any reason's why the PIC resets / freezes like this on first power up.
Bookmarks