HOW PRECISE IS PWM
Posted: Sun Aug 29, 2021 1:45 pm
hi all
I've just started to learn how to use PWM with the help of members on this forum, however I've noted that its difficult to obtain certain frequency's and that at best you can get a frequency either side of the one you want from several Hz either way, this was backed up when i checked an online calculator for pwm when you input your clock frequency say 8MHz then ask for 50% duty the frequency range starts at 488Hz and from here increments in 2Hz steps so 488, 490, 492 etc and the drift becomes greater the higher you go until your around 10Hz adrift of the frequency you would like ie 1117Hz but the closest is 1126 or the other way 1106 Hz. i then acquired a signal generator module from eBay to check for accuracy, the module lets you pick a frequency from 1Hz to 150KHz and you can adjust the duty from 0 - 100% all done with buttons and using an lcd but when using a fluke to measure the output it was found on some frequency's again this could be as worse as over or under up to 20Hz difference. i don't know if I've got this concept totally wrong but can you get an exact frequency you want pending on prescaler or would you require more than 10 bits to achieve this accuracy if in deed it does exist, thanks in advance
bob
I've just started to learn how to use PWM with the help of members on this forum, however I've noted that its difficult to obtain certain frequency's and that at best you can get a frequency either side of the one you want from several Hz either way, this was backed up when i checked an online calculator for pwm when you input your clock frequency say 8MHz then ask for 50% duty the frequency range starts at 488Hz and from here increments in 2Hz steps so 488, 490, 492 etc and the drift becomes greater the higher you go until your around 10Hz adrift of the frequency you would like ie 1117Hz but the closest is 1126 or the other way 1106 Hz. i then acquired a signal generator module from eBay to check for accuracy, the module lets you pick a frequency from 1Hz to 150KHz and you can adjust the duty from 0 - 100% all done with buttons and using an lcd but when using a fluke to measure the output it was found on some frequency's again this could be as worse as over or under up to 20Hz difference. i don't know if I've got this concept totally wrong but can you get an exact frequency you want pending on prescaler or would you require more than 10 bits to achieve this accuracy if in deed it does exist, thanks in advance
bob