Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Forum / Re: Faster Than A Blink on: December 24, 2009, 12:02:46 pm
Hello, Just as an added note: I was also directed to a tutorial on timer 1. The following code worked well with my Deumilanova. I was able to get an on time of about 1 us and off of about 10 us. I think I'll be able to find what I need to operate with from this. I didn't want to post this on the other forum link because they all probably know about it already and I didn't want to interrupt with my amateur remarks.
DadHav/JohnH

/*
 *  Timer1 library example
 *  June 2008 | jesse dot tane at gmail dot com
 */

#include "TimerOne.h"

void setup()
{
  pinMode(10, OUTPUT);
  Timer1.initialize(10);         // initialize timer1, and set a 1000000= 1 second period
  Timer1.pwm(9, 100);                // setup pwm on pin 9, 512=50% duty cycle
  Timer1.attachInterrupt(callback);  // attaches callback() as a timer overflow interrupt
}

void callback()
{
  digitalWrite(10, digitalRead(10) ^ 1);
}

void loop()
{
  // your program here...
}

Merry Christmas Everyone!
2  Forum 2005-2010 (read only) / Forum / Re: Faster Than A Blink on: December 23, 2009, 08:36:29 am
Thank you Gentlemen. I'll look into both of the suggestions. I'm just discovering how many places there are for help. So much th learn and so little time.
John
3  Forum 2005-2010 (read only) / Forum / Faster Than A Blink on: December 22, 2009, 11:06:23 am
Hello, I'm very new to this technology so please forgive me for what might be an inappropriate question. I'm trying to take a step up from using a 555 timer. I require some rather fast switching speeds. Perhaps a high on time of 50 us. I've tried changing the parameters in the Blinking Diode Sketch but it seems as though I can only do about 1ms high. Is it possible to get a higher frequency with the Arduino Atmega 328? Any help or direction would be appreciated.
DadHav/John H
Pages: [1]