Well I did say it was late !
OK that works - and gives a better result for when the current temperature is below the set point, but gives values of 655xx when the curent temp exceeds the setpoint. Also the heatdriver that controlls the LED on port D4 doesn't work as it should. It should be on constant, and then start pulsing at around 1sec frequency as the temperature nears the set point, with the pulse duration getting shorter as the difference between the current temperature and setpoint gets smaller.
I've attached the PID include file hoping someone can advise
a pid_out of 65535 would be interpreted as - 1 by your code and therefore ignored
you have no code to call this routineCode:ASM HeaterDrive ........
as well as no interrupt code at all that might call it either
Bookmarks