Author Topic: How to make a function generator with variable duty cycle..  (Read 3130 times)

0 Members and 1 Guest are viewing this topic.

Offline richcj10Topic starter

  • Supporter
  • ****
  • Posts: 201
  • Country: us
I was thinking of using the Tone() fcn of Arduino but can't find out how to alter the duty cycle...
Any suggestions?

Thanks,

rick
 

Offline mwhooker

  • Newbie
  • Posts: 1
Re: How to make a function generator with variable duty cycle..
« Reply #1 on: December 02, 2013, 12:42:51 pm »
You need the arduino duo which can call http://arduino.cc/en/Reference/AnalogWriteResolution

tone() by definition has a 50% duty cycle.

See this article http://arduino.cc/en/Tutorial/DueSimpleWaveformGenerator
 

Offline Six_Shooter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: ca
Re: How to make a function generator with variable duty cycle..
« Reply #2 on: December 02, 2013, 02:55:38 pm »
You need the arduino duo which can call http://arduino.cc/en/Reference/AnalogWriteResolution

tone() by definition has a 50% duty cycle.

See this article http://arduino.cc/en/Tutorial/DueSimpleWaveformGenerator

Am I reading that right, the maximum frequency is 170 Hz? That's not very useful as a function generator. There are tutorials for the Uno that will go to at least 20 kHz, I think I've come across one that will go to 100 kHz.
 

Offline BravoV

  • Super Contributor
  • ***
  • Posts: 7547
  • Country: 00
  • +++ ATH1
Re: How to make a function generator with variable duty cycle..
« Reply #3 on: December 02, 2013, 03:00:03 pm »
See the date of the first post.  :palm:

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: How to make a function generator with variable duty cycle..
« Reply #4 on: December 02, 2013, 10:37:59 pm »
Two options:
- use analogwrite.
- use hardware pwm.
================================
https://dannyelectronics.wordpress.com/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf