Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

16Mhz clock no prescaler

1/16Mhz = 0.0000000625s = 0.0625us

50us/0.0625us =
now to get 50us when 65536 gets filled we need start from 64736

Test:
//800*0.0625us = 50us

//////////prescaler 8/////////
clk 16Mhz/8 = 2Mhz
1/2Mhz = 0.5us

overflows every 65536/2M = 0.032768s

65536-100 = 65436 counts needed

You might also like