#include <SN8P2711B.h>
void Timer_Setting(void);
void main(void)
{
Timer_Setting();
while(1)
{
//user code
}
}
void Timer_Setting(void)
{
TC0M = 0x04; //TC0M register value, Fcpu: 1.000000MHZ
FTC0X8 = 0; //CLK source: Fcpu
TC0C = 0xD9; //TC0C register value, time: 10.000000ms(100.000000HZ)
TC0R = 0xD9; //TC0R register value
FTC0IRQ = 0;
FTC0IEN = 1; //TC0 Interrupt enable
FTC0CKS = 0;
FTC0ENB = 1; //TC0 enable
}
__interrupt ISR(void)
{
if(FTC0IRQ)
{
FTC0IRQ=0;
}
}
用SN8 C Studio编译器写定时器的时候出现error L2014 : missing interrupt entrance function(like void __interrupt [0x08] FunName(void))!的错误提示。有没有大佬接触过这款芯片,可否给个定时器例程呢 |