Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to make an oscillator for AM Radio with Arduino?

Status
Not open for further replies.

sr13579

Member
Is it possible to make an oscillator for AM radio with Arduino UNO R3?
What should be the code?
How am I supposed to make a full wave square wave oscillator with Arduino?
 
Looks like no one has answered. Maybe you need to do some research.
AM radio: What frequency range? ____Khz. to ____Khz.
Arduino UNO R3: What computer? ATmega328 is that right?
What clock frequency? 16mhz or 20mhz?
We have 16mhz and need 1mhz. So we need to divide by 16. (what other numbers will work? 15? 14?)
Get data sheet on the ATmega328. (What counters does hit have?) 8 bit and 16 bit
Get data sheet on ATmega328 counter timers. (can you do a divide by 16?)
Read; What counters are used for UART? What counters are unused that you can play with?
Do an internet search for "Arduino UNO counters timers". Look for utube videos and help examples.
I have seen examples for making audio tones. 1khz, 2khz There are examples to make music, and make "beep". If you can find the "beep" then you can change the code to make 1mhz. (1000 faster)
I think some "beep" examples they are using "pin high, pin low". This will never work at 1mhz. You need to use a counter in hardware. (this will not use any CPU power)

Please report back when you find some answers. If you can not find an answer ask more questions.
 
At frequencies about 1MHz it wouldn't work with an hardware Timer.
The possible frequency steps are to big, because only whole dividing steps are possible eg 20MHz/16, 20Mhz/15 and so on.
A software solution would eventually play in assembler, but the Controller would only work in the frequency generation loop.
But at all this solutions a rectangular signal will be generated.
I think the possible steps are to big too.
I would suggest You to use an additional DDS Generator Chip - Look at the Analog Devices Page.
They are simple to steer have a wide frequency range and make rather little frequency steps.
And after the Filter the sine looks very smooth.
A Chip for such low frequencies about 1MHz isn't too expensive.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top