One minor adjustment - if RAM for the 5 variables starts at 0ch then the 10h used for storing the first pot value will be over-written by count3. I didn't pick this up as I was only interested at the time in the EEPROM movlw 10h ;store pot readings in RAM at address 10h up movwf fsr should be changed to movlw 11h or more if RAM is used for pot value storage (keep an eye on EEPROM endurance too) -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu