Chapter 3

Microcomputer Basics 1

asm ("

nop\n");

 

asm ("

nop\n");

 

TM1MD

= TM1MD 0x80;

/* Start the counter */

while(1){

 

 

}

 

 

 

}

 

 

 

/*----------------------------------------------

 

 

----------------------------------------------Operation initial setting

*/

void initialize(void)

 

 

{

 

 

 

asm ("

and

0xF0FF,PSW\n");

/* Disable all maskable interrupts */

asm ("

nop\n");

 

asm ("

nop\n");

 

CPUM

= 0x0000;

 

/* Set normal mode */

}

 

 

 

/*-----------------------------------------------

 

 

-----------------------------------------------Timer 1 underflow

*/

void int_timer1(void)

 

 

{

 

 

 

if(P4OUT & 0x10){

 

 

P4OUT = 0x00;

 

/* Set P44 Low(VSS level) */

}

 

 

 

else{

 

 

 

P4OUT = 0x10;

 

/* Set P44 High(VDD level) */

}

 

 

 

}

 

 

 

8-bit timer operation

III−43

Page 19
Image 19
Panasonic MN103S manual Cpum