AVR TIMER_COUNTER_0
Salve a tutti,
stavo scrivendo un codice assembly su avr studio e ho un dubbio sul settaggio d alcuni registri: dovrei realizzare un contatore di 10s (la freq. interna del mcu è d 4 MHz) , secondo voi va bene questo codice? Vi posto la label:
WAIT_10S:
ldi temp , 0
out TCNT0 , temp
ldi temp , 0b00001010
out OCR0 , temp
ldi temp , (1 << FOC0) | (0 << WGM00) | (1 << WGM01) | ( 1 << CS02) | ( 0 << CS01) | (1 << CS00) | ( 0 << COM00) | ( 0 << COM01)
out TCCR0 , temp
In base al datasheet (atmega8535) ho settato i bit dei reg TCCR0 , TCNT0 , OCR0 in questo modo , simulando il codice non m da errori, ma come faccio a capire ke effettivamente conta realmente 10s?
stavo scrivendo un codice assembly su avr studio e ho un dubbio sul settaggio d alcuni registri: dovrei realizzare un contatore di 10s (la freq. interna del mcu è d 4 MHz) , secondo voi va bene questo codice? Vi posto la label:
WAIT_10S:
ldi temp , 0
out TCNT0 , temp
ldi temp , 0b00001010
out OCR0 , temp
ldi temp , (1 << FOC0) | (0 << WGM00) | (1 << WGM01) | ( 1 << CS02) | ( 0 << CS01) | (1 << CS00) | ( 0 << COM00) | ( 0 << COM01)
out TCCR0 , temp
In base al datasheet (atmega8535) ho settato i bit dei reg TCCR0 , TCNT0 , OCR0 in questo modo , simulando il codice non m da errori, ma come faccio a capire ke effettivamente conta realmente 10s?