This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| en:exercises:timer [2010/02/02 12:51] – external edit 127.0.0.1 | en:exercises:timer [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| - | ===== Ülesanded ===== | + | The goal is to write a program performing tasks described below. |
| - | Eesmärgiks on koostada programm, mis täidab kirjeldatud ülesannet. | + | ===== Warm up exercise ===== |
| - | ===== Soojendusülesanne ===== | + | * Make the red LED blink. The period is 10 seconds (half period is 5 seconds). Create function of software delay, with amount of seconds as a parameter. |
| - | * Panna punane LED vilkuma 10-sekundilise perioodiga (poolperiood 5 s). Teostamiseks luua tarkvaralise viite funktsioon, mille parameetriks on sekundite arv. | + | ===== For beginners ===== |
| - | ===== Algajale ===== | + | - Display on LCD screen, with the accuracy of 100 ms, time between pressing of any random two buttons. Execution of the time measurement is your own choice |
| + | - Pressing button S1, the blinking speed of all three LEDs is slowed down two times. | ||
| + | - Display the frequency of pressing down the button S1 on the 7 segment LED indicator in Hz-s. The display of the frequency must be limited with 0 at the bottom and with 9 at the top. | ||
| + | - If button S1 is pressed, the program counts down the seconds from 60 to 0 and then lights the red LED. If button S2 is pressed the time is 30 seconds, followed by lighting of the yellow LED. For S3 the time is 10 seconds and the LED is green. All the processes have to take place simultaneously. The LEDs switch off when corresponding buttons are pressed. | ||
| + | - Display the Time on the LCD as follows: hh:mm:ss. Use hardware timer 1 with interruptions and the Time must be configurable with the buttons. It is advised to use three buttons, S1 for increasing rotationally the hours, S2 for minutes and S3 for seconds. | ||
| - | - LCD ekraanil kuvada aega 100 ms täpsusega, mis kulub suvaliste nuppude allavajutamiste vahel. Aja mõõtmise teostus vabal valikul. | + | ===== For advanced ===== |
| - | - Vajutades nuppu S1, | + | |
| - | - 7-segmendilisel LED indikaatoril kuvada nupu S1 vajutamise sagedust hertsides. Sageduse näit tuleb piirata madalamalt nulli ja kõrgemalt üheksaga. | + | |
| - | - Nupule S1 vajutades loendab programm sekundeid 60-st nulli ja süütab seejärel punase LED-i. Nupule S2 vajutades on ajaks on 30 sekundit, misjärel süüdatakse kollane LED. Nupp S3 aeg on 10 sekundit ja LED on roheline. Kõik protsessid peavad toimima paralleelselt. LED-id kustuvad, kui vajutada vastavaid nuppe. | + | |
| - | - Näidata LCD ekraanil kellaaega kujul hh:mm:ss. Kasutada tuleb raudvaralist taimerit 1 koos katkestustega ja kellaaeg peab nuppudega seadistatav olema. Soovitatav on kasutada 3 nuppu, millest S1 suurendab roteeruvalt tunde, S2 minuteid ja S3 sekundeid. | + | |
| - | ===== Edasijõudnule ===== | + | - Design a stopwatch, which displays hours, minutes, seconds and milliseconds on LCD screen. Button S1 starts the time, S2 stops it and S3 zeros it. Interruption of the timer must be used. |
| + | - In 2 second intervals red, yellow and green LED are smoothly lit and switched off after each other. The smooth lighting is achieved by modulating the LEDs with hundredths of hertz (by lighting and switching it off very fast) and by changing the proportions between lighted/ | ||
| + | - Make a part of program in C-language which produces a delay of 10 μs ± 10 % at frequency of 14,7456 MHz. Verify the functioning of the delay theoretically - compiled program. By commenting the instructions in assembler language in the .lss file of compiled program. | ||
| - | - Teha stopper, mis LCD ekraanil kuvab tunde, minuteid, sekundeid ja millisekundeid. Nupp S1 alustab mõõtmist, S2 peatab mõõtmise ja S3 nullib aja. Kasutada tuleb taimeri katkestust. | + | ===== Questions ===== |
| - | - 2-sekundilise vahega süttib ja kustub sujuvalt järjest punane, kollane ja roheline LED. Sujuv valgustus saadakse LED-i mitmesajahertsise sagedusega moduleerides (seda ülikiiresti süüdates ja kustutades) ja põlemise/ | + | |
| - | - Tekitada C-keelde programmilõik, | + | |
| - | ===== Kordamisküsimused ===== | + | |
| - | + | - How is software delay created? On which parameters depends the duration of the software delay? | |
| - | | + | - What makes us use hardware delay/timer with interruptions? |
| - | - Kuidas tekitada tarkvaraline viide? Millistest parameetritest tarkvaralise viite kestus sõltub? | + | - Calculate the overflow interruption period for 8-bit timer, if the clock rate is 16 MHz and frequency divider' |
| - | - Mis sunnib kasutama raudvaralist taimerit koos katkestusega? | + | - What is RTC hidden in the computers? |
| - | - Arvutage | + | - What happens on the 19.01.2038 in the world of computers? |
| - | - Mis asi on arvutites peituv "RTC"? | + | - What can be done with the AVR timers besides counting time? |
| - | - Mis juhtub | + | - What indexes can be used to set up the ATmega128 |
| - | - Mida saab AVR taimeritega veel teha peale aja loendamise? | + | - Which is the longest duration of the interruptions in milliseconds which can be achieved with ATmega128 |
| - | - Milliste registritega saab seadistada | + | - In case the processor is heavily loaded with an execution of a program |
| - | - Milline on suurim katkestuste ajaline täpsus millisekundites, | + | |
| - | - Kui protsessor on tugevalt koormatud programmi täitmisega | + | |