Commit ea22b9c0 authored by Sven Greiner's avatar Sven Greiner

Remove PWM prescaler, but add CPU /4 prescaler

Thus effectively double PWM frequency to about 4 kHz.

With 1/256 PWM this is way too fast for the AMC7135. :(
parent aa05164e
#==== Main Options ============================================================= #==== Main Options =============================================================
MCU = attiny13 MCU = attiny13
F_CPU = 4800000 F_CPU = 1200000
#LFUSE = 0x75 #LFUSE = 0x75
#HFUSE = 0xFF #HFUSE = 0xFF
......
...@@ -337,11 +337,14 @@ int main(void) { ...@@ -337,11 +337,14 @@ int main(void) {
run_lvp_check = 0; // Latched flag to run LVP check on next cycle run_lvp_check = 0; // Latched flag to run LVP check on next cycle
#endif // ifdef LOW_VOLTAGE_PROTECTION #endif // ifdef LOW_VOLTAGE_PROTECTION
// Fast PWM, system clock with /8 prescaler // Fast PWM, system clock with /1 prescaler
// Frequency will be F_CPU/(8*256) = 2343.75 Hz // Frequency will be F_CPU/(1*256) = 4687.5 Hz
// COM0B1 will be set via enable_output() // COM0B1 will be set via enable_output()
TCCR0A = (1 << WGM01) | (1 << WGM00); TCCR0A = (1 << WGM01) | (1 << WGM00);
TCCR0B = (1 << CS01); TCCR0B = (1 << CS00);
CLKPR = (1 << CLKPCE);
CLKPR = (1 << CLKPS1);
// Enable watchdog interrupt // Enable watchdog interrupt
WDTCR = (1 << WDTIE) | (1 << WDP2); WDTCR = (1 << WDTIE) | (1 << WDP2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment