Yes, you can do it, by changing some code in the file wiring.c
. Look in the main
function and in files timer.c
to understand what is done.
file is shared by all your Arduino projects, save a copy before modifications.
If you don't want to modify your wiring.c
file, I think you can do something like this in the Setup
function of your Arduino project :
#define TIMER_CLK_STOP 0x00 ///< Timer Stopped
#define TIMER_CLK_DIV1 0x01 ///< Timer clocked at F_CPU
#define TIMER_CLK_DIV8 0x02 ///< Timer clocked at F_CPU/8
#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64
#define TIMER_CLK_DIV256 0x04 ///< Timer clocked at F_CPU/256
#define TIMER_CLK_DIV1024 0x05 ///< Timer clocked at F_CPU/1024
TCCR1B = (TCCR1B & ~TIMER_PRESCALE_MASK) | TIMER_CLK_DIV8);
I does not test this code ! ! ! But I think it could work. Tell me if it work.