Udate: I have some success now. I used COUNT[pin,duration,var] and it's working fine except for my tests complete: How do I get my cycle counter to count decimal beyond 255?
Code:Init: INTCON.7 = 0 'Disable interrupts OPTION_REG = %00111000 TRISB = %01100111 'Setup Port B PORTB = %00000000 'Clear port B pins T_cyc Var Byte T_cyc = 0 PAUSE 1000 'Pause for the LCD to wake Relay1 var PORTB.5 X Var Byte B VAR Byte X=0 B=0 Relay: T_cyc = T_cyc + 1 'Test cycle counter High Relay1 'Drive relay pin 26 high for 10 seconds Count PORTB.6,11000,X LCDout $fe, 1, "Test # ",dec4 T_cyc 'Test cycle (0-9999 tests) LCDout $fe,$c0, DEC5 X, " Pulses" Low Relay1 'Drive realy pin 26 low PAUSE 1000 'Pause 1 second If X=198 then B=B+1 'Did we get 198 pulses (pass or fail)? LCDOUT $fe,$c0 'Clear the LCD LCDOUT $fe,$c0, DEC4 B, " Tests OK" 'Print the # of good tests PAUSE 2000 LCDOUT $fe,$c0 PAUSE 500 GOTO Relay End




Bookmarks