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.
The example of this page is a
thing for explanation. It differs
from an actual page.
Panasonic
2-7 Input and output, a peripheral initial
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.
Other bits are input-set up. */
#define p0port 0x0D /* 0b00001101 Bit0(CH0S),2(CH0CK),3(CH2S) */
#define p0pulup 0x00 /* 0b00000000 A pull-up is not carried out for all.*/
/* Declaration of the register address*/
#define P0OUT_adr 0x3F10
#define P0OUT (*(volatile unsigned char *)P0OUT_adr)
#define P0IN_adr 0x3F20
#define P0IN (*(volatile unsigned char *)P0IN_adr)
#define P0DIR_adr 0x3F30
#define P0DIR (*(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\
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.
IV