Go Down

Topic: Using an external clock (Read 638 times) previous topic - next topic

csnsc14320

I was wondering how I would go about using an external 1 MHz clock to run certain aspects of the arduino board.

First, what I want to do:

Quote

I have a 1Hz square wave that I would like to add a variable delay between 1 microsecond to 1 second (1,000,000 microseconds).
The idea is this:
- The input 1Hz square wave rises
- After X amount of microseconds (where X is chosen before hand, between 1-1million microseconds), output HIGH.

Basically I want to phase shift the 1Hz signal by a specified time, given by my 1MHz clock rather than the board's clock


Now I have noticed in certain areas of the arduino datasheet (http://www.atmel.com/dyn/resources/prod_documents/doc8161.pdf) that there is some talk about using external clocks and the board's timers/counters. I find those sections somewhat hard to decipher as I have almost no experience in modifying the board. I thought maybe sections 8.1.4 (page 26), 8.8 (page 34), 14.3/16.3, etc. might be a place to start, but I don't completely understand what these functions do.

Is using an external clock for a task like this feasible? Will someon with little experience in altering arduino boards be able to accomplish this? Or would it be better to pursue other microcontrollers with counters I can hook up to the 1 MHz?

Thanks for any help on the matter.

Go Up