MICROCOMPUTER
MN103S
MN103S65G
LSI Application Note
Excerption
Pub.No.3326501-010E
Page 1: ...MICROCOMPUTER MN103S MN103S65G LSI Application Note Excerption Pub No 3326501 010E ...
Page 2: ...eptional 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 ...
Page 3: ...ignalterminalissetasan output Itis following asampleprogram Declarationofcontroldata Whenusingtheserialcommunication0 theserialcommunication0carriesoutaUARTsetupandaclockformonitors anditisanoutputsetup Otherbitsareinput setup define p0port 0x05 0b00000101Serialoutput Otherinputs define p0pulup 0x00 0b00000000Apull upisnotcarriedoutforall DeclarationofcontroldataWhenusingserialports0and2 theserial...
Page 4: ...Contents Chapter1 Power supply injection power onboot Initialization of the memory at the time 1 Chapter2 Each peripheral initial by C 2 3 Chapter3 The sample program in a sample circuit Chapter4 Appendix 4 VII ...
Page 5: ...uption 2 7 2 4 A8 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...
Page 6: ...ion 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 Chapter4 Appendix 4 1 Flash microcomputer 4 2 4 2 Purpose oriented initialization 4 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 progra...
Page 7: ...by the down counter TM0BC TM1BC TM3BC TM4BC TM5BC TM6BC TM7BC Timer mode register It is the 8 bit register which sets up the mode of a timer of operation The clock source which can be chosen by each timer is different Be careful of a setup TM0D Timer 0 mode register Bit7 Count operation permission 0 A stop of operation 1 Permission of operation Bit6 Base register setup 0 Usually operation 1 Initia...
Page 8: ...election 000 IOCLK 001 IOCLK 8 010 IOCLK 32 011 Cascade connection with a timer 0 100 Timer 0 underflow 101 Prohibition of a setup 110 Timer 2 underflow 111 TMIN1 terminal input TM2MD Timer 2 mode register Bit7 Timer operation permission 0 A 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 ...
Page 9: ...source selection 000 IOCLK 001 IOCLK 8 010 IOCLK 32 011 Cascade connection with a timer 2 100 Timer 0 underflow 101 Timer 1 underflow 110 Timer 0 underflow 111 TMIN3 terminal input TM4MD Timer 4 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...
Page 10: ...0 IOCLK 32 011 Cascade connection with a timer 4 100 Timer 4 underflow 101 Prohibition of a setup 110 Timer 6 underflow 111 TM5IN terminal input TM6MD Timer 6 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 6 is...
Page 11: ... Cascade connection with a timer 6 100 Timer 4 underflow 101 Timer 5 underflow 110 Timer 6 underflow 111 TM7IN terminal input TMMPSC Prescaler mode register Bit7 Count operation permission 0 Stop of operation 1 Permission of operation To use 1 8SYSCLK and 1 32SYSCLK a Prescaler control register needs to be set up When a TMnIO terminal input is chosen the rising edge of a terminal input is counted ...
Page 12: ...gned char 0x0000A145 Timer 4 register address declaration define TM4BC volatile unsigned char 0x0000A170 define TM4BR volatile unsigned char 0x0000A168 define TM4MD volatile unsigned char 0x0000A160 Timer 5 register address declaration define TM5BC volatile unsigned char 0x0000A171 define TM5BR volatile unsigned char 0x0000A169 define TM5MD volatile unsigned char 0x0000A161 Timer 6 register addres...
Page 13: ...ea60 60000 1 define TM0MD_LOAD2 0x42 read cycles min ratio clock source pre scaler 0 clock setup define TM1MD_LOAD2 0x03 timer 0 and cascade connection define TM0MD_STABLE2 0x02 stabilization define TM1MD_STABLE2 0x01 stabilization define TM0MD_START2 0x82 timer start define TM1MD_START2 0x81 timer start Interval timer by 8 bit timer Pre scaler 0 is used and the cascade connection of the timers 0 ...
Page 14: ...1BR volatile unsigned char 0x0000A149 define TM1MD volatile unsigned char 0x0000A141 Timer 2 register address declaration define TM2BC volatile unsigned char 0x0000A154 define TM2BR volatile unsigned char 0x0000A14C define TM2MD volatile unsigned char 0x0000A144 Timer 3 register address declaration define TM3BC volatile unsigned char 0x0000A155 define TM3BR volatile unsigned char 0x0000A14D define...
Page 15: ...t define TM1MD_STOP 0x00 timer stop define TM1_COUNT3 5 cycles min ratio setup 5 cycles min 1 define TM1MD_LOAD1 0x03 cycles min ratio reloaded define TM1MD_STABLE1 0x00 stabilization define TM1MD_START1 0x40 timer start define TM1MD_ENABLE1 0x80 timer permission define PS0_COUNT200 199 cycles min ratio setup 200 cycles min 1 define TM0_COUNT0x5f 0x5f cycles min ratio setup 0xea5f 0xea60 60000 1 d...
Page 16: ...1 TM0MD data count source setup input TMIN0 data TM0MD_START1 TM0MD data initialize timer LDE 1 data TM0MD_START1 TM0MD data Timer start LDE 0 data TM0MD_ENABLE1 TM0MD data Timer permission CNE 1 The sample of a 8 bit timer is recorded on attached CD ROM Inclusion directory program initial timecounter timer8 program timer8evt c 2 39 ...
Page 17: ...Issued by Matsushita Electric Industrial Co Ltd Matsushita Electric Industrial Co Ltd MN103S65G LSI Application Note Excerption March 2004 1st Edition ...
Page 18: ... 6 2284 6898 Penang Office Suite 20 07 20th Floor MWE Plaza No 8 Lebuh Farquhar 10200 Penang Malaysia Tel 60 4 201 5113 Fax 60 4 261 9989 Johore Sales Office Menara Pelangi Suite8 3A Level8 No 2 Jalan Kuning Taman Pelangi 80400 Johor Bahru Johor Malaysia Tel 60 7 331 3822 Fax 60 7 355 3996 Thailand Sales Office Panasonic Industrial Thailand Ltd PICT 252 133 Muang Thai Phatra Complex Building 31st ...