tachometer. hardware design -= recall atmega interrupts internalexternallcd

Download Tachometer. Hardware Design -= Recall Atmega Interrupts internalExternalLCD

If you can't read please download the document

Upload: lynn-dennis

Post on 23-Dec-2015

220 views

Category:

Documents


0 download

TRANSCRIPT

  • Slide 1
  • Tachometer
  • Slide 2
  • Hardware Design -=
  • Slide 3
  • Recall Atmega Interrupts internalExternalLCD
  • Slide 4
  • TSOP operates on 38 khz Internal interrupts CTC MODE 38 Khz
  • Slide 5
  • LCD Circuit Diagram
  • Slide 6
  • Slide 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
  • Slide 8
  • What about integers ? Problem
  • Slide 9
  • Solution Convert Integer to strings Use two simple Commands Itoa(i,c) & ftoa(f,3,c)
  • Slide 10
  • int a = 10 ; char c[10]; itoa (i,c); lcd_puts(c);
  • Slide 11
  • Using Itoa int a = 10 ;char c[10];itoa (i,c);lcd_puts(c);
  • Slide 12
  • Result
  • Slide 13
  • Using ftoa float a = 10.123 ; Char c[10];ftoa (i,3,c);Lcd_puts(c);
  • Slide 14
  • Result
  • Slide 15
  • Using LCD in CVCAVR
  • Slide 16
  • Slide 17
  • Slide 18
  • Select any Port Use the 4 magical Functions
  • Slide 19
  • External Interrupt Triggered externally Not at regular intervals of time Detects Rising EdgeFalling edge
  • Slide 20
  • Using Ext Interrupt in CVAVR
  • Slide 21
  • Open CVAVR Go to File NewProject
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Place your code here
  • Slide 28
  • So Now we are able to know when the obstacle attached to the shaft comes in way Able to display on LCD
  • Slide 29
  • What remains ? Calculate time at which external interrupt occurs HOW ???
  • Slide 30
  • HINT Use one more Internal interrupt to get time
  • Slide 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
  • Slide 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
  • Slide 33
  • Downloading the Software Components distribution (When and where ) Prelims (when, where & what to show )