Page 2
PanaXSeries is a trademark of Matsushita Electric Industrial Co., Ltd. The other corporation names, logotype and product names written in this book are trademarks or registered trademarks of their corresponding corporations. Request for your special attention and precautions in using the technical information and semiconductors described in this book (1) An export permit needs to be obtained from the competent authorities of the Japanese Government if any of the products or technologies described in this book and controlled under the "Foreign Exchange and Foreign...
(*(volatile unsigned char *)P0DIR_adr) #define P0PLU_adr 0x3F40 #define P0PLU (*(volatile unsigned char *)P0PLU_adr) /* Setting program*/ P0DIR = p0port; P0PLU = p0pulup; This sample is recorded on CD-ROM. Inclusion directory:SAMPLE\INITIAL\ASM\IOPORT\PORT0\ Inclusion directory:SAMPLE\INITIAL\C\IOPORT\PORT0\ Panasonic 2-7 Input and output, a peripheral initial Other inputs */...
Page 4
Chapter1 Power supply (power-onboot)Initialization of the memory at the time Chapter2 Each peripheral initial by C Chapter3 The sample program in a sample circuit Chapter4 Appendix Table of Contents injection...
Page 5
Table of Contents Chapter1 Initialization of the memory at the time of a power supply injection (power-on boot) Chapter2 Each peripheral initial by C 2-1 About description of C and an assembler...2-2 2-2 Interruption, a peripheral initial...2-4 2-2-1 Interruption control register...2-4 2-2-2 Interruption level (multiplex interruption)...2-6 The Interruption Processing Method...2-7 2-3-1 Interrupt vector table ...
Page 6
Chapter 3 The sample program in a sample circuit 3-1 The outline of a sample circuit...3-2 3-2 Composition of a sample program...3-2 3-2-1 Sample program specification ...3-2 3-2-2 Composition of a sample program...3-2 3-3 The set point about each processing in a sample program, and its explanation ...3-3 3-3-1 Interruption processing (others [ - / external interruption and timer serial ]) ...3-3 3-3-2 Timer processing ...3-4 3-3-3 Processing about input/output port...3-4...
Page 7
2-4 A 8-bit 16-bit timer, a peripheral initial 2-4 A 8-bit 16-bit timer, a peripheral initial 2-4-1 The various registers of a 8-bit timer Book LSI contains eight 8-bit timers, and is an interval timer, an event timer counter, and a clock output. It can be used as the standard clock of a serial interface, and start timing of A/D conversion.
Page 8
110: Timer 1 underflow 111: TMIN0 terminal input TM1MD: Timer 1 mode register Bit7 : Count operation permission 0: A stop of operation 1: Permission of operation Bit6 : Base register setup 0: Usually, operation 1: Initialization The value of a base register is loaded to a binary counter. The timer pulse output 1 is reset on a low level.
Page 9
2-4 A 8-bit 16-bit timer, a peripheral initial 101: Timer 1 underflow 110: Prohibition of a setup 111: TMIN2 terminal input TM3MD: Timer 3 mode register Bit7 : Timer operation permission 0: Stop of operation 1: Initialization Bit6 : Timer initialization 0: Usually, operation 1: Initialization The value of a base register is loaded to a binary counter.
Page 10
110: Timer 6 underflow 111: TMIN4 terminal input TM5MD: Timer 5 mode register Bit7 : Timer operation permission 0: Stop of operation 1: Permission of operation Bit6 : Timer initialization 0: Usually, operation 1: Initialization The value of a base register is loaded to a binary counter. The timer pulse output 5 is reset on a low level.
Page 11
2-4 A 8-bit 16-bit timer, a peripheral initial TM7MD: Timer 7 mode register Bit7 : Timer operation permission 0: Stop of operation 1: Permission of operation Bit6 : Timer initialization 0: Usually, operation 1: Initialization The value of a base register is loaded to a binary counter. The timer pulse output 7 is reset on a low level.
Page 12
●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 */...
Page 14
data1 &= ~TM1MD_START1; TM1MD = data1; data1 |= TM1MD_ENABLE1; TM1MD = data1; data0 |= TM0MD_ENABLE1; TM0MD = data0; TM03PSC = PS0MD_START; TM0MD = TM0MD_START2; TM1MD = TM1MD_START2; The sample of a 8-bit timer is recorded on attached CD-ROM. Inclusion director:program\initial\timecounter\timer8\ program :timer8int.c It is a setup when using it as an event timer.
Page 16
/* A port 0 is set as TM0IO (input). */ TM0BR = TM0_COUNT4; data |= TM0MD_LOAD1; TM0MD = data; data |= TM0MD_START1; TM0MD = data; data &= ~TM0MD_START1; TM0MD = data; data |= TM0MD_ENABLE1; TM0MD = data; The sample of a 8-bit timer is recorded on attached CD-ROM. Inclusion directory:program\initial\timecounter\timer8\ program :timer8evt.c...
Page 17
MN103S65G LSI Application Note Excerption March, 2004 1st Edition Issued by Matsushita Electric Industrial Co., Ltd. Matsushita Electric Industrial Co., Ltd.