2-4 A 8-bit 16-bit timer, a peripheral initial
Various setup of a 8-bit timer
It is a setup when using it as an interval timer.
/*******************************
* Register address
*******************************/
/* Timer 0 register address declaration */
#define TM0BC (*((volatile unsigned char *)0x0000A150))
#define TM0BR (*((volatile unsigned char *)0x0000A148))
#define TM0MD (*((volatile unsigned char *)0x0000A140))
/* Timer 1 register address declaration */
#define TM1BC (*((volatile unsigned char *)0x0000A151))
#define TM1BR (*((volatile unsigned char *)0x0000A149))
#define TM1MD (*((volatile unsigned char *)0x0000A141))
/* Timer 2 register address declaration */
#define TM2BC (*((volatile unsigned char *)0x0000A154))
#define TM2BR (*((volatile unsigned char *)0x0000A14C))
#define TM2MD (*((volatile unsigned char *)0x0000A144))
/* Timer 3 register address declaration */
#define TM3BC (*((volatile unsigned char *)0x0000A155))
#define TM3BR (*((volatile unsigned char *)0x0000A14D))
#define TM3MD (*((volatile unsigned char *)0x0000A145))
/* Timer 4 register address declaration */
#define TM4BC (*((volatile unsigned char *)0x0000A170))
#define TM4BR (*((volatile unsigned char *)0x0000A168))
#define TM4MD (*((volatile unsigned char *)0x0000A160))
/* Timer 5 register address declaration */
#define TM5BC (*((volatile unsigned char *)0x0000A171))
#define TM5BR (*((volatile unsigned char *)0x0000A169))
#define TM5MD (*((volatile unsigned char *)0x0000A161))
/* Timer 6 register address declaration */
#define TM6BC (*((volatile unsigned char *)0x0000A174))
#define TM6BR (*((volatile unsigned char *)0x0000A16C))
#define TM6MD (*((volatile unsigned char *)0x0000A164))
/* Timer 7 register address declaration */
#define TM7BC (*((volatile unsigned char *)0x0000A175))
#define TM7BR (*((volatile unsigned char *)0x0000A16D))
#define TM7MD (*((volatile unsigned char *)0x0000A165))
/* Pre-scaler register address declaration */
/* timer 0-3 */
#define TM03PSC (*((volatile unsigned char *)0x0000A158))
/* timer 4-7 */
#define TM47PSC (*((volatile unsigned char *)0x0000A178))
/* pre-scaler control register*/
#define TMEXPSC8 (*((volatile unsigned char *)0x0000A17C))
/* Declaration of setting data */
#define TM0MD_STOP 0x00 /* timer stop */
2-35