You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Tanish25 759597d8f9 Adding files 2 years ago
..
Makefile adding files 2 years ago
main.c Adding files 2 years ago
main.elf Adding files 2 years ago
main.hex Adding files 2 years ago
main.o Adding files 2 years ago
readme.txt Adding files 2 years ago

readme.txt

Registers involved:

GPIO:
DDRA: Data Direction Register for Port A= 0xFF for output
DDRC: Data Direction Register for Port C= 0xFF for output
PORTD: Port D Data Register= set as 0xFF to activate pull up registers

Input Capture Unit(ICU):
TCCR1A: Timer/Counter 1 Control Register A = 0x00 for normal mode of opearation

TCCR1B: Timer/Counter 1 Control Register B = 0x41
Bit 7= ICNCn = ICU Noise Canceller= 0-Disabled
Bit 6= ICU Capture Edge select bit: when the ICESn bit is written to one, a rising (positive) edge will trigger the capture.
Bit [2:0] = 001 = Prescaler-1(i.e. no clock division)

TIFR1: Timer/Counter1 Interrupt Flag Register
Bit 5= ICF1= Timer/Counter Input Capture Flag 1
This flag is set when a capture event occurs on the ICP1 pin. When the Input Capture Register (ICR1) is set by the
WGM1[3:0] to be used as the TOP value, the ICF1 Flag is set when the counter reaches the TOP value.


ICR1L: Input Capture Register 1 Lower= stores the lower 8 bits of result
ICR1H: Input Capture Register 1 Higher= s