Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:exercises:timer [2010/03/04 18:23] priitjen: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 which is able to perform tasks described below. +The goal is to write a program performing tasks described below. 
  
 ===== 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, which's parameter is the amount of seconds.+  * 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.
  
 ===== For beginners ===== ===== For beginners =====
  
-  - Display the time on the LCD, with an accuracy of 100 ms, what is between pressings of random buttons. Execution of the time measurement is your own choice +  - 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 
-  - If the S1 button is pressed, the blinking speed of all three LED-s is slowed down three times.  If the button S3 is pressed, the blinking gets 2 times faster. If S2 is pressed the frequency of the blinking will be 1 Hz. Use delay functions or interruptions (the interruptions are more difficult but when delay functions are used there will be an extra delay due to the filtering function of the buttons).+  - Pressing button S1, the blinking speed of all three LEDs is slowed down two times.  Pressing button S3, the blinking gets 2 times faster and pressing button S2 the frequency of the blinking will be set to 1 Hz. Use delay functions or interruptions (the interruptions are more difficult but when delay functions are used there will be an extra delay due to the filtering function of the buttons).
   - 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 reads the seconds from 60 to 0 and lights then the red LED. If button S2 is pressed the time is 30 seconds, after what the yellow LED is lit.  S3 means that the time is 10 seconds and the LED is green. All the processes have to take place parallel. The LED-s are switching off when corresponding buttons are pressed. +  - 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 with one interruption and the Time must be configurable with the buttons. It is advised to use three buttons, of which the S1 steps rotationally up the hours, the S2 minutes and the S3 seconds.+  - Display the Time on the LCD as follows: hh:mm:ss. Use hardware timer 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.
  
 ===== For advanced ===== ===== For advanced =====
  
-  - Design a stopwatch, which’s LCD displays hours, minutes, seconds and milliseconds. The button S1 starts the time, the S2 stops it and S3 zeros it. Use interruption of the timer +  - Design a stopwatch, which displays hours, minutes, seconds and milliseconds on LCD screenButton 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-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 of lighted/switching off time. That is why it seems that for an eye it seems that the brightness of the LED-s is changing (we are dealing with the Pulse With Modulation here). +  - 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/switched off time, causing to appear for the  eyethat the brightness of the LEDs is changing (this is Pulse With Modulation). 
-  - 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  by commenting the instructions in assembler language in the .lss file of compiled program. +  - 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. 
  
 ===== 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's factor is 1024.   - Calculate the overflow interruption period for 8-bit timer, if the clock rate is 16 MHz and frequency divider's factor is 1024.
-  - What is the RTC (in the computers)?+  - What is RTC hidden in the computers?
   - 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 works at the clock frequency of 14,7456 Mhz. Show the calculation formula. +  - Which is the longest duration of the interruptions in milliseconds which can be achieved with ATmega128 micro-controller that work at the clock frequency of 14,7456 MHz? Show the calculation formula. 
-  - If the processor is strongly loaded with the execution of the program (for example, it controls several motors and the values of several sensors at once), then does it effect the accuracy of the timer? Explain your answer.+  - In case the processor is heavily loaded with an execution of program (for example, it controls several motors and the values of several sensors at once), does this have an effect on the accuracy of the timer? Explain your answer.
en/exercises/timer.1267727005.txt.gz · Last modified: 2020/07/20 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0