From bbd624a60b48c221535576525bb3ed1594fe3476 Mon Sep 17 00:00:00 2001 From: john stone Date: Wed, 18 Jul 2012 02:34:15 +0200 Subject: [PATCH] testpwmcode --- firmware/main.c | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/firmware/main.c b/firmware/main.c index 8b78f18..4abefea 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -6,6 +6,24 @@ #include "main.h" + +void init_pwm(void){ + + // TCCR1A xx01xx10 + TCCR1A &= ~0b00100001; + TCCR1A |= 0b00000010; + + // TCCR1B xxx11001 + TCCR1B &= ~0b00000110; + TCCR1B |= 0b00011001; + + //PB1 set to output: + DDRB |= 0b10; + + +} + + int main (void) { @@ -22,17 +40,29 @@ int main (void) //reduce power PRR |= (1<