added comment bout channel A
This commit is contained in:
@@ -71,7 +71,7 @@ int main() {
|
||||
|
||||
TCCR1A |= (1 << COM1A0); // 14.3.1 : set Compare Output with COM1A0, it toggles OC1A on compare match (Table 16-1), OC1A is alternate function for PORTB1 (Table 14-3)
|
||||
|
||||
OCR1A = TIME_MS(PERIOD); // Table 16-4 : set CTC compare value, the counter is cleared to zero when the counter value (TCNT1) matches the OCR1A register
|
||||
OCR1A = TIME_MS(PERIOD); // Table 16-4 : set CTC compare value on channel A, the counter is cleared to zero when the counter value (TCNT1) matches the OCR1A register
|
||||
|
||||
TCCR1B |= (PRESCALE_SET(PRESCALE_VALUE));
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ int main() {
|
||||
|
||||
ICR1 = TIME_MS(PERIOD); // Table 16-4 : set the period (compare TOP value)
|
||||
|
||||
OCR1A = TIME_MS(PERCENT(DUTY_CYCLE, PERIOD)); // 16.9.3 : set the duty cycle to DUTY_CYCLE% of the time -> OC1A (alternate function of PORTB1, aka LED2) is cleared when TCNT1 (the counter value) equals OCR1A
|
||||
OCR1A = TIME_MS(PERCENT(DUTY_CYCLE, PERIOD)); // 16.9.3 : set the duty cycle to DUTY_CYCLE% of the time on channel A -> OC1A (alternate function of PORTB1, aka LED2) is cleared when TCNT1 (the counter value) equals OCR1A
|
||||
|
||||
TCCR1B |= (PRESCALE_SET(PRESCALE_VALUE)); // start the timer with the prescaler
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ int main() {
|
||||
|
||||
ICR1 = TIME_MS(PERIOD); // Table 16-4 : set the period (compare TOP value)
|
||||
|
||||
OCR1A = TIME_MS(PERCENT(DUTY_CYCLE, PERIOD)); // 16.9.3 : set the duty cycle to DUTY_CYCLE% of the time -> OC1A (alternate function of PORTB1, aka LED2) is cleared when TCNT1 (the counter value) equals OCR1A
|
||||
OCR1A = TIME_MS(PERCENT(DUTY_CYCLE, PERIOD)); // 16.9.3 : set the duty cycle to DUTY_CYCLE% of the time in channel A -> OC1A (alternate function of PORTB1, aka LED2) is cleared when TCNT1 (the counter value) equals OCR1A
|
||||
|
||||
TCCR1B |= (PRESCALE_SET(PRESCALE_VALUE)); // start the timer with the prescaler
|
||||
|
||||
|
||||
Reference in New Issue
Block a user