Click here to load reader

91208102 Timer Counter

  • View
    23

  • Download
    0

Embed Size (px)

Text of 91208102 Timer Counter

Timer & Counter

Timer & CounterPerbedaan Timer & CounterTimer dan Counter sebenarnya idektik, namun perbedaannya yaitu timer mencacah pulsa dari osilator, sedangkan counter mencacah keadaan tertentu.

Timer/Counter AVR AtMega8bit timer/counter0 dengan PWM16bit timer/counter 18bit timer counter 2 dengan PWM dan pengoperasian asinkron

8bit timer/counter0 dengan PWM

Clock timer counter dapat menggunakan sumber eksternal (T0) maupun internal tergantung pengaturan dari Timer/Counter Control Register (TCCR0).Register 8 bitnya terletak pada TCNT0 (Timer/Counter) dan OCR0 (Output Compare Register)Timer/counter dalam keadaan tidak aktif saaat tidak ada sumber clock yang dipilihBatas kemampuan mencacah dari 0 hingga 255

Block Diagram

Fitur Single Compare Unit Counter Clear Timer on Compare Match (Auto Reload) Glitch-free, Phase Correct Pulse Width Modulator (PWM) Frequency Generator External Event Counter 10-bit Clock Prescaler Overflow and Compare Match Interrupt Sources (TOV0 and OCF0)Mode OperasiNormal ModePaling simple, selalu increement, otomatis restart saat mencacah maksimum(0xFF), Clear Timer on Compare Match (CTC) ModeManipulasi resolusi counter pada OCR0, counter kembali ke nol saat nilainya sama dengan OCR0, Fast PWM ModeMenawarkan pembangkitan PWM berfrekuensi tinggiPhase Correct PWM ModeMenawarkan pembangkitan PWM beresolusi tinggi RegisterBit 7 FOCO : perbandingan kemampuan output Bit 3, 6 WGM01:0: Waveform Generation ModeBit 5:4 COM01:0: Compare Match Output ModeBit 2:0 CS02:0: Clock SelectBit 1 OCIE0: Timer/Counter0 Output Compare Match Interrupt Enable

16bit timer/counter 1

Menggunaka Prosedur khusus saat mengakses 16 bit registerClock timer counter dapat menggunakan sumber eksternal (T1) maupun internal).Batas kemampuan mencacah dari 0 hingga 65535Memiliki mode tambahan Phase and Frequency Correct PWM mode

Block Diagram

Fitur True 16-bit Design (that is, allows 16-bit PWM) Two Independent Output Compare Units Double Buffered Output Compare Registers One Input Capture Unit Input Capture Noise Canceler Clear Timer on Compare Match (Auto Reload) Glitch-free, Phase Correct Pulse Width Modulator (PWM) Variable PWM Period Frequency Generator External Event Counter Four Independent Interrupt Sources (TOV1, OCF1A, OCF1B, and ICF1)ModeNormal ModeClear Timer on Compare Match (CTC) ModeFast PWM ModePhase Correct PWM ModePhase and Frequency Correct PWM mode

Register ABit 7:6 COM1A1:0: Compare Output Mode for Channel ABit 5:4 COM1B1:0: Compare Output Mode for Channel BBit 3 FOC1A: Force Output Compare for Channel ABit 2 FOC1B: Force Output Compare for Channel BBit 1:0 WGM11:0: Waveform Generation Mode

Register BBit 7 ICNC1: Input Capture Noise CancelerBit 6 ICES1: Input Capture Edge SelectBit 5 Reserved BitBit 4:3 WGM13:2: Waveform Generation ModeBit 2:0 CS12:0: Clock Select

8bit timer/counter 2 dengan PWM dan pengoperasian asinkron

Clock timer counter dapat menggunakan sumber eksternal (T2) maupun internal.Ataupun diatur secara asinkron melalui TOSC1/2 pin Pengoperasian secara asinkron diatur oleh Asynchronous Status Register (ASSR)Register 8 bitnya terletak pada TCNT2 (Timer/Counter) dan OCR2 (Output Compare Register)Batas kemampuan mencacah dari 0 hingga 255

Block Diagram

Fitur Single Compare unit Counter Clear Timer on Compare Match (Auto Reload) Glitch-free, Phase Correct Pulse Width Modulator (PWM) Frequency Generator 10-bit Clock Prescaler Overflow and Compare Match Interrupt Sources (TOV2 and OCF2) Allows clocking from External 32 kHz Watch Crystal Independent of the I/O ClockOperasi Asinkron ASSRBit 3 AS2: Asynchronous Timer/Counter2Bit 2 TCN2UB: Timer/Counter2 Update BusyBit 1 OCR2UB: Output Compare Register2 Update BusyBit 0 TCR2UB: Timer/Counter Control Register2 Update Busy

Search related