summaryrefslogtreecommitdiff
path: root/analog
diff options
context:
space:
mode:
authorGuillaume Chevillot2008-03-13 22:14:56 +0100
committerGuillaume Chevillot2008-03-13 22:14:56 +0100
commita0c34f97eec1773195e2b9cf400696d2f91c9ebf (patch)
tree9744a1acff69ec2e70a226269b536ed3e6c356e3 /analog
parent9290d7eed268d4bd96829dcbae839b5d6b11dad1 (diff)
Fixed current limit PWM generation
Diffstat (limited to 'analog')
-rw-r--r--analog/motor-power-avr/src/mp_pwm_LR_.c3
-rw-r--r--analog/motor-power-avr/src/mp_pwm_LR_.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/analog/motor-power-avr/src/mp_pwm_LR_.c b/analog/motor-power-avr/src/mp_pwm_LR_.c
index c35dc5df..d1aec12d 100644
--- a/analog/motor-power-avr/src/mp_pwm_LR_.c
+++ b/analog/motor-power-avr/src/mp_pwm_LR_.c
@@ -38,6 +38,9 @@ void init_curLim (void) {
curLim_bat = CURLIM_MAX;
curLim_temp = CURLIM_MAX;
+ // Enable outputs
+ DDRD |= 0x30;
+
// Configure and run current limit PWM
TCCR1A = TCCRA_LR_CFG;
TCCR1B = TCCRB_LR_CFG;
diff --git a/analog/motor-power-avr/src/mp_pwm_LR_.h b/analog/motor-power-avr/src/mp_pwm_LR_.h
index b8c6887f..55ffc575 100644
--- a/analog/motor-power-avr/src/mp_pwm_LR_.h
+++ b/analog/motor-power-avr/src/mp_pwm_LR_.h
@@ -111,7 +111,7 @@
/** Defines timer control register for current limitation PWM (both side)
* toggle OC1x on compare, fast 8bit PWM mode, no prescaling */
#define TCCRA_LR_CFG (regv (COM1A1, COM1A0, COM1B1, COM1B0, FOC1A, FOC1B, WGM11, WGM10, \
- 0, 1, 0, 1, 0, 0, 0, 1))
+ 1, 0, 1, 0, 0, 0, 0, 1))
#define TCCRB_LR_CFG (regv (ICNC1, ICES1, 5, WGM13, WGM12, CS12, CS11, CS10, \
0, 0, 0, 0, 1, 0, 0, 1))