Signal generator works from 245Hz to 300KHz how about 1Hz to 244Hz

Signal generator works from 245Hz to 300KHz Attached is the code. It has square pulse 1 , duty cycle 1 , delay1 and square pulse reversed 180 degrees 2 , duty cycle 2 , delay 2.

how can i make it also work in the frequency range 1Hz to 244Hz?

Attached is the PWMFuncions.ino

When you only allow a 16 MHz clock and can only have 65535 timer steps per cycle you can only get down to 244 Hz. To get lower frequencies, use a prescaler higher than 1. The maximm prescale of 1024 should get you down to 0.238 Hz. To get to 1 Hz you only need the prescale of 256.

johnwasser how this code should be to work from 1Hz to 300KHz? Can you send me the modified code of PWMFunctions.ino that i need?

So we need to adjust the code to work with different prescaler from 245Hz and above mine code and when you enter frequency lower than 245Hz to have a 256 prescaler. Please do this for me to teach me how.

nikosg: Please do this for me to teach me how.

HA! Funny. :) If writing code for you would teach you how to do it, you would already have learned from the code you have what all the timer registers you are using do and how to set the prescale when appropriate. Just look in the datasheet to learn how. Hint: To get the maximum precision in your frequency settings, use the lowest prescale setting that allows you to get to the frequency you want.