Ústav radioelektroniky. Pomocné obvody a základní periférie

Size: px
Start display at page:

Download "Ústav radioelektroniky. Pomocné obvody a základní periférie"

Transcription

1 Ústav radioelektroniky Vysoké učení technické v Brně Pomocné obvody a základní periférie mikrokontrolérů Mikroprocesorová technika, přednáška č. 5 Ing. Frýza Tomáš, Ph.D. 14. října 2008

2 Obsah přednášky Funkce, struktura a provedení pomocných obvodů Napájení, hodinový signál, obvod reset Zámkové bity, propojky Vnitřní struktura a využítí základních periféríı Vstupně/výstupní port Čítač/časovač Watchdog časovač Způsoby připojení jednoduchých periferních zařízení Přímé připojení, maticové, pomocí pomocných obvodů Zdroje informací

3 Obsah přednášky Funkce, struktura a provedení pomocných obvodů Napájení, hodinový signál, obvod reset Zámkové bity, propojky Vnitřní struktura a využítí základních periféríı Vstupně/výstupní port Čítač/časovač Watchdog časovač Způsoby připojení jednoduchých periferních zařízení Přímé připojení, maticové, pomocí pomocných obvodů Zdroje informací

4 Pomocné obvody řídicí aplikace Není vždy nutné využívat výkonné mikrokontroléry. U jednoduchých aplikací postačí např. ATtiny12 (pouzdro PDIP8). Jednoduché řídicí aplikace s mikrokontroléry vyžadují (po hardwarové stránce) Zdroj napájení, Zdroj hodinového signálu, Resetovací obvod. Obrázek: Blokové zapojení řídicí aplikace

5 Pomocné obvody řídicí aplikace, pokračování Typ napájení závisí na mobilní/desktopové aplikaci Napájení z bateríı, z rozvodné sítě s transformací, z datových portů PC (RS-232, USB), pomocí solárních panelů,... Hodinový signál procesoru řídí časování AVR jádra. Od něho jsou odvozeny časovací signály pro všechny periférie (Flash, A/D převodník, I/O modul, čítač,...). Možnosti generování hodinového signálu Externí zdroj hodinového signálu na vstupním pinu XTAL1, Vnější RC oscilátor: RC oscilátor způsobuje nízkou časovou přesnost, Interní RC oscilátor: nízká časová přesnost; běžné hodnoty jsou 1, 2, 4 a 8MHz, závislost přesnosti oscilací na napětí, nejsou potřeba žádné externí součástky.

6 Pomocné obvody řídicí aplikace, dokončení Možnosti generování hodinového signálu, pokračování Interní hodinový generátor s externím krystalem: nejrozšířenější varianta; vstupy XTAL1 a XTAL2 představují vstup a výstup invertujícího zesilovače oscilátoru; vyžaduje jen dva kondenzátory (typické hodnoty od 12pF do 22pF). Obrázek: Externí krystal Zdroj hodinového signálu je vybrán na základě tzv. programovatelné propojky (viz. dále). Propojky je možné přeprogramovat. Pozn.: ATmega16 je dodáván s přednastaveným interním RC oscilátorem o frekvenci 1MHz.

7 Reset systému Přerušení reset má nejvyšší prioritu může přerušit již běžící obsluhy všech přerušení, nebo vykonávající program. Události vyvolávající reset systému Úroveň na resetovacím pinu mikrokontroléru je nižší než práh V P OT (Power-on reset threshold), Externí reset: přítomnost nízké úrovně na vstupu Reset Přetečení ochranného časovače watchdog (musí být povoleno), Napájecí napětí má nižší úroveň než práh VBOT (Brown-out reset threshold) (musí být povoleno), Reset pomocí JTAG rozhraní. Reset způsobí opětovný výkon programu od adresy 0x0000 (reset vektor) a slouží k nastavení mikrokontroléru do definovaného (známého) stavu, tj.: Všechny periférie (včetně watchdogu) jsou odpojeny, Všechny paralelní I/O porty jsou nastaveny jako vstupní, Všechna přerušení jsou vypnuta.

8 Generování externího resetu Procesory mají kromě vnitřního resetovacího obvodu, který je závislý na napájecím napětí, také externí resetovací obvod Pomocí tlačítka, Pomocí generátorů resetovacího signálu, kdy je napájecí napětí monitorováno a při jeho poklesu je generován reset impulz. Např.: FM1233A (Fairchild Semiconductor), ADM709 (Analog Devices),..., Ošetření stisku je hardwarově realizováno uvnitř mikrokontroléru, nebo unvitř externího generátoru. Obrázek: Tlačítko Obrázek: Externí generátor reset

9 Time-out reset period Po provedení resetu (opětovné nastavení MCU do definovaného stavu) se spustí zpožd ovací čítač. To umožní ustálení napájecího napětí před samotným výkonem programu. Zpoždění startu výkonu programu po resetu lze nastavit pomocí programovatelných propojek na hodnoty 0; 4,1ms; 65ms (viz. dále). Popis obrázku: Kanál 1: signál na pinu reset, Kanál 2: Výstupní pin portu B (periodické generování 0 a 1). Obrázek: Zpoždění po resetu

10 Obsah přednášky Funkce, struktura a provedení pomocných obvodů Napájení, hodinový signál, obvod reset Zámkové bity, propojky Vnitřní struktura a využítí základních periféríı Vstupně/výstupní port Čítač/časovač Watchdog časovač Způsoby připojení jednoduchých periferních zařízení Přímé připojení, maticové, pomocí pomocných obvodů Zdroje informací

11 Zámkové bity Zámkové bity umožňují uzamknout obsah pamětí Flash i EEPROM. Mikrokontroléry se zpravidla dodávají s nenaprogramovanými zámky. ATmega16 obsahuje tři typy zámků Základní zámek: umožňuje zakázat programovaní Flash i EEPROM, zákaz programování + zákaz verifikace (nelze číst program), nebo deaktivovat zámky (lze programovat, verifikovat), Zámek aplikační části Flash: omezeni použití instrukcí SPM (Store memory program), LPM (Load program memory) a ELPM (Extended load program memory) pro aplikační část Flash, Zámek bootovací části Flash: omezeni použití instrukcí SPM, LPM a ELPM pro bootovací část Flash.

12 Programovatelné propojky Programovatelné propojky (anglicky: fuse bits) upřesňují použití některých periferíı. ATmega16 obsahuje dva byty těchto propojek Povolení/zakázání ladění na čipu, použití rozhraní JTAG (programování + ladění aplikací), použití sériového programování, určení velikosti bootovací sekce ve Flash, volba start-up prodlevy, volba hodinového zdroje,... Fuse OCDEN JTAGEN SPIEN CKOPT EESAVE BOOTSZ1:0 BOOTRST BODLEVEL BODEN SUT1:0 CKSEL3:0 Popis funkce Povolení ladění přímo na čipu Povolení JTAG rozhraní Povolení sériového programování ISP Clock options Možnost uchování EEPROM dat i po smazání čipu Velikost bootovací sekce ve Flash (128 až slov) Vektory přerušení do bootovací sekce Výběr úrovně detekce výpadku napájení (brown-out) Povolení detekce výpadku napájení Výběr start-up prodlevy (0; 4,1ms, 65ms) Výběr zdroje hodinového signálu

13 Bootovací část paměti Flash Programová pamět Flash je rozdělena na dvě části Aplikační část (anglicky: Application section): k uložení aplikace, která se má vykonávat, Bootovací část (anglicky: Boot loader section): zde může být uložen program, který umožňuje přeprogramování aplikační (i bootovací) části Flash, Každá část má odlišnou úroveň zabezpečení, protože existují dvě nastavení zámkových bitů. Velikost bootovací části je nastavitelná pomocí propojky BOOTSZ1:0 na hodnoty 128, 256, 512 nebo pamět ových slov. Je možnost přesunout vektory přerušení do bootovací části.

14 Obsah přednášky Funkce, struktura a provedení pomocných obvodů Napájení, hodinový signál, obvod reset Zámkové bity, propojky Vnitřní struktura a využítí základních periféríı Vstupně/výstupní port Čítač/časovač Watchdog časovač Způsoby připojení jednoduchých periferních zařízení Přímé připojení, maticové, pomocí pomocných obvodů Zdroje informací

