You should verify that the signal is strong enough, a mic produces very little voltage. I'd say that a scope is necessary. You might get away with "CMCON = 6" and monitor the comparator output on RA4. If you can see changes on that pin(dont forget the pullupresistor) you should be able to catch them in your program.
If the signal is very "spikey" there is a very big chance(risk) that your program is doing something else when the "spike" appears. This could be cured by looking at the compataror interruptflag(PIR1.6) instead of the comparator output(CMCON.7).
It also looks like you could reduce your mainloop to ......
BEGIN:
IF PULS = 1 Then COUNTERT = COUNTERT +1
LCDOut, COUNTERT
GoTo BEGIN
..... but i assume this is only some code you're using to verify the comparator.
/Ingvar
Bookmarks