Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Next, set up a timer at 256 times the frequency you want to produce. This will be used to set the rate at which the table values are read. At each tick of the timer you move to the next value in the table, at the end you wrap around to the start again.
Then set up a faster timer if necessary to generate the PWM pulse periods, at each of the 256 steps mention before, you will load the value from the table into a counter which increments at this rate. When the value is zero, make the PIC pin high, make it low again when the counter value equals the value from the table. Keep repeating this until the next value is read from the table and then use that instead.
Brian.