15 I/O (paralelní) port I/O port obsahuje vstupně/výstupní piny, které zajišt ují komunikaci s externím světem. Jsou to nejvšestranější I/O zařízení mikrokontroléru. Počty pinů korespondují s použitím mikrokontroléru: 4 I/O piny (RS08KA, Freescale), 6 I/O pinů (ATtiny12, Atmel), 32 I/O pinů (ATmega16, Atmel), 48 I/O pinů (ATmega103, Atmel),... U mikrokontrolérů AVR jsou ke každému obousměrnému I/O portu asociovány 3 I/O (řídicí) registry Směrový registr DDRx (Data Direction Register), Datový (výstupní) registr PORTx (Data Register), Vstupní piny PINx (Port Input Pins), Např. u ATmega16, který obsahuje 4 I/O porty, jsou to: DDRA,...,DDRD, PORTA,...,PORTD, PINA,...,PIND.

16 Řídicí registry I/O portů Obrázek: Řídicí registry I/O portů

17 Ovládání I/O portu Směrový I/O registr DDRxn (x=a,b,c,d; n=0,1,...,7) Hodnota 0 pin je definován jako vstupní, Hodnota 1 pin je definován jako výstupní, V každém I/O portu je možné libovolně kombinovat vstupní/výstupní piny. Směr komunikace pinu lze bezprostředně měnit bez ohledu na ostatní (např. instrukce SBI, CBI). Výstupní I/O registr PORTxn V případě definovaného výstupního pinu, udává hodnota bitu v registru logickou úroveň na pinu. Hodnota 1 (DDRxn=1) pin je na vysoké úrovni, apod., V případě vstupního pinu, udává hodnota bitu v registru aktivaci/deaktivaci pull-up rezistoru. DDRxn PORTxn I/O Popis funkce 0 0 Vstupní Vysoká impedance 0 1 Vstupní Aktivace pull-up rezistoru 1 0 Výstupní Nízká úroveň 1 1 Výstupní Vysoká úroveň

18 Ovládání I/O portu, pokračování Vstupní I/O registr PINxn Hodnota 0 nebo 1 korespondující s úrovní signálu na vstupu, Kopírují se zde také data zapsaná do výstupního registru PORTxn! Každý pin obsahuje přepět ovou ochranu (omezující diody) a možnost připojení pull-up rezistoru. Většina I/O pinů umožňuje kromě klasické I/O komunikace také alternativní funkci. Konkrétní piny jsou tak využívány interními perifériemi. Tabulka: Některé alternativní funkce I/O pinů Pin Alternativa Popis funkce PA7:0 ADC Vstup 10bitového AD převodníku (8 kanálů) PB7:4 SPI Sériová komunikace pomocí SPI PC5:2 JTAG Programovací/ladicí rozhraní JTAG PC1:0 TWI Dvouvodičová sběrnice I2C PD2 INT0 Zdroj externího přerušení 0 PD1:0 USART Vstup/výstup sériové komunikace USART

19 Zapojení jednoho I/O pinu Obrázek: Funkční schéma jednoho I/O pinu (není zakreslen pull-up, přepět ová ochrana, alternativní funkce, synchronizace vstupu)

20 Způsoby nastavení jednotlivých I/O pinů v JSA Pomocí instrukcí sbi (Set bit in I/O register) a cbi (Clear bit in I/O register) sbi ddrb,0x03 ; definice výstupního pinu PB3 sbi ddrb,ddb3 ; definice výstupního pinu PB3 Konstanta DDB3 = 3 určuje index bitu v registru DDRB. Definováno v definičním souboru (m16def.inc). Pomocí kombinace instrukcí ldi (Load immediate) a out (Out port) ldi r16,0b ; definice výstupního pinu PB3 out ddrb,r16 ldi r16,(1<<ddb3) ; definice výstupního pinu PB3 out ddrb,r16 Operace << realizuje bitový posun doleva.

21 Způsoby nastavení jednotlivých I/O pinů v jazyce C Směrový registr DDRB = 0b ; // definice výstup. pinu PB3 DDRB = (1<<DDB3) ; // definice výstup. pinu PB3 Konstanta DDB3 = 3 definována v hlavičkovém souboru (iom16.h), Operace realizuje logický součet. Vstupní, výstupní registry PORTB = (1<<PB7) (1<<PB0) ; // PB7 = PB0 = 1 PORTB = PIND ; // kopírování vstupu na výstup

22 Funkce interního čítače/časovače Každý mikrokontrolér obsahuje periférii umožňující odečítat čas (časovač, anglicky: timer), příp. načítat vstupní pulsy (čítač, anglicky: counter). Toho lze využít k jednoduchým aplikacím Měření krátkých intervalů, periodické spouštění funkce, Konstrukce jednoduchých frekvenčních čítačů,... Obě funkce využívají registr(y), jehož obsah se inkrementuje pomocí hodinového, příp. externího signálu. Lze tak využít 8, 16 bitové čítače/časovače.

23 actual placement of I/O pins, refer to Pinout ATmega16 on page 2. CPU accessible I/O Registers, including I/O bits and I/O pins, are shown in bold. The device-specific I/O Register and bit locations are listed in the 8-bit Timer/Counter Register Description on Blokové schéma 8bitového čítače/časovače 0 page 83. Figure bit Timer/Counter Block Diagram TCCRn count clear direction Control Logic clk Tn Clock Select TOVn (Int.Req.) BOTTOM TOP Edge Detector Tn DATABUS Timer/Counter TCNTn = 0 = 0xFF ( From Prescaler ) OCn (Int.Req.) = Waveform Generation OCn OCRn The Timer/Counter (TCNT0) and Output Compare Register (OCR0) are 8-bit registers. Interrupt request (abbreviated to Int.Req. in the figure) signals are all visible in the Timer Interrupt Flag Register (TIFR). All interrupts are individually masked with the Timer Interrupt Mask Register (TIMSK). TIFR and TIMSK are not shown in the figure since these registers are shared by other timer units. The Timer/Counter can be clocked internally, via the prescaler, or by an external clock source on the T0 pin. The Clock Select logic block controls which clock source and edge the Timer/Counter uses to increment (or decrement) its value. The Timer/Counter is Obrázek: Blokové schéma čitače/časovače 0 (označení n udává číslo čítače)

24 Blokové schéma 8bitového čítače/časovače 0 Čítač/časovač 0 je 8bitový registr schopen inkrementovat (dekrementovat) svou hodnotu. K č/č 0 lze přistupovat pomocí registrů TCNT0 (Timer/Counter0) - datová hodnota čítače/časovače 0, OCR0 (Output Compare Register) hodnota pro neustálé porovnávání s TCNT0, TCCR0 (Timer/Counter Control Register) řídicí registr. Např. nastavení hodnoty předděličky. Možnost generování přetečení Při přetečení č/č (dosažení maximální hodnoty a znovu návrat k 0), Při rovnosti hodnoty datového registru s komparačním.

25 Definitions Many register and bit references in this document are written in general form. A lower case n replaces the Timer/Counter number, in this case 0. However, when using the register or bit defines in a program, the precise form must be used i.e., TCNT0 for Čítač/časovač accessing Timer/Counter0 0, funkce counter value časování, and on. čítání Timer/Counter Clock Sources Counter Unit The definitions in Table 37 are also used extensively throughout the document. Table 37. Definitions Vnitřní signály BOTTOM The counter reaches the BOTTOM when it becomes 0x00. count: MAX inkrementace The counter reaches nebo its MAXimum dekrementace when it becomes 0xFF obsahu (decimal 255). registru TOP The counter reaches the TOP when it becomes equal to the highest TCNT0, value in the count sequence. The TOP value can be assigned to be the direction: fixed výběr value 0xFF mezi (MAX) inkrementací or the value stored in athe dekrementací, OCR0 Register. The assignment is dependent on the mode of operation. clear: nulování všech obsahu TCNT0, The Timer/Counter can be clocked by an internal or an external clock source. The clock clkt 0 hodinový signál č/č 0, source is selected by the clock select logic which is controlled by the clock select BOTTOM (CS02:0) bits located signalizace in the Timer/Counter dosažení Control Register minimální (TCCR0). For hodnoty details on clock sources and prescaler, see Timer/Counter0 and Timer/Counter1 Prescalers on 0x00, TOP page 87. signalizace dosažení nejvyšší hodnoty čítání 0xff nebo hodnoty The main part vof komparačním the 8-bit Timer/Counter registru the programmable OCR0. bi-directional counter unit. Figure 28 shows a block diagram of the counter and its surroundings. Figure 28. Counter Unit Block Diagram DATA BUS TOVn (Int. Req.) Clock Select TCNTn count clear direction Control Logic clk Tn Edge Detector Tn ( From Prescaler ) BOTTOM TOP Signal description (internal signals): Obrázek: Funkce čítání čítače/časovače count Increment or decrement TCNT0 by 1. direction Select between increment and decrement. clear Clear TCNT0 (set all bits to zero). clk Tn Timer/Counter clock, referred to as clk T0 in the following.

