Creating sine waves

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

How can I create a sine wave using an atmega328P? Is there any good method (analogue or digital)?

I need to send remote information using FM radio waves or by using PWM.

Thanks in advance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What frequency of sine wave do you want to create? How many bits of resolution do you want? (freq and res are hard to get at the same time). What info do you want to send using FM? text? speech? music?

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One technique is to use PWM and output samples of a sine. The other is to create a DAC output using an R-2R resistor ladder (this method costs 8 pins). The latter can be seen here:

http://www.myplace.nu/avr/minidd...

which produces this:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Or have a look at Jesper's DDS, Found Here .

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC,

Can I be the first to say "SNAP!" ? ;-)

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Or, use a serial DAC to save pins.

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks everyone for your answers!

bobgardner wrote:
What frequency of sine wave do you want to create? How many bits of resolution do you want? (freq and res are hard to get at the same time). What info do you want to send using FM? text? speech? music?

What I want is basically write any characters to an LCD remotely from the computer. Using FM radio waves to communicate with the receiver.

What's the best method you recommend me? I read an article that it was better to use sine waves, instead of an square wave, because of its frequency.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You want to generate FM RF with an AVR? What frequency? It will be illegal in most countries.

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's been a while since we had a Monty Python reference so here goes:
"And now in stereo..."

Quote:
The latter can be seen here:

http://www.myplace.nu/avr/minidd...


Quote:
Or have a look at Jesper's DDS, Found Here .

(From The Man With A Tape-recorder Stuffed Up His Nose which has to be one of MPFC's most brilliant moments! http://www.youtube.com/watch?v=M... )

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Using FM radio waves to communicate with the receiver.

To generate RF, you will need to use a SAW resonator, a synthesizer or DDS.
You then need to choose your modulation FM, PM or AM (or a combination) and work out how to acheive the modulation and then how to demodulate at the receive end.
Reading between the lines, I suspect this might be beyond your capability at this point, so I suggest you buy a solution ie. Xbee http://www.ladyada.net/make/xbee/

There are also cheaper solutions for one way communication using ASK http://www.blitzlogic.com/rf.htm

An alternative is to use one of the ATMEL controllers wth RF support ie AT86RF401

The title of your post does not really suggest what you want to do!

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When you say "FM or PWM", those are not exclusive.

You can send PWM via FM. Easy. You can FM a PWM. Easy.

Do you need wireless communication? Then, use one of those 433MHz receiver/transmitter pairs such as you will find at SparkFun - pretty low cost. 100m or so should work. Send your data as on/off coding (amplitude modulation). There are slightly better ones that transport async serial transparently. Similar frequency and distance.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!