This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:exercises:timer [2010/03/04 18:23] – priitj | en:exercises:timer [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Exercises ====== | ====== Exercises ====== | ||
- | The goal is to write a program | + | The goal is to write a program |
===== Warm up exercise ===== | ===== Warm up exercise ===== | ||
- | * Make the red LED blink. The period is 10 seconds (half period is 5 seconds). Create function of software delay, | + | * Make the red LED blink. The period is 10 seconds (half period is 5 seconds). Create function of software delay, |
===== For beginners ===== | ===== For beginners ===== | ||
- | - Display | + | - Display on LCD screen, with the accuracy of 100 ms, time between |
- | - If the S1 button is pressed, the blinking speed of all three LED-s is slowed down three times. | + | - Pressing button |
- 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. | - 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 | + | - If button S1 is pressed, the program |
- | - Display the Time on the LCD as follows: hh:mm:ss. Use hardware timer with one interruption | + | - Display the Time on the LCD as follows: hh:mm:ss. Use hardware timer 1 with interruptions |
===== For advanced ===== | ===== For advanced ===== | ||
- | - Design a stopwatch, which’s LCD displays hours, minutes, seconds and milliseconds. | + | - Design a stopwatch, which displays hours, minutes, seconds and milliseconds |
- | - In 2 second intervals red, yellow and green LED-s are smoothly lit and switched off after each other. The smooth lighting is achieved by modulating the LED-s with hundredths of hertz (by lighting and switching it off very fast) and changing the proportions | + | - 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 |
- | - Make a part of program in C-language which produces a delay of 10 μs ± 10 % at frequency of 14,7456 MHz. Prove the functioning of the delay theoretically | + | - Make a part of program in C-language which produces a delay of 10 μs ± 10 % at frequency of 14,7456 MHz. Verify |
===== Questions ===== | ===== Questions ===== | ||
- | - What are the methods for crating delay.? | + | - What are the methods for crating delay? |
- How is software delay created? On which parameters depends the duration of the software delay? | - How is software delay created? On which parameters depends the duration of the software delay? | ||
- What makes us use hardware delay/timer with interruptions? | - What makes us use hardware delay/timer with interruptions? | ||
- Calculate the overflow interruption period for 8-bit timer, if the clock rate is 16 MHz and frequency divider' | - Calculate the overflow interruption period for 8-bit timer, if the clock rate is 16 MHz and frequency divider' | ||
- | - What is the RTC (in the computers)? | + | - What is RTC hidden |
- What happens on the 19.01.2038 in the world of computers? | - What happens on the 19.01.2038 in the world of computers? | ||
- What can be done with the AVR timers besides counting time? | - What can be done with the AVR timers besides counting time? | ||
- What indexes can be used to set up the ATmega128 timer 0? What can be adjusted with these registers? | - What indexes can be used to set up the ATmega128 timer 0? What can be adjusted with these registers? | ||
- | - Which is the longest duration of the interruptions in milliseconds which can be achieved with ATmega128 micro-controller | + | - Which is the longest duration of the interruptions in milliseconds which can be achieved with ATmega128 micro-controller |
- | - If the processor is strongly | + | - In case the processor is heavily |