26 Čítač/časovač 0, funkce časování, čítání Č/č 0 může být řízen vnitřním zdrojem hodinového signálu (lze zpomalit pomocí předděličky), nebo externím signálem přes pin T0. Tabulka: Nastavení předděličky čítače/časovače 0 (TCCR0) CS02:CS00 Popis 0b000 Hodinový signál odpojen. Čítač/časovač 0 nepracuje 0b001 f CP U 0b010 f CP U /8 0b011 f CP U /64 0b100 f CP U /256 0b101 f CP U / b110 Externí zdroj řídicího signálu, reakce na sestupnou hranu 0b111 Externí zdroj řídicího signálu, reakce na náběžnou hranu Doba přetečení 8bitového časovače t OV F = 1 N je hodnota předděličky. f CP U N 2 8, kde

27 Timer/Counter Timing Diagrams operation. The figure shows the count sequence close to the MAX value in all modes The other Timer/Counter than phase correct is a PWM synchronous mode. design and the timer clock (clk T0 ) is therefore shown as a clock enable signal the following figures. The figures include information on Figure when 34. Interrupt Timer/Counter Flags are Timing set. Figure Diagram, 34 contains Prescaling timing data for basic Timer/Counter Význam předděličky operation. The figure shows hodinového the count sequence close to the MAX signálu value in all modes other than phase correct PWM mode. clk Figure I/O 34. Timer/Counter Timing Diagram, no Prescaling clk Tn (clk clk I/O /1) I/O TCNTn clk Tn MAX - 1 MAX BOTTOM BOTTOM + 1 (clk I/O /1) TOVn TCNTn MAX - 1 MAX BOTTOM BOTTOM + 1 Figure TOVn35 shows the same timing data, but with the prescaler enabled. Figure 35. Timer/Counter Timing Diagram, with Prescaler (f clk_i/o /8) Figure 35 shows the same timing data, but with the prescaler enabled. clk I/O Figure 35. Timer/Counter Timing Diagram, with Prescaler (f clk_i/o /8) clk Tn (clk clk I/O /8) I/O TCNTn clk Tn MAX - 1 MAX BOTTOM BOTTOM + 1 (clk I/O /8) TOVn TCNTn MAX - 1 MAX BOTTOM BOTTOM + 1 Figure TOVn36 shows the setting of OCF0 in all modes except CTC mode. Obrázek: Rozdíl mezi rychlostí čítání bez předděličky a při N = 8 Figure 36 shows the setting of OCF0 in all modes except CTC mode.

28 priority over) all counter clear or count operations. The counting sequence is determined by the setting of the WGM01 and WGM00 bits Čítač/časovač located 0, in the funkce Timer/Counter Control porovnávání Register (TCCR0). There are close connections (komparace) between how the counter behaves (counts) and how waveforms are generated on the Output Compare output OC0. For more details about advanced counting sequences and waveform generation, see Modes of Operation on page 76. The Timer/Counter Overflow (TOV0) Flag is set according to the mode of operation Obsah registru selected by OCR0 the WGM01:0 jebits. neustále TOV0 can be used for porovnáván generating a CPU interrupt. s TCNT0. Output Compare Unit The 8-bit comparator continuously compares TCNT0 with the Output Compare Register Jestliže se obsahy (OCR0). Whenever obou TCNT0 equals registrů OCR0, the comparator rovnají, signals a match. lze A match generovat will set the Output Compare Flag (OCF0) at the next timer clock cycle. If enabled (OCIE0 = 1 and Global Interrupt Flag in SREG is set), the Output Compare Flag generates an output compare interrupt. je řádně The OCF0 Flag povoleno). is automatically cleared when the interrupt přerušení (pokud is executed. Alternatively, the OCF0 Flag can be cleared by software by writing a logical one to its I/O bit location. The waveform generator uses the match signal to generate an Komparace output lzeaccording snadno to operating využít mode set by the ke WGM01:0 generování bits and Compare Output signálů, např. mode (COM01:0) bits. The max and bottom signals are used by the waveform generator for handling the special cases of the extreme values in some modes of operation (See pulsně šířkovou Modes of Operation modulaci on page 76.). (PWM - Pulse Width Modulation). Figure 29 shows a block diagram of the output compare unit. Figure 29. Output Compare Unit, Block Diagram DATA BUS OCRn TCNTn = (8-bit Comparator ) OCFn (Int.Req.) top bottom FOCn Waveform Generator OCn WGMn1:0 COMn1:0 2466M AVR 04/06 Obrázek: Funkce porovnávání čítače/časovače 73

29 Čítač/časovač 0, funkce generováni PWM Informace je PWM signálem přenášena proměnnou střídou obdélníkového signálu. Princip činnosti Přetečení Figure 32. Fast časovače: PWM Mode, vysoká Timing úroveň Diagramgenerovaného signálu (začátek periody), OCRn Interrupt Flag Set Při rovnosti registrů TCNT0 a OCR0: nízká úroveň (lze spouštět přerušení). OCRn Update and TOVn Interrupt Flag Set TCNTn OCn (COMn1:0 = 2) OCn (COMn1:0 = 3) Period The Timer/Counter Overflow Flag (TOV0) is set each time the counter reaches MAX. If the interrupt Obrázek: is enabled, Funkce the interrupt generování handler signálu routine can PWM be used for updating the compare value. In fast PWM mode, the compare unit allows generation of PWM waveforms on the OC0

30 Obvod watchdog Obvod watchdog je bezpečnostní časovač. Jeho význam je vyvolat reset (a tím i znovu-nastartování) mikrokontroléru v případě, že se procesor ztratí, příp. nevykonává program, který by měl. K resetu (generování krátkého pulzu) dojde v případě přetečení watchdog časovače. Opět se provádí zpoždění výkonu programu (Time-out period). Watchdog má oddělený hodinový systém, jehož frekvence je závislá na napájení; V CC =5V f W DT =1MHz. Běžný chod programu: program opakovaně znovunačítá, příp. resetuje stav časovače a tím nedojde k přetečení jeho hodnoty. V případě ztráty programu, zacyklení, apod. dojde k přetečení a k vyvolání resetu.

31 tchdog Timer is clocked from a separate On-chip Oscillator which runs at 1 is is the typical value at V CC = 5V. See characterization data for typical values at C levels. Watchdog By controlling the periférie Watchdog Timer prescaler, the Watchdog Reset can be adjusted as shown in Table 17 on page 43. The WDR Watchdog Reset tion resets the Watchdog Timer. The Watchdog Timer is also reset when it is and when a Chip Reset occurs. Eight different clock cycle periods can be to determine the reset period. If the reset period expires without another g Reset, the ATmega16 resets and executes from the Reset Vector. For timing n the Watchdog Reset, refer to page 41. nt unintentional disabling of the Watchdog, a special turn-off sequence must be when the Watchdog is disabled. Refer to the description of the Watchdog Timer Register for details. 1. Watchdog Timer Funkce watchdog časovače je běžně vypnuta, tj. není potřeba se obávat nechtěného resetu systému. Povolení generace resetu MCU a nastavení předděličky je řízeno řídicím registrem WDTCR (Watchdog Timer Control Register). WATCHDOG OSCILLATOR Tabulka: Rychlost čítání watchdogu (WDTCR) Obrázek: Struktura Watchdogu 2466M AVR 04/06 WDP2:WDP0 Přetečení (V CC =5V) 0b000 16ms 0b001 33ms 0b010 65ms 0b ms 0b ms 0b ms 0b110 1s 0b111 2,1s

32 Ukázka využití watchdogu v jazyce C Popis aplikace Aplikace čeká na stisk tlačítka na pinu PD0, Poté se povoĺı watchdog, nastaví se nejdelší doba přetečení (cca 2,1s) a rozsvítí se včechny LED diody na portu B, Z nekonečné smyčky se vyskočí až po přetečení watchdog časovače. Použité příkazy/instrukce wdr - nulování watchdogu, Watchdog Reset.

33 Ukázka využití watchdogu v jazyce C #include <avr/io.h> int main( void ) { DDRD = 0x00 ; DDRB = 0xff ; PORTB = 0xff ; // hlavičkový soubor pro mikrokontrolér ATmega16 // deklarace vstupního portu D // deklarace výstupního portu B // zhasnutí všech LED diod loop_until_bit_is_clear( PIND, 0 ) ; // zacyklení dokud není stisknuto tlačítko PD0 WDTCR = (1<<WDE) (1<<WDP2) (1<<WDP1) (1<<WDP0) ; // povolení watchdog časovače a nastavení // doby čekání na cca 2,1s asm( "wdr" ) ; // reset stavu časovače watchdog PORTB = 0x00 ; // rozsvícení všech LED diod } while( 1 ) ; // nekonečná smyčka

34 Obsah přednášky Funkce, struktura a provedení pomocných obvodů Napájení, hodinový signál, obvod reset Zámkové bity, propojky Vnitřní struktura a využítí základních periféríı Vstupně/výstupní port Čítač/časovač Watchdog časovač Způsoby připojení jednoduchých periferních zařízení Přímé připojení, maticové, pomocí pomocných obvodů Zdroje informací

35 Připojení externích periféríı Připojení externích periféríı (tlačítko, LED, klávesnice,...) je obecně možné realizovat třemi způsoby 1) Přímé připojení: jeden I/O pin je využit k připojení jednoho jednoduchého zařízení (tlačítko, LED,...), 2) Maticové uspořádání: několik jednoduchých zařízení je uspořádáno do matice, což snižuje počet potřebných I/O pinů (maticová klávesnice), 3) Pomocí pomocných obvodů: externí zařízení pracuje nezávisle na řídicím mikrokontroléru. V případě události generuje požadavek na přerušení, které zajistí načtení/vyslání potřebných dat.

