Skip to main content
Arduino

Timeline for Generate 1.7 Mhz with PWM in Uno?

Current License: CC BY-SA 3.0

13 events
when toggle format what by license comment
Jun 28, 2017 at 0:46 history bumped Community Bot This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
May 28, 2017 at 23:55 history bumped Community Bot This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Apr 28, 2017 at 15:10 history edited dda CC BY-SA 3.0
deleted 21 characters in body; edited title; edited body
Apr 28, 2017 at 10:15 answer added Edgar Bonet timeline score: 3
Apr 28, 2017 at 2:00 comment added Chris Stratton Wow, how did I miss 16/9? That's not much worse than 12/7, for a lot less trouble.
S Apr 27, 2017 at 22:13 history suggested Mazaryk CC BY-SA 3.0
Fixed Code formatting
Apr 27, 2017 at 19:43 comment added Gerben You need to set the CS20 bit, not CS21. That way you have no prescaler. Then have it count to 9, like Edgar calculated. So set OCR2A to 8.
Apr 27, 2017 at 19:21 comment added Edgar Bonet You cannot generate 1.7 MHz on an Uno. The closest you can get is 16 MHz / 9 = 1.778 MHz.
Apr 27, 2017 at 19:14 comment added Chris Stratton More realistically, to operate this usefully you'll need the power and voltage amplifier from the intended driver circuit, so why not just take the entire original driver circuit, frequency generator and all, and figure out a way to enable/disable it from the Arduino? Do take appropriate precautions for the voltages which it may generate!
Apr 27, 2017 at 19:13 comment added Chris Stratton You can only divide the clock by an integer, so with a 16 MHz clock the closest you can achieve is 2 MHz. The data sheet will show you how to find the divider ratio register setting (specifically, if the division will be one more than the loaded count, and if there is a prescaler upstream of what you get to divide). If there is no perscaler it would seem like switching the board to a 12 MHz crystal and dividing by 7 might be a fit, but you'll need a custom bootloader.
Apr 27, 2017 at 18:55 review First posts
Apr 27, 2017 at 20:21
Apr 27, 2017 at 18:53 review Suggested edits
S Apr 27, 2017 at 22:13
Apr 27, 2017 at 18:52 history asked Hackeitos CC BY-SA 3.0

AltStyle によって変換されたページ (->オリジナル) /