Download presentation
Presentation is loading. Please wait.
Published byLynn Dennis Modified over 9 years ago
1
Tachometer
2
Hardware Design -=
3
Recall Atmega Interrupts internalExternalLCD
4
TSOP operates on 38 khz Internal interrupts CTC MODE 38 Khz
5
LCD Circuit Diagram
7
4 Simple Commands Lcd_putsf(“Eclub welcomes u ”); // prints constant string Lcd_putchar(‘a’); // character to be printed Lcd_puts(c); // c is a variable string
8
What about integers ? Problem
9
Solution Convert Integer to strings Use two simple Commands Itoa(i,c) & ftoa(f,3,c)
10
int a = 10 ; char c[10]; itoa (i,c); lcd_puts(c);
11
Using Itoa int a = 10 ;char c[10];itoa (i,c);lcd_puts(c);
12
Result
13
Using ftoa float a = 10.123 ; Char c[10];ftoa (i,3,c);Lcd_puts(c);
14
Result
15
Using LCD in CVCAVR
18
Select any Port Use the 4 magical Functions
19
External Interrupt Triggered externally Not at regular intervals of time Detects Rising EdgeFalling edge
20
Using Ext Interrupt in CVAVR
21
Open CVAVR Go to File NewProject
27
Place your code here
28
So Now we are able to know when the obstacle attached to the shaft comes in way Able to display on LCD
29
What remains ? Calculate time at which external interrupt occurs HOW ???
30
HINT Use one more Internal interrupt to get time
31
Pit Falls TSOP frequency 38 Khz and frequency of IR= 405 THz (10^12) - 300 GHz (10^9). So 38 khz is frequency is Blinking frequency
32
Pit Falls Internal Interrupts functions call themselves after specific intervals of time. Its not like C Programming that to use a function you need to call it in main program. But here time calls the function itself after time interval set by you. You need to mention anything inside main function to call interrupt after specific interval of time Declare variables global if declaring them inside main block results in error Pit Falls
33
Downloading the Software Components distribution (When and where ) Prelims (when, where & what to show )
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.