Panasonic MN103S manual Cpum

Page 19

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

Image 19
Contents MN103S927/92A/F92G LSI Application Notes Excerption Page Page About This Manual Format used for sample program explanations About This Manual3 Page Table of Contents Microcomputer Basics Chapter overview Appendix Table of Contents Overview Counting rising edges using the event countHardware allocation list Timer 1 Base Register TM1BR 0x0000A149 Timer 1 Mode Register TM1MD 0x0000A141 Timer 1 Binary Counter TM1BC 0x0000A151Port 3 I/O Control Register P3DIR 0x0000A023 Port 3 Output Mode Register P3MD 0x0000A033 END FlowchartExample program Enable the interruptCpum URL http//panasonic.co.jp/semicon/e-micom/inquiry InquiriesSales Offices