HI, now I want to get the frequency of 38KHZ through the chip JN5169. How can I get this frequency through the frequency division coefficient of the hardware timer?

HI, now I want to get the frequency of 38KHZ through the chip JN5169. How can I get this frequency through the frequency division coefficient of the hardware timer?

Hi,

Did you look at the example of 10 ms?

This is the frequency of the 100 Hz

The clock is 16MHz so the time period is 0.0625micro seconds

Pre-escaler= 8

Clock by 2^8 = 256 hence multiplying the time period by 256

Timer clock will be 0.0625us * 256 = 16usTime High =(10ms/16us)=625

vAHI_TimerStartRepeat(E_AHI_TIMER_0, 312,625);Regards,

Mario

Yes, I have seen the example of 10ms.Since the parameter 'pre-escaler' can only be an integer, the frequency division coefficients obtained are 2^1=2,2^2=4,2^3=8,2^4=16. I cannot change the frequency division coefficients arbitrarily.So I don't know how to get 38Khz. Can you give me an example of 38Khz?

- 1 person found this helpful
Hi,

I am toggling a pin in the ISR Timer 0.

You need to calculate based on the frequency of the 38 kHz

The clock is 16MHz so the time period is 0.0625micro seconds

Pre-escaler= 4

Clock by 2^ 4= 16 hence multiplying the time period by 16

Timer clock will be 0.0625us * 16= 1usTime High =((1/38k)/1us)= 26

vAHI_TimerStartRepeat(E_AHI_TIMER_0, 13, 26);Regards,

Mario

Hi,

Did you want this frequency working with the Timer module?

Please look at the next community post. USING INTERRUPT TIMER IN EXAMPLE JN-AN-1218-Zigbee-Light-Bulb - 2

Regards,

Mario