36 Jednoduché ošetření zákmitů mechanického tlačítka Při sepnutí mechanického tlačítka dochází k zákmitům (nechtěné impulsy způsobující nekorektní výkon programu). Tyto zákmity je nutné vždy ošetřit! Možný způsob ošetření: Při stisku i uvolnění tlačítka je volána funkce realizující zpoždění, Po stisku se testuje, zda již bylo tlačítko uvolněno, teprve pak se pokračuje ve výkonu programu, V rámci první zpožd ovací smyčky (tj. při sepnutí) je možné realizovat pípnutí reproduktoru, apod. (Pípnutí je reprezentováno vysíláním obdélníkového signálu o určité frekvence).

37 Použití maticové klávesnice Maticová klávesnice 4 4 využívá jeden I/O port 4 piny jsou definovány jako vstupní (např. PB3-PB0), 4 piny jsou výstupní (např. PB7-PB4). Zjištění stisknuté klávesy se provádí tzv. skenováním klávesnice, kdy jsou ve čtyřech krocích vyslány hodnoty na výstupní piny 1) PB7:4 = 0b1110, 2) PB7:4 = 0b1101, 3) PB7:4 = 0b1011, 4) PB7:4 = 0b0111. Po každém kroku se skenují vstupní piny. Pokud je některý roven 0, bylo stisknuto příslušné tlačítko.

38 Obsah přednášky Funkce, struktura a provedení pomocných obvodů Napájení, hodinový signál, obvod reset Zámkové bity, propojky Vnitřní struktura a využítí základních periféríı Vstupně/výstupní port Čítač/časovač Watchdog časovač Způsoby připojení jednoduchých periferních zařízení Přímé připojení, maticové, pomocí pomocných obvodů Zdroje informací

39 Zdroje informací Matoušek, D. Práces mikrokontroléry ATMEL AVR; ATmega16. Ben technická literatura, Praha, 2006, ISBN Barnett, R., O Cull, L., Cox, S. Embedded C Programming and the Atmel AVR, 2e. Thomson Delmar Learning, New York, 2007, ISBN Barnett, R., O Cull, L., Cox, S. Embedded C Programming and the Atmel AVR, 2e. Thomson Delmar Learning, New York (USA), 2006, ISBN Gadre, D.V. Programming and Customizing the AVR Microcontroller. McGraw Hill, New York (USA), 2001, ISBN X.

40 Zdroje informací Atmel Corporation. AVR Assembler User Guide, (říjen 2007). DOC1022.PDF Atmel Corporation. ATmega16, (říjen 2007). asp?part_id=2010 C library for use with GCC on AVR. AVR Libc Home Page, (říjen 2007).

AVR Timer/Counter. Prof Prabhat Ranjan DA-IICT, Gandhinagar

AVR Timer/Counter. Prof Prabhat Ranjan DA-IICT, Gandhinagar AVR Timer/Counter Prof Prabhat Ranjan DA-IICT, Gandhinagar 8-bit Timer/Counter0 with PWM Single Compare Unit Counter Clear Timer on Compare Match (Auto Reload) Glitch-free, Phase Correct Pulse Width Modulator

More information

ET-BASE AVR ATmega64/128

ET-BASE AVR ATmega64/128 ET-BASE AVR ATmega64/128 ET-BASE AVR ATmega64/128 which is a Board Microcontroller AVR family from ATMEL uses MCU No.ATmega64 and ATmega128 64PIN. Board ET-BASE AVR ATmega64/128 uses MCU s resources on

More information

8-bit Microcontroller with 2K Bytes Flash. ATtiny26 ATtiny26L

8-bit Microcontroller with 2K Bytes Flash. ATtiny26 ATtiny26L Features High-performance, Low-power AVR 8-bit Microcontroller RISC Architecture 118 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static Operation

More information

8-bit Microcontroller with 1K Bytes In-System Programmable Flash. ATtiny13V ATtiny13

8-bit Microcontroller with 1K Bytes In-System Programmable Flash. ATtiny13V ATtiny13 Features High Performance, Low Power AVR 8-Bit Microcontroller Advanced RISC Architecture 120 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

Application Note. 8-bit Microcontrollers. AVR091: Replacing AT90S2313 by ATtiny2313. Features. Introduction

Application Note. 8-bit Microcontrollers. AVR091: Replacing AT90S2313 by ATtiny2313. Features. Introduction AVR091: Replacing AT90S2313 by ATtiny2313 Features AT90S2313 Errata Corrected in ATtiny2313 Changes to Bit and Register Names Changes to Interrupt Vector Oscillators and Selecting Start-up Delays Improvements

More information

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer Features Real-Time Clock with Very Low Power Consumption (4µA @ 3.3V) Very Low Cost Solution Adjustable Prescaler to Adjust Precision Counts Time,

More information

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT HARDWARE GUIDE This document is part of Turbo Programmer documentation. For Developer Documentation, Applications and Examples, see http:/// PRELIMINARY (C)

More information

APPLICATION NOTE. Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Atmel AVR 8-bit Microcontroller. Introduction.

APPLICATION NOTE. Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Atmel AVR 8-bit Microcontroller. Introduction. APPLICATION NOTE Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer Introduction Atmel AVR 8-bit Microcontroller This application note describes how to implement a real time counter (RTC)

More information

8-bit Microcontroller with 2K Bytes In-System Programmable Flash. ATtiny2313/V. Preliminary

8-bit Microcontroller with 2K Bytes In-System Programmable Flash. ATtiny2313/V. Preliminary Features Utilizes the AVR RISC Architecture AVR High-performance and Low-power RISC Architecture 120 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully

More information

Atmel Norway 2005. XMEGA Introduction

Atmel Norway 2005. XMEGA Introduction Atmel Norway 005 XMEGA Introduction XMEGA XMEGA targets Leadership on Peripheral Performance Leadership in Low Power Consumption Extending AVR market reach XMEGA AVR family 44-100 pin packages 16K 51K

More information

AVR Butterfly Training. Atmel Norway, AVR Applications Group

AVR Butterfly Training. Atmel Norway, AVR Applications Group AVR Butterfly Training Atmel Norway, AVR Applications Group 1 Table of Contents INTRODUCTION...3 GETTING STARTED...4 REQUIRED SOFTWARE AND HARDWARE...4 SETTING UP THE HARDWARE...4 SETTING UP THE SOFTWARE...5

More information

General Porting Considerations. Memory EEPROM XRAM

