Hi,
I'm doing a sonar sensor(2MHz) circuit and would like to generate a 2 MHz PWM signal for the sensor using PIC16F873. The resonator is 20MHz. I read through the PICmicro Mid-Range MCU Family datasheet, i saw the equation
PWM period = [(PR2) + 1] 4 TOSC (TMR2 prescale value),
frequency = 1 / period.
I know the PWM period, TOSC and the TMR2 is 1, can i simply put in all the known values to calculate the PR2 and produce this 2MHz PWM? If this is wrong, can you give some suggestion to generate this signal with the PIC16F873. Thank you
I'm doing a sonar sensor(2MHz) circuit and would like to generate a 2 MHz PWM signal for the sensor using PIC16F873. The resonator is 20MHz. I read through the PICmicro Mid-Range MCU Family datasheet, i saw the equation
PWM period = [(PR2) + 1] 4 TOSC (TMR2 prescale value),
frequency = 1 / period.
I know the PWM period, TOSC and the TMR2 is 1, can i simply put in all the known values to calculate the PR2 and produce this 2MHz PWM? If this is wrong, can you give some suggestion to generate this signal with the PIC16F873. Thank you