I've double checked things with the PICKIT1 and 16F688 datasheets and it seems ok, besides I don't understand why I had it working a year ago (and still have a programmed 16F688 that works). Is there a way to get the program back from the PIC? Or can you check what I want it to do is what the code actually says.
To Ian Rogers:
The trimmer is connected to AN0/RA0 pin so I want the code to read from that input, is that what my code is doing or did you mean I'm reading from the wrong place?
I thought "k++;" on line 94 increments k. Correct me if I'm wrong.
I have several 16F688s as that seems to be the only one that has a hardware USART and can be programmed with a PICKIT1.
I have checked the pic16f688.h file (attached) for the __CONFIG and I believe FOSC_INTOSCIO means to use the internal oscillator, which i want to do.
Another idea I had was that the (pro trial) Hi-Tech compiler is optimising the code without me knowing it. Is there a better way to make it read AN0 and output it on the serial (RS232) once a second?
Thanks,
Jules.