General Porting Considerations. Memory EEPROM XRAM AVR097: Migration between ATmega128 and ATmega2561 Features General Porting Considerations Memory Clock sources Interrupts Power Management BOD WDT Timers/Counters USART & SPI ADC Analog Comparator ATmega103

More information

8-bit Microcontroller with 16K Bytes In-System Programmable Flash. ATmega162 ATmega162V. Features

8-bit Microcontroller with 16K Bytes In-System Programmable Flash. ATmega162 ATmega162V. Features 查 询 ATMEGA162 供 应 商 Features High-performance, Low-power AVR 8-bit Microcontroller Advanced RISC Architecture 131 Powerful Instructions Most Single-clock Cycle Execution 32 x 8 General Purpose Working

More information

Chapter 13. PIC Family Microcontroller

Chapter 13. PIC Family Microcontroller Chapter 13 PIC Family Microcontroller Lesson 01 PIC Characteristics and Examples PIC microcontroller characteristics Power-on reset Brown out reset Simplified instruction set High speed execution Up to

More information

8-bit Microcontroller with 16K Bytes In-System Programmable Flash. ATmega16 ATmega16L

8-bit Microcontroller with 16K Bytes In-System Programmable Flash. ATmega16 ATmega16L Features High-performance, Low-power Atmel AVR 8-bit Microcontroller Advanced RISC Architecture 131 Powerful Instructions Most Single-clock Cycle Execution 32 x 8 General Purpose Working Registers Fully

More information

AVR134: Real Time Clock (RTC) using the Asynchronous Timer. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR134: Real Time Clock (RTC) using the Asynchronous Timer. 8-bit Microcontrollers. Application Note. Features. 1 Introduction AVR134: Real Time Clock (RTC) using the Asynchronous Timer Features Real Time Clock with Very Low Power Consumption (4 μa @ 3.3V) Very Low Cost Solution Adjustable Prescaler to Adjust Precision Counts

More information

8-bit Atmel with 8KBytes In- System Programmable Flash. ATmega8 ATmega8L

8-bit Atmel with 8KBytes In- System Programmable Flash. ATmega8 ATmega8L Features High-performance, Low-power Atmel AVR 8-bit Microcontroller Advanced RISC Architecture 130 Powerful Instructions Most Single-clock Cycle Execution 32 8 General Purpose Working Registers Fully

More information

STK500... User Guide

STK500... User Guide STK500... User Guide Table of Contents Section 1 Introduction... 1-1 1.1 Starter Kit Features...1-1 1.2 Device Support...1-2 Section 2 Getting Started... 2-1 2.1 Unpacking the System...2-1 2.2 System

More information

PROJECT PRESENTATION ON CELLPHONE OPERATED ROBOTIC ASSISTANT

PROJECT PRESENTATION ON CELLPHONE OPERATED ROBOTIC ASSISTANT PROJECT PRESENTATION ON CELLPHONE OPERATED ROBOTIC ASSISTANT ELECTRONICS ENGINEERING DEPARTMENT SVNIT, SURAT-395007, INDIA Prepared by: Anurag Gupta (U05EC401) Dhrumeel Bakshi (U05EC326) Dileep Dhakal

More information

8-bit Atmel with 8KBytes In- System Programmable Flash. ATmega8 ATmega8L. Summary

8-bit Atmel with 8KBytes In- System Programmable Flash. ATmega8 ATmega8L. Summary Features High-performance, Low-power Atmel AVR 8-bit Microcontroller Advanced RISC Architecture 130 Powerful Instructions Most Single-clock Cycle Execution 32 8 General Purpose Working Registers Fully

More information

8-bit Microcontroller with 8K Bytes In-System Programmable Flash AT90S8515

8-bit Microcontroller with 8K Bytes In-System Programmable Flash AT90S8515 Features Utilizes the AVR RISC Architecture AVR High-performance and Low-power RISC Architecture 118 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General-purpose Working Registers Up

More information

Hello, and welcome to this presentation of the STM32L4 reset and clock controller.

Hello, and welcome to this presentation of the STM32L4 reset and clock controller. Hello, and welcome to this presentation of the STM32L4 reset and clock controller. 1 The STM32L4 reset and clock controller manages system and peripheral clocks. STM32L4 devices embed three internal oscillators,

More information

8-bit Microcontroller with 4/8/16/32K Bytes In-System Programmable Flash. ATmega48PA ATmega88PA ATmega168PA ATmega328P

8-bit Microcontroller with 4/8/16/32K Bytes In-System Programmable Flash. ATmega48PA ATmega88PA ATmega168PA ATmega328P Features High Performance, Low Power AVR 8-Bit Microcontroller Advanced RISC Architecture 131 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

8-bit Microcontroller with 1K Bytes In-System Programmable Flash. ATtiny13A

8-bit Microcontroller with 1K Bytes In-System Programmable Flash. ATtiny13A Features High Performance, Low Power AVR 8-Bit Microcontroller Advanced RISC Architecture 120 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

AVR131: Using the AVR s High-speed PWM. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

AVR131: Using the AVR s High-speed PWM. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE AVR 8-bit Microcontrollers AVR131: Using the AVR s High-speed PWM APPLICATION NOTE Introduction This application note is an introduction to the use of the high-speed Pulse Width Modulator (PWM) available

More information

PWM IN AVR. Developed by: Krishna Nand Gupta Prashant Agrawal Mayur Agarwal

PWM IN AVR. Developed by: Krishna Nand Gupta Prashant Agrawal Mayur Agarwal PWM IN AVR Developed by: Krishna Nand Gupta Prashant Agrawal Mayur Agarwal PWM (pulse width Modulation) What is PWM? Frequency = (1/T) Duty Cycle = (Thigh/T) What is need of PWM? I answer this in respect

More information

A 5 Degree Feedback Control Robotic Arm (Haptic Arm)

A 5 Degree Feedback Control Robotic Arm (Haptic Arm) A 5 Degree Feedback Control Robotic Arm (Haptic Arm) 1 Prof. Sheetal Nirve, 2 Mr.Abhilash Patil, 3 Mr.Shailesh Patil, 4 Mr.Vishal Raut Abstract: Haptics is the science of applying touch sensation and control

More information

8-bit Microcontroller with 2/4/8K Bytes In-System Programmable Flash. ATtiny24 ATtiny44 ATtiny84

8-bit Microcontroller with 2/4/8K Bytes In-System Programmable Flash. ATtiny24 ATtiny44 ATtiny84 Features High Performance, Low Power AVR 8-Bit Microcontroller Advanced RISC Architecture 120 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash. ATtiny25/V / ATtiny45/V / ATtiny85/V. Features

Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash. ATtiny25/V / ATtiny45/V / ATtiny85/V. Features Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash Features High Performance, Low Power AVR 8-Bit Microcontroller Advanced RISC Architecture 120 Powerful Instructions Most Single

More information

ATmega8A. Introduction. Features. 8-bit AVR Microcontroller DATASHEET COMPLETE

ATmega8A. Introduction. Features. 8-bit AVR Microcontroller DATASHEET COMPLETE 8-bit AVR Microcontroller ATmega8A DATASHEET COMPLETE Introduction The Atmel ATmega8A is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing powerful instructions

More information

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA Features Compatible with MCS-51 products On-chip Flash Program Memory Endurance: 1,000 Write/Erase Cycles On-chip EEPROM Data Memory Endurance: 100,000 Write/Erase Cycles 512 x 8-bit RAM ISO 7816 I/O Port

More information

Arbeitskreis Hardware. Prof. Dr. Michael Rohs, Dipl.-Inform. Sven Kratz michael.rohs@ifi.lmu.de MHCI Lab, LMU München

Arbeitskreis Hardware. Prof. Dr. Michael Rohs, Dipl.-Inform. Sven Kratz michael.rohs@ifi.lmu.de MHCI Lab, LMU München Arbeitskreis Hardware Prof. Dr. Michael Rohs, Dipl.-Inform. Sven Kratz michael.rohs@ifi.lmu.de MHCI Lab, LMU München Arbeitskreis Hardware 2 Organization Objective: Learn about embedded interactive systems

More information

AT15007: Differences between ATmega328/P and ATmega328PB. Introduction. Features. Atmel AVR 8-bit Microcontrollers APPLICATION NOTE

AT15007: Differences between ATmega328/P and ATmega328PB. Introduction. Features. Atmel AVR 8-bit Microcontrollers APPLICATION NOTE Atmel AVR 8-bit Microcontrollers AT15007: Differences between ATmega328/P and ATmega328PB APPLICATION NOTE Introduction This application note assists the users of Atmel ATmega328 variants to understand

