void rti_init(void) //1ms
{
RTICTL=0X8f; //1ms中断一次
CRGFLG_RTIF=1; //清中断标志位,RTI time-out has occurred.
PACTL_PAEN=1;//1 Pulse Accumulator system enabled.
PACTL_PAMOD=0;//0 Event counter mode.
PACTL_PEDGE=1;//1 Rising edges on IOC7 pin cause the count to be incremented.
CRGINT_RTIE=1; //Interrupt will be requested whenever RTIF is set.
}