added comment bout channel A

This commit is contained in:
hugogogo
2025-03-07 12:07:56 +01:00
parent f0566e8bde
commit 444925be21
4 changed files with 5 additions and 4 deletions

View File

@@ -132,6 +132,7 @@ void uart_printstr(const char* str) {
}
// print hello world, on serial port, every 2 seconds, with empty infinite loop
// `screen /dev/ttyUSB0 115200`
int main() {
uart_init();
@@ -141,7 +142,7 @@ int main() {
TIMSK1 |= (1 << OCIE1A); // Enable CTC interrupt
sei(); // Enable global interrupts
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)); // 16.4 : set timer according to prescale value, in register TCCR1B, table 16-5 : prescale sets