More information

The Programming Interface

The Programming Interface : In-System Programming Features Program any AVR MCU In-System Reprogram both data Flash and parameter EEPROM memories Eliminate sockets Simple -wire SPI programming interface Introduction In-System programming

More information

Pulse Width Modulation

Pulse Width Modulation Pulse Width Modulation Pulse width modulation (PWM) is a powerful technique for controlling analog circuits with a microprocessor's digital outputs. PWM is employed in a wide variety of applications, ranging

More information

8-bit Microcontroller with 8K Bytes In-System Programmable Flash. ATmega8515 ATmega8515L

8-bit Microcontroller with 8K Bytes In-System Programmable Flash. ATmega8515 ATmega8515L Features High-performance, Low-power AVR 8-bit Microcontroller RISC Architecture 130 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static Operation

More information

8-bit Atmel Microcontroller with 128KBytes In-System Programmable Flash. ATmega128 ATmega128L

8-bit Atmel Microcontroller with 128KBytes In-System Programmable Flash. ATmega128 ATmega128L Features High-performance, Low-power Atmel AVR 8-bit Microcontroller Advanced RISC Architecture 133 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers + Peripheral

More information

ATmega16U4/ATmega32U4

ATmega16U4/ATmega32U4 ATmega6U4/ATmega32U4 8-bit Microcontroller with 6/32 Bytes of ISP Flash and USB Controller DATASHEET Features High Performance, Low Power AVR 8-Bit Microcontroller Advanced RISC Architecture 35 Powerful

More information

8-bit Microcontroller with 32K/64K/128K Bytes of ISP Flash and CAN Controller AT90CAN32 AT90CAN64 AT90CAN128

8-bit Microcontroller with 32K/64K/128K Bytes of ISP Flash and CAN Controller AT90CAN32 AT90CAN64 AT90CAN128 Features High-performance, Low-power AVR 8-bit Microcontroller Advanced RISC Architecture 33 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers + Peripheral

More information

Microcontrollers in Practice

Microcontrollers in Practice M. Mitescu I. Susnea Microcontrollers in Practice With 117 Figures, 34 Tables and CD-Rom 4y Springer Contents Resources of Microcontrollers, 1 1.1 In this Chapter 1 1.2 Microcontroller Architectures 1

More information

ATmega32A. Introduction. Features. 8-bit AVR Microcontroller DATASHEET SUMMARY

ATmega32A. Introduction. Features. 8-bit AVR Microcontroller DATASHEET SUMMARY 8-bit AVR Microcontroller ATmega32A DATASHEET SUMMARY Introduction The Atmel ATmega32A is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing powerful instructions

More information

ATtiny4 / ATtiny5 / ATtiny9 / ATtiny10. Introduction. Feature. Atmel 8-bit AVR Microcontroller with 512/1024 Bytes In-System Programmable Flash

ATtiny4 / ATtiny5 / ATtiny9 / ATtiny10. Introduction. Feature. Atmel 8-bit AVR Microcontroller with 512/1024 Bytes In-System Programmable Flash Atmel 8-bit AVR Microcontroller with 512/1024 Bytes In-System Programmable Flash ATtiny4 / ATtiny5 / ATtiny9 / ATtiny10 DATASHEET COMPLETE Introduction The Atmel ATtiny4/5/9/10 is a low-power CMOS 8-bit

More information

Lab Experiment 1: The LPC 2148 Education Board

Lab Experiment 1: The LPC 2148 Education Board Lab Experiment 1: The LPC 2148 Education Board 1 Introduction The aim of this course ECE 425L is to help you understand and utilize the functionalities of ARM7TDMI LPC2148 microcontroller. To do that,

More information

AVR1321: Using the Atmel AVR XMEGA 32-bit Real Time Counter and Battery Backup System. 8-bit Microcontrollers. Application Note.

AVR1321: Using the Atmel AVR XMEGA 32-bit Real Time Counter and Battery Backup System. 8-bit Microcontrollers. Application Note. AVR1321: Using the Atmel AVR XMEGA 32-bit Real Time Counter and Battery Backup System Features 32-bit Real Time Counter (RTC) - 32-bit counter - Selectable clock source 1.024kHz 1Hz - Long overflow time

More information

Building A RISC Microcontroller in an FPGA

Building A RISC Microcontroller in an FPGA Building A RISC Microcontroller in an FPGA Name : Yap Zi He Course : 4 SEL Supervisor : PM Muhammad Mun im Ahmad Zabidi Introduction Reduce Instruction Set Computer (RISC) is a new trend on computer design.

More information

Serial Communications

Serial Communications Serial Communications 1 Serial Communication Introduction Serial communication buses Asynchronous and synchronous communication UART block diagram UART clock requirements Programming the UARTs Operation

More information

AVR130: Setup and Use of AVR Timers. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

AVR130: Setup and Use of AVR Timers. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE AVR 8-bit Microcontrollers AVR130: Setup and Use of AVR Timers APPLICATION NOTE Introduction This application note describes how to use the different timers of the Atmel AVR. The intention of this document

More information

Real-Time Clock. * Real-Time Computing, edited by Duncan A. Mellichamp, Van Nostrand Reinhold

Real-Time Clock. * Real-Time Computing, edited by Duncan A. Mellichamp, Van Nostrand Reinhold REAL-TIME CLOCK Real-Time Clock The device is not a clock! It does not tell time! It has nothing to do with actual or real-time! The Real-Time Clock is no more than an interval timer connected to the computer

More information

Why using ATmega16? University of Wollongong Australia. 7.1 Overview of ATmega16. Overview of ATmega16

Why using ATmega16? University of Wollongong Australia. 7.1 Overview of ATmega16. Overview of ATmega16 s schedule Lecture 7 - C Programming for the Atmel AVR School of Electrical, l Computer and Telecommunications i Engineering i University of Wollongong Australia Week Lecture (2h) Tutorial (1h) Lab (2h)

More information

http://www.abacom-online.de/div/setup_usb_µpio.exe

http://www.abacom-online.de/div/setup_usb_µpio.exe USB-µPIO USB AVR board Compact AVR board with Atmel ATmega168-20 High speed clock frequency 18.432000 MHz 100% error free High baud rates Screw-terminal and pin connections 6 pin ISP connector Power supply

More information

Freescale Semiconductor, I

