Paul & Lynn Tyrer wrote: > How do I : > Create a place to store the count. count res 1 ;individual events counter You'll need this later too: gallon res 4 ;32 bit total gallons global gallon > Increment 1 to this count when the state changes banksel count incf count ;count one more event > compare the stored count so when it equals 50 I increment the lcd by 1 movf count, w ;get the raw count sublw 49 ;compare to threshold skip_wgt ;got another whole gallon ? jump done_gallon ;no ; ; One more whole gallon detected. ; clrf count ;reset counts until next gallon movlw 1 ;count one more gallon addwf gallon+0 skip_ncarr addwf gallon+1 skip_ncarr addwf gallon+2 skip_ncarr addwf gallon+3 gcall disp_gallon ;display the new gallons value done_gallon SKIP_WGT, SKIP_NCARR, and GCALL are wrapper macros I use to make the code the code more readable, less tedious, and less error prone. You can probably guess from context what they do. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist