| Electronic Components Datasheet Search |
|
DFR0126 Datasheet(PDF) 4 Page - DFROBOT |
|
|
|||||||||||||||||||||||||||||
DFR0126 Datasheet(HTML) 4 Page - DFROBOT |
|
4 / 9 page ![]() CVAVR Code: using atmega128 (clock 16Mhz), usart0 (9600 baud rate), timer1 (scale clock 1024), adc. formula timer1 when use clock freq 16Mhz Ttimer1 = Periode Timer1 TCNT1 = Register Timer1 N = Scale clock (1, 8, 64, 256 dan 1024) Tosc = Periode clock Fosc = Frekuensi clock cristal Tosc = 1/Fosc Tosc = 1/16Mhz = 0,0000000625 Ttimer1 = Tosc * (65536 - TCNT1) * N 1 (second) = 0,0000000625 * (65536 - TCNT1) * 1024 TCNT1 = 49911 TCNT1 = C2F7 (in hex) <-- this use in //Timer 1 overflow interrupt service routine Clock value = Fosc/N Clock value = 16Mhz/1024 = 15,625 kHz <-- this use in clock value timer1 Can use timer0 or other timer with each formula /***************************************************** Chip type : ATmega128 Program type : Application Clock frequency : 16,000000 MHz Memory model : Small External SRAM size : 0 Data Stack size : 1024 *****************************************************/ int sec, band, freq[7], i; unsigned long int time_a, time_b; int stat = 0; #include <mega128.h> #include <stdio.h> |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |