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
Trade Law" is to be exported or taken out of Japan.
(2) The technical information described in this book is limited to showing representative characteristics and
applied circuits examples of the products. It neither warrants non-infringement of intellectual property right
or any other rights owned by our company or a third party, nor grants any license.
(3) W e are not liable for the infringement of rights owned by a third party arising out of the use of the product or
technologies as described in this book.
(4) The products described in this book are intended to be used for standard applications or general electronic
equipment (such as office equipment, communications equipment, measuring instrument s and household
appliances).
Consult our sales staff in advance for information on the following applications:
• Special applications (such as for airplanes, aerospace, automobiles, traffic control equipment, combustion
equipment, life support systems and safety devices) in which exceptional quality and reliability are required,
or if the failure or malfunction of the products may directly jeopardize life or harm the human body.
• Any applications other than the standard applications intended.
(5) The products and product specifications described in this book are subject to change without notice for
modification and/or improvement. At the final stage of your design, purchasing, or use of the prod ucts,
therefore, ask for the most up-to-date Product Standards in advance to make sure that the latest specifications
satisfy your requirements.
(6) When designing your equipment, comply with the guaranteed values, in particular those of maximum rating,
the range of operating power supply volta ge, and heat radiation characteristics. Otherwise, we will not be
liable for any defect which may arise later in your equipment.
Even when the products are used within the guaranteed values, take into the consideration of incidence of
break down and failure mode, possible to occur to semiconductor products. Measures on the systems such as
redundant design, arresting the spread of fire or preventing glitch are recommended in order to prevent
physical injury, fire, social damages, for example, by using the products.
(7) When using products for which damp-proof packing is required, observe the conditions (including shelf life
and amount of time let standing of unsealed items) agreed upon when specification sheets are individually
exchanged.
(8) This book may be not reprinted or reproduced whether wholly or partially, without the prior written
permission of Matsushita Electric Industrial Co., Ltd.
If you have any inquiries or questions about this book or our semiconductors, please contact one of our sales
offices listed at the back of this book.
Table of Contents
About This Manual
■
Composition of this book
This LSI application note explains in order of the sample program which used the program collection which uses the
circumference circuit of MN103S65G loading, and 3-phase PWM.
■Composition as a manual
This book is roughly divided and consists of a title, the text, a sample program, an inclusion directory, cautions
information, and reference information.
Next, the layout and definition of each portion are shown.
1.Inside title
2.Small title
It is the minimum block of this book.
3.Text
4.Sample program
5.Inclusion directory
The inclusion directory is shown although
the sample program is recorded on
CD-ROM.
The example of this page is a
thing for explanation. It differs
from an actual page.
2-7 Port0
A port 0 is general-purpose 8-bit input/output port, and can set up input and output per bit.
a port 0 -- input and output -- also in which setup, addition of a pull-up resistor is possible
Moreover, it can be used as a terminal of the serial communication 0 and the serial communication 1 as a special
function.
The bit 0-2 is made to serve a double purpose as an input-and-output terminal of the serial communication 0.
The bit 3-5 is made to serve a double purpose as an input-and-output terminal of the serial communication 2.
A bit 6-7 can be used as an input-and-output terminal as it is.
When using serial communication, a serial output signal terminal is set as an "output."
It is [ following ] a sample program.
/* Declaration of control data When using the serial communication 0,
the serial communication 0 carries out a UART setup and a clock for monitors,
and it is an output setup. Other bits are input-set up. */
#define p0port 0x05 /* 0b00000101 Serial output Other inputs */
#define p0pulup 0x00 /* 0b00000000 A pull-up is not carried out for all.*/
/* Declaration of control data When using serial ports 0 and 2,
the serial communication 0 carries out a UART setup and a clock for monitors,
and it is an output setup.
The serial communication 2 is synchronous system and a slave setup.
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-3-4 The check of interruption................................................................................................................... 2-7
2-4 A 8-bit 16-bit timer, a peripheral initial ...............................................................................................................2-30
2-4-1 The various registers of a 8-bit timer.......................................................................................................2-30
2-4-2 The various registers of a 16-bit timer.....................................................................................................2-40
2-5 Serial communication, a peripheral initial...........................................................................................................2-51
2-5-1 The various registers of serial communication (channels 0 and 1)........................................................2-51
2-5-2 The various registers of serial communication (channel 2)....................................................................2-53
2-6 PWM for motor control........................................................................................................................................2-63
2-7 The initial of I/O Port ........................................................................................................................................ 2-70
2-8 Noise filter function ................................................................................................................................................2-87
2-9 A/D conversion, a peripheral initial....................................................................................................................... 2-91
2-9-1 The various registers of A/D conversion.................................................................................................2-91
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
4-3 Such at the time ....................................................................................................................................................4-4
4-4 About use of MAKE............................................................................................................................................ 4-6
4-5 The notes on circuitry........................................................................................................................................... 4-7
4-5-1 About supply voltage ............................................................................................................................... 4-7
4-5-2 About an analog input terminal............................................................................................................... 4-7
4-6 The notes on program creation............................................................................................................................ 4-7
4-7 The usage of C compiler...................................................................................................................................... 4-8
4-8 Class figure ........................................................................................................................................................... 4-10