Homework 7 Solution

15 complete the following program that accepts

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2- 0.2 = 1.8ms, 1.8ms/4us = 450clock cycles iii)Duration of a data bit of value 0 = 0.8ms/4us = 200 clock cycles Taking error into consideration the duration of the data bit of value 0 can be between 0.8+0.2 = 1ms, 1ms/4us = 250 clock cycles and 0.8- 0.2 = 0.6ms, 0.6ms/4us = 150 clock cycles iii)Duration of the idle interval = 0.8ms/4us = 200 clock cycles Taking error into consideration the duration of the idle interval can be between 0.8+0.2 = 1ms, 1ms/4us = 250 clock cycles and 0.8- 0.2 = 0.6ms, 0.6ms/4us = 150 clock cycles b. [5] Write C code to initialize Timer 1 to use its input capture unit to recognize IR remote signal. Interrupt should be enabled. Timer1_init() { //your code here TCCR1B = (1<<ICNC1) | (1<<CS11) | (1&...
View Full Document

Ask a homework question - tutors are online