changed pwm settings, added standby mode

Fri, 12 May 2017 15:43:43 +0200

author
Malte Di Donato <mdd@neo-soft.org>
date
Fri, 12 May 2017 15:43:43 +0200
changeset 1
d224ff5c155b
parent 0
bdcf2c76d86e
child 2
114e1283d03a

changed pwm settings, added standby mode

.hgignore file | annotate | diff | comparison | revisions
firmware/main.c file | annotate | diff | comparison | revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Fri May 12 15:43:43 2017 +0200
@@ -0,0 +1,5 @@
+syntax: glob
+
+*.elf
+*.hex
+*.o
\ No newline at end of file
--- a/firmware/main.c	Fri May 12 15:33:22 2017 +0200
+++ b/firmware/main.c	Fri May 12 15:43:43 2017 +0200
@@ -51,7 +51,7 @@
     TCCR1A = (1<<WGM10)|(1<<COM1A1)   // Set up the two Control registers of Timer1.
             |(1<<COM1B1);             // Wave Form Generation is Fast PWM 8 Bit,
     TCCR1B = (1<<WGM12)     // OC1A and OC1B are cleared on compare match
-            |(1<<CS10);               // and set at BOTTOM. Clock Prescaler is 1024.
+            |(1<<CS11);               // and set at BOTTOM. Clock Prescaler is 1024.
 
 
     uint8_t i;
@@ -74,13 +74,13 @@
 
     switch (mode) {
         case 1: 
-            OCR1A = 63;                       // Dutycycle of OC1A = 25%
+            OCR1A = 40;                       // Dutycycle of OC1A = 25%
             break;
         case 2: 
-            OCR1A = 127;                       // Dutycycle of OC1A = 50%
+            OCR1A = 110;                       // Dutycycle of OC1A = 50%
             break;
         case 3: 
-            OCR1A = 189;                       // Dutycycle of OC1A = 75%
+            OCR1A = 160;                       // Dutycycle of OC1A = 75%
             break;
         case 4: 
             OCR1A = 255;                       // Dutycycle of OC1A = 100%
@@ -111,7 +111,7 @@
                 if (mode < 4) {
                     mode++;
                 } else {
-                    mode = 1;
+                    mode = 0;
                 }
                 led(mode);
                 pwm_update();

mercurial