Freescale Semiconductor, I nc. Application Note 6/2002 8-Bit Software Development Kit By Jiri Ryba Introduction 8-Bit SDK Overview This application note describes the features and advantages of the 8-bit SDK (software development

More information

aneb Perfekt perfektně.

aneb Perfekt perfektně. aneb Perfekt perfektně. 2013 se v angličtině nazývá Present Perfect, tedy Přítomný perfekt. Patří k časům přítomným, ačkoliv se jistě nejedná o klasický přítomný čas tak, jak jsme zvykĺı z češtiny. jistým

More information

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR INTRODUCTION This Project "Automatic Night Lamp with Morning Alarm" was developed using Microprocessor. It is the Heart of the system. The sensors

More information

ATxmega128A1 / ATxmega64A1. Preliminary. 8/16-bit XMEGA A1 Microcontroller. Not recommended for new designs - Use XMEGA A1U series Features

ATxmega128A1 / ATxmega64A1. Preliminary. 8/16-bit XMEGA A1 Microcontroller. Not recommended for new designs - Use XMEGA A1U series Features Not recommended for new designs - Use XMEGA A1U series Features 8/16-bit XMEGA A1 Microcontroller ATxmega128A1 / ATxmega64A1 Preliminary High-performance, low-power Atmel AVR XMEGA 8/16-bit Microcontroller

More information

8/16-bit XMEGA D3 Microcontroller

8/16-bit XMEGA D3 Microcontroller Features High-performance, Low-power 8/16-bit Atmel AVR XMEGA TM Microcontroller Non-volatile Program and Data Memories 64K - 256K Bytes of In-System Self-Programmable Flash 4K - 8K Bytes Boot Code Section

More information

APPLICATION NOTE. AVR042: AVR Hardware Design Considerations. AVR 8-bit Microcontrollers. Features. Description

APPLICATION NOTE. AVR042: AVR Hardware Design Considerations. AVR 8-bit Microcontrollers. Features. Description APPLICATION NOTE AVR042: AVR Hardware Design Considerations AVR 8-bit Microcontrollers Features Providing robust supply voltage, digital, and analog Connection of RESET line SPI interface for In-System

More information

Arbeitskreis Hardware. Prof. Dr. Michael Rohs, Dipl.-Inform. Sven Kratz michael.rohs@ifi.lmu.de MHCI Lab, LMU München

Arbeitskreis Hardware. Prof. Dr. Michael Rohs, Dipl.-Inform. Sven Kratz michael.rohs@ifi.lmu.de MHCI Lab, LMU München Arbeitskreis Hardware Prof. Dr. Michael Rohs, Dipl.-Inform. Sven Kratz michael.rohs@ifi.lmu.de MHCI Lab, LMU München Goals Learn how to Build embedded interactive systems Build interactive devices and

More information

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester Leonardo Journal of Sciences ISSN 1583-0233 Issue 20, January-June 2012 p. 31-36 Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester Ganesh Sunil NHIVEKAR *, and Ravidra Ramchandra MUDHOLKAR

More information

8-bit Microcontroller. Application Note. AVR400: Low Cost A/D Converter

8-bit Microcontroller. Application Note. AVR400: Low Cost A/D Converter AVR400: Low Cost A/D Converter Features Interrupt Driven : 23 Words Low Use of External Components Resolution: 6 Bits Measurement Range: 0-2 V Runs on Any AVR Device with 8-bit Timer/Counter and Analog

More information

ATmega128A. Introduction. Features. 8-bit AVR Microcontroller DATASHEET COMPLETE

ATmega128A. Introduction. Features. 8-bit AVR Microcontroller DATASHEET COMPLETE 8-bit AVR Microcontroller ATmega128A DATASHEET COMPLETE Introduction The Atmel ATmega128A is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing powerful instructions

More information

JTAG ICE.... User Guide

JTAG ICE.... User Guide JTAG ICE... User Guide Table of Contents Table of Contents Section 1 Introduction... 1-1 1.1 Features...1-1 1.2 JTAG ICE and the OCD Concept...1-2 1.2.4.1 Software Breakpoints...1-3 1.2.4.2 Hardware Breakpoints...1-3

More information

Display Message on Notice Board using GSM

Display Message on Notice Board using GSM Advance in Electronic and Electric Engineering. ISSN 2231-1297, Volume 3, Number 7 (2013), pp. 827-832 Research India Publications http://www.ripublication.com/aeee.htm Display Message on Notice Board

More information

Advanced Microcontrollers Grzegorz Budzyń Lecture. 3: Electrical parameters of microcontrollers 8051 family

Advanced Microcontrollers Grzegorz Budzyń Lecture. 3: Electrical parameters of microcontrollers 8051 family Advanced Microcontrollers Grzegorz Budzyń Lecture 3: Electrical parameters of microcontrollers 8051 family Plan Electrical parameters of microcontrollers 8051 core(8-bit) Main features 8051 based microcontrollers

More information

ATmega32A. Introduction. Features. 8-Bit AVR Microcontroller DATASHEET COMPLETE

ATmega32A. Introduction. Features. 8-Bit AVR Microcontroller DATASHEET COMPLETE 8-Bit AVR Microcontroller ATmega32A DATASHEET COMPLETE Introduction The Atmel ATmega32A is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing powerful instructions

More information

Ingar Fredriksen AVR Applications Manager. Tromsø August 12, 2005

Ingar Fredriksen AVR Applications Manager. Tromsø August 12, 2005 Ingar Fredriksen AVR Applications Manager Tromsø August 12, 2005 Atmel Norway 2005 Atmel Norway 2005 The history of computers Foundation for modern computing 3 An automatic computing machine must have:

More information

Tiny-Dice Electronic dice using an ATtiny2313

Tiny-Dice Electronic dice using an ATtiny2313 Tiny-Dice Electronic dice using an ATtiny By Florian Schäffer (Germany) This simple electronic dice is an ideal starter project to introduce youngsters and those still young at heart to the dark arts of

More information

Palaparthi.Jagadeesh Chand. Associate Professor in ECE Department, Nimra Institute of Science & Technology, Vijayawada, A.P.

Palaparthi.Jagadeesh Chand. Associate Professor in ECE Department, Nimra Institute of Science & Technology, Vijayawada, A.P. Patient Monitoring Using Embedded Palaparthi.Jagadeesh Chand Associate Professor in ECE Department, Nimra Institute of Science & Technology, Vijayawada, A.P Abstract The aim of this project is to inform

More information

SPI. Overview and Use of the PICmicro Serial Peripheral Interface. Getting Started: SPI

SPI. Overview and Use of the PICmicro Serial Peripheral Interface. Getting Started: SPI SPI Overview and Use of the PICmicro Serial Peripheral Interface In this presentation, we will look at what the Serial Peripheral Interface, otherwise known as the SPI, is, and how it is used to communicate

More information

8741A UNIVERSAL PERIPHERAL INTERFACE 8-BIT MICROCOMPUTER

8741A UNIVERSAL PERIPHERAL INTERFACE 8-BIT MICROCOMPUTER UNIVERSAL PERIPHERAL INTERFACE 8-BIT MICROCOMPUTER 8-Bit CPU plus ROM RAM I O Timer and Clock in a Single Package One 8-Bit Status and Two Data Registers for Asynchronous Slave-to- Master Interface DMA

More information

Arbeitskreis Hardware. Prof. Dr. Michael Rohs, Dipl.-Inform. Sven Kratz michael.rohs@ifi.lmu.de MHCI Lab, LMU München

Arbeitskreis Hardware. Prof. Dr. Michael Rohs, Dipl.-Inform. Sven Kratz michael.rohs@ifi.lmu.de MHCI Lab, LMU München Arbeitskreis Hardware Prof. Dr. Michael Rohs, Dipl.-Inform. Sven Kratz michael.rohs@ifi.lmu.de MHCI Lab, LMU München Schedule (preliminary) Date Topic (preliminary) 2.5. Introduction to embedded interaction,

More information

Using Altera MAX Series as Microcontroller I/O Expanders

Using Altera MAX Series as Microcontroller I/O Expanders 2014.09.22 Using Altera MAX Series as Microcontroller I/O Expanders AN-265 Subscribe Many microcontroller and microprocessor chips limit the available I/O ports and pins to conserve pin counts and reduce

More information

Freescale Semiconductor, Inc. Product Brief Integrated Portable System Processor DragonBall ΤΜ

Freescale Semiconductor, Inc. Product Brief Integrated Portable System Processor DragonBall ΤΜ nc. Order this document by MC68328/D Microprocessor and Memory Technologies Group MC68328 MC68328V Product Brief Integrated Portable System Processor DragonBall ΤΜ As the portable consumer market grows

More information

Using the HT46R46 I/O Ports to Implement Half-Duplex SPI Communication

Using the HT46R46 I/O Ports to Implement Half-Duplex SPI Communication Using the HT46R46 I/O Ports to Implement Half-Duplex SPI Communication D/N: HA0150E Introduction This application explains how to use two I/O lines on the HT46R46 to implement half-duplex SPI communication.

More information

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs AN033101-0412 Abstract This describes how to interface the Dallas 1-Wire bus with Zilog s Z8F1680 Series of MCUs as master devices. The Z8F0880,

More information

How to use AVR Studio for Assembler Programming

How to use AVR Studio for Assembler Programming How to use AVR Studio for Assembler Programming Creating your first assembler AVR project Run the AVRStudio program by selecting Start\Programs\Atmel AVR Tools\AVR Studio. You should see a screen like

More information

Microtronics technologies Mobile: 99707 90092

Microtronics technologies Mobile: 99707 90092 For more Project details visit: http://www.projectsof8051.com/rfid-based-attendance-management-system/ Code Project Title 1500 RFid Based Attendance System Synopsis for RFid Based Attendance System 1.

More information

8-bit Microcontroller with 64K/128K/256K Bytes In-System Programmable Flash. ATmega640/V ATmega1280/V ATmega1281/V ATmega2560/V ATmega2561/V

8-bit Microcontroller with 64K/128K/256K Bytes In-System Programmable Flash. ATmega640/V ATmega1280/V ATmega1281/V ATmega2560/V ATmega2561/V Features High Performance, Low Power Atmel AVR 8-Bit Microcontroller Advanced RISC Architecture 35 Powerful Instructions Most Single Clock Cycle Execution 32 8 General Purpose Working Registers Fully Static

More information

AVR319: Using the USI module for SPI communication. 8-bit Microcontrollers. Application Note. Features. Introduction

AVR319: Using the USI module for SPI communication. 8-bit Microcontrollers. Application Note. Features. Introduction AVR319: Using the USI module for SPI communication Features C-code driver for SPI master and slave Uses the USI module Supports SPI Mode 0 and 1 Introduction The Serial Peripheral Interface (SPI) allows

More information

AN974 APPLICATION NOTE

AN974 APPLICATION NOTE AN974 APPLICATION NOTE Real time clock with ST7 Timer Output Compare By MCD Application Team 1 INTRODUCTION The purpose of this note is to present how to use the ST7 Timer output compare function. As an

More information

Flash Microcontroller. Memory Organization. Memory Organization

Flash Microcontroller. Memory Organization. Memory Organization The information presented in this chapter is collected from the Microcontroller Architectural Overview, AT89C51, AT89LV51, AT89C52, AT89LV52, AT89C2051, and AT89C1051 data sheets of this book. The material

More information

8-bit RISC Microcontroller. Application Note. AVR910: In-System Programming

8-bit RISC Microcontroller. Application Note. AVR910: In-System Programming AVR910: In-System Programming Features Complete In-System Programming Solution for AVR Microcontrollers Covers All AVR Microcontrollers with In-System Programming Support Reprogram Both Data Flash and

More information

User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK

User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK Because Arduino that is the development project on AVR MCU as Open Source has been published, it is popular and widespread shortly.

More information

Lesson-16: Real time clock DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK

Lesson-16: Real time clock DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK Lesson-16: Real time clock 1 Real Time Clock (RTC) A clock, which is based on the interrupts at preset intervals. An interrupt service routine executes

More information

AN1229. Class B Safety Software Library for PIC MCUs and dspic DSCs OVERVIEW OF THE IEC 60730 STANDARD INTRODUCTION

AN1229. Class B Safety Software Library for PIC MCUs and dspic DSCs OVERVIEW OF THE IEC 60730 STANDARD INTRODUCTION Class B Safety Software Library for PIC MCUs and dspic DSCs AN1229 Authors: Veena Kudva & Adrian Aur Microchip Technology Inc. OVERVIEW OF THE IEC 60730 STANDARD INTRODUCTION This application note describes

More information

AVR126: ADC of megaavr in Single Ended Mode. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

AVR126: ADC of megaavr in Single Ended Mode. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE AVR 8-bit Microcontrollers AVR126: ADC of megaavr in Single Ended Mode APPLICATION NOTE Introduction Atmel megaavr devices have a successive approximation Analog-to- Digital Converter (ADC) capable of

More information

DP8570A DP8570A Timer Clock Peripheral (TCP)

DP8570A DP8570A Timer Clock Peripheral (TCP) DP8570A DP8570A Timer Clock Peripheral (TCP) Literature Number: SNAS557 DP8570A Timer Clock Peripheral (TCP) General Description The DP8570A is intended for use in microprocessor based systems where information

More information

ARM Thumb Microcontrollers. Application Note. Software ISO 7816 I/O Line Implementation. Features. Introduction

ARM Thumb Microcontrollers. Application Note. Software ISO 7816 I/O Line Implementation. Features. Introduction Software ISO 7816 I/O Line Implementation Features ISO 7816-3 compliant (direct convention) Byte reception and transmission with parity check Retransmission on error detection Automatic reception at the

More information

MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1

MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1 MICROPROCESSOR A microprocessor incorporates the functions of a computer s central processing unit (CPU) on a single Integrated (IC), or at most a few integrated circuit. It is a multipurpose, programmable

More information

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc. SKP16C62P Tutorial 1 Software Development Process using HEW Renesas Technology America Inc. 1 Overview The following tutorial is a brief introduction on how to develop and debug programs using HEW (Highperformance

More information

WIZ-Embedded WebServer User s Manual (Ver. 1.0)

WIZ-Embedded WebServer User s Manual (Ver. 1.0) [텍스트 입력] WIZ-Embedded WebServer User s Manual (Ver. 1.0) 2007 WIZnet Inc. All Rights Reserved. For more information, visit our website at www.wiznet.co.kr Document History Information Revision Data Description

More information

Interrupts and the Timer Overflow Interrupts Huang Sections 6.1-6.4. What Happens When You Reset the HCS12?

Interrupts and the Timer Overflow Interrupts Huang Sections 6.1-6.4. What Happens When You Reset the HCS12? Interrupts and the Timer Overflow Interrupts Huang Sections 6.1-6.4 o Using the Timer Overflow Flag to interrupt a delay o Introduction to Interrupts o How to generate an interrupt when the timer overflows

More information

ETEC 421 - Digital Controls PIC Lab 10 Pulse Width Modulation

ETEC 421 - Digital Controls PIC Lab 10 Pulse Width Modulation ETEC 421 - Digital Controls PIC Lab 10 Pulse Width Modulation Program Definition: Write a program to control the speed of a dc motor using pulse width modulation. Discussion: The speed of a dc motor is

More information

TMU3114MS. USB Full Speed Controller. Data Sheet. Tenx reserves the right to change or discontinue this product without notice. tenx technology inc.

TMU3114MS. USB Full Speed Controller. Data Sheet. Tenx reserves the right to change or discontinue this product without notice. tenx technology inc. Advance Information TMU3114MS Data Sheet Tenx reserves the right to change or discontinue this product without notice. tenx technology inc. tenx technology, inc. CONTENTS 1. GENERAL DESCRIPTION... 2 2.

More information

Allows the user to protect against inadvertent write operations. Device select and address bytes are Acknowledged Data Bytes are not Acknowledged

Allows the user to protect against inadvertent write operations. Device select and address bytes are Acknowledged Data Bytes are not Acknowledged Write Protect CAT24WCxxx I 2 C Serial EEPROMs. Allows the user to protect against inadvertent write operations. WP = V CC : Write Protected Device select and address bytes are Acknowledged Data Bytes are

More information

8-bit Atmel Microcontroller with 8K/16K Bytes In-System Programmable Flash and LIN Controller. ATtiny87 ATtiny167

8-bit Atmel Microcontroller with 8K/16K Bytes In-System Programmable Flash and LIN Controller. ATtiny87 ATtiny167 Features High Performance, Low Power AVR 8-bit Microcontroller Advanced RISC Architecture 123 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

Android Controlled Based Interface

Android Controlled Based Interface Android Controlled Based Interface Objective Fix Foba Build Rofi (Fifth Generation Robot) Develop, Build, and Implement a Dynamic Balanced Biped Robot Table of Contents Objective... 1 Android Controlled

More information

Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview

Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview Technical Note TN-29-06: NAND Flash Controller on Spartan-3 Overview Micron NAND Flash Controller via Xilinx Spartan -3 FPGA Overview As mobile product capabilities continue to expand, so does the demand

More information

Voltage boost and buck circuits using Atmel AVR Tiny13V for driving a white LED.

Voltage boost and buck circuits using Atmel AVR Tiny13V for driving a white LED. Voltage boost and buck circuits using Atmel AVR Tiny13V for driving a white LED. By Steven Weber, KD1JV 1/26/09 The PWM feature of the Tiny13 processor can be used to make a simple voltage boost or buck

More information

Embedded Software Development: Spottbillige Hardware + OSS = Zum Spielen zu Schade!

Embedded Software Development: Spottbillige Hardware + OSS = Zum Spielen zu Schade! Embedded Software Development: Spottbillige Hardware + OSS = Zum Spielen zu Schade! Gregor Hohpe www.eaipatterns.com OOP 2012 1 Microcontrollers CPU core, memory, and I/O (analog, digital) on one chip

More information

Block 3 Size 0 KB 0 KB 16KB 32KB. Start Address N/A N/A F4000H F0000H. Start Address FA000H F8000H F8000H F8000H. Block 2 Size 8KB 16KB 16KB 16KB

Block 3 Size 0 KB 0 KB 16KB 32KB. Start Address N/A N/A F4000H F0000H. Start Address FA000H F8000H F8000H F8000H. Block 2 Size 8KB 16KB 16KB 16KB APPLICATION NOTE M16C/26 1.0 Abstract The following article describes using a synchronous serial port and the FoUSB (Flash-over-USB ) Programmer application to program the user flash memory of the M16C/26

More information