Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    1. How did you configure your timer ? 2. The sin() function takes something like 100 µs per call. Commented Jun 12, 2020 at 10:59
  • You could use OCR1B=OCR1A since both are the same. But, assuming the problem is as StarCat said due to the ISR taking to long, I'd look into creating a table of SIN values. Commented Jun 12, 2020 at 11:20
  • A better method would be to generate a simple square wave then filter it into a sine wave. No need to mess with complex calculations or even lookup tables. Commented Jun 12, 2020 at 11:29