Go for the Gutter

What would be the harm in my participating in, say, a sing-along, so long as the group is large enough to put my voice out of their misery? And who’s to care whether my bowl of apples looks like a…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




One MHz sine wave with ATmega32A

Following picture shows ATmega32A on breadboard with Low Pass filter made up of 22uH inductor and 1nF capacitor for filtering the square wave. Also picture shows frequency counter measuring the frequency of signal from the filter output. Here Arduino Nano is used as frequency counter.

The following shows the schematic diagram of generate 1MHz sine wave.

In the schematic diagram a LC low pass filter made of up 22uH and 1nF is connected to the OC0 pin(Port B pin 3) of the ATmega32 microcontroller. The cutoff frequency of this LC LPF is 1.1MHz.

The C program code for generating this 1MHz using CTC(Clear Timer on Compare) mode with toggle is below.

The C program is very easy, we just load the OCR0 register with 1 and configure the Timer0 to use CTC mode and toggle mode.

The following video is demonstration.

Add a comment

Related posts:

4 Things You Need to Do When You Get a New Style of Fashion Shoes

Getting a new pair of shoes can be a big commitment. And if they aren’t the style you usually wear, there’s going to be a transition phase where you get used to the look. After this period is over…

How Tough Are You?

You share your goal with someone only to have them tell you, “Do you really think you’re good enough to ___?” (fill in the blank) As you are waiting for your chance at that audition/interview/or…

The End of Trump? Fat Chance

Following the attempted overturn of an American election that has lasted months and climaxed with an attack on the capitol January 6th, many are saying Trump’s time is up. Spoiler alert: they’re…