Many thanks for all the replies. My project is rolling along again for the moment.
I went to a night class in C programming a few years ago but seam to have forgotten a few things. I am reading out values to a computer screen via serial link in the manner of largedemo by replacing "new" with whatever I want to read out. Even with error declared as unsigned uint16_t I had the same positive and negative readout as with error declared as int_16t. I will have to think why. As for the volatile declaration I just used the idea from largedemo. Some of the variables there are declared as volatile. Looking up the meaning of volatile in C programming I am given :- "not stored in machine register" but where it is stored and what it means in terms of avr programming I really dont know. At the moment I am using two potentiometers to simulate real word inputs. I am buffering the internal 2.56V reference to supply the potentiometers and using same internal reference for adc. It is atmega8 with 10 bit converssion so my potentiometers read out 0-1023 and I dont have the overflow type of problem just at the moment. I am working towards a controller like PID descibed on Atmels site alternatively a fuzzy one. John _______________________________________________ AVR-chat mailing list AVR-chat@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-chat