what is correct Sampling frequency (sampling rate) in the given code? Is it 8kHz? I'm having trouble to find it.
This comment suggests 8kHz
.equ TIMECONST, #32000 ;Use 32000 samples (4 seconds) as constant to find peak
and this section of the code specifically says "8KS/s"
;Setup Timer 1 for sampling delay: Tcy = 16MHz (64MHz Clock)
mov #0x8000,w1 ;8KS/s at Tcy=16MHz
mov w1,T1CON ;1:1, Int Clk, ON
mov #2000,W1 ;Load PR1 for delay, 8KS/s Sample Rate @16MHz Internal
mov w1,PR1