@ skimask. yeah i know but we make do with what we have.

@acetronics: I chose BR0/INT because the receiving circuit is a single frequency passband filter, with a peak at 40.3kHz and the -3db points at 39.2kHz and 41.6kHz, which is then connected to a comparator giving me a change of 0VDC-5VDC hence wanting to use the external interrupt on a change of PORTB.0, I'm using the RB3/CCP to generate a 40kHz signal.
I'm aiming for a range of 0.5m to 20m but with the attenuation on a 40kHz signal in air 10m is more realistic, if only i could get my hands on a 25kHz transducer set (they dont bring them into south africa).

ok think i've got my timer1 problems sorted. wanting a prescaler value of 1:2, a preset value of 1000. is the following code right?


preset Var Word
preset = 1000 ' to give me a preset value of 2ms at a prescaler value of 1:2 for timer1
TMR1H = preset.highbyte
TMR1L = preset.lowbyte
T1CON = %00010000 'prescaler value of 1:2, timer diabled
INTCON = %11010000 ' GIE & PEIE & INTE enabled
PIE1.0 = 0 ' TMR1 interrupt disabled
PIR1.0 = 0 ' TMR1 interrupt flag reset

start code......
........
.......
T1CON.0 = 1 ' timer1 enable with a preset value of 1000 and a prescaler value of 1:2
pause 2000 'wait 2 seconds, this is the only place that the external interrupt must be active, still working on that tho.
T1CON.0 = 0 ' timer 1 disable
more code....
.........
.........
end code

i've read through the datasheet and it doesnt explain GIE and PEIE very well, what is their purpose? does GIE enable every interrupt or just allow the enabled interrupts to happen throughout the entire program? do i have to set PEIE to enable an external interrupt?