Vous êtes sur la page 1sur 1

********************************************************

Name:Hingmire Aditya v.
Roll no:67
Program for timer as counter.
********************************************************
#include<LPC2148.H>
void init_counter(void);
void main()
{
init_counter();
}
void init_counter()
{
//select function of P0.2 as cap0.0
PINSEL0=0x00000020;
T0CTCR=0x00000001; //select counter fun.
& incre on +ve edge
T0TCR=0x00000002; //reset timer
T0PR=5; //increment on (5+1) cycles
TOTCR=0x00000001; //enable counter
}

Vous aimerez peut-être aussi