Hi Richard,
I don't see where you're going with your comments, maybe I'm just thick.
In any case the Int Handler does recognize CW and CCW correctly with every turn and RE_val does increment or decrement accordingly by 1 count per detent as needed - the only issue is these unwanted regular serial disturbances following RE action, including the push button. Speed of rotation isn't a factor with their appearance.
Something else is going on also - if I insert a Clear statement as below the RE_val resets to 0 - as if the PIC is reinitializing following the RE action hence the "I'm Alive" serial traffic. Without the Clear the count remains as it was prior to the serial disturbance.
Is there a chance you could breadboard a 16F1788 and confirm my findings?
Thanks,
Bill
Code:' IOCBP = %01110000 ; REa portb.6, REb portb.5 pos edge trigger IOCBN = %01110000 ; REa portb.6, REb portb.5, REsw portb.4 neg edge trigger - falling edge only. IOCBF = 0 ; Reset the PortB flag. INTCON = %11001000 ; GIE, PEIE, IOCIE. clear ' Clear all vars. MaxLimit = 60 ' Menu value limit. ' pause 100 ' Let everything settle... serout2 PORTC.6,16468,[13,10,"I'm Alive",13,10,10] SAMPLE of terminal RE_val 00001 RE_val 00002 RE_val 00003 ButtPush = 1, RE 00003 RE_val 00004 RE_val 00005 RE_val 00006 RE_val 00005 RE_val 00000 RE_val 00000 ButtPush = 1, RE 00000 RE_val 00001 RE_val 00002 RE_val 00003 RE_val 00004 RE_val 00005 RE_val 00006 RE_val 00007 RE_val 00008 RE_val 00009 RE_val 00010 RE_val 00011 RE_val 00010 RE_val 00009 RE_val 00008 RE_val 00007 RE_val 00006 RE_val 00005 ButtPush = 1, RE 00005 RE_val 00006 RE_val 00007 RE_val 00008 I'm Alive RE_val 00001 RE_val 00002 RE_val 00003 RE_val 00004




Bookmarks