background image

Chapter 3

Microcomputer Basics 1

8-bit timer operation

III

43

    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) */
    }
}

Содержание MICROCOMPUTER MN103S

Страница 1: ...MICROCOMPUTER MN103S MN103S927 92A F92G LSI Application Notes Excerption Pub No 3329211 010E...

Страница 2: ......

Страница 3: ...e without notice for modification and or improvement At the final stage of your design purchasing or use of the products therefore ask for the most up to date Product Standards in advance to make sure...

Страница 4: ...ion please mount the finished device on a product and measure the power consumption And then mark it on the face plate and calculate a battery drive time Dual oscillation circuit provides low voltage...

Страница 5: ...Hardware allocation list Register description Flowchart Example program The following oscillation frequencies this document s sample programs use fosc 10 MHz fx 32 768 kHz More information Program CDs...

Страница 6: ...About This Manual3...

Страница 7: ...Table of Contents Chapter 1 Overview Chapter 2 Introduction Chapter 3 Microcomputer Basics 1 Chapter 4 Microcomputer Basics 2 Chapter 5 Appendix 1 2 3 4 5...

Страница 8: ...le system specifications and functions to be used 5 2 1 3 Sample program flowchart overview 6 2 2 Startup 7 2 3 Interrupt functions 11 2 4 Initial settings of variables 14 2 5 Initializing functions t...

Страница 9: ...executable EX files 75 2 9 1 Introduction of BAT files 75 2 10 System for developing this program 76 2 10 1 Development system configuration 76 Chapter 3 Microcomputer Basics 1 3 1 Chapter overview 2...

Страница 10: ...2 phase encoding 97 3 7 8 Count disable with TM8AIO external trigger 103 3 7 9 Timer 1 shot operation 107 3 7 10 Timer activation with TM8AIO external trigger 111 3 8 Synchronous serial interface ope...

Страница 11: ...iting in reading from EEPROM using synchronous serial interface 3 4 3 120 degrees power on PWM output 22 4 4 Sin wave PWM output using motor control PWM 37 Chapter 5 Appendix 5 1 Appendix 1 2 5 2 Appe...

Страница 12: ...Table of Contents 5...

Страница 13: ...al is detected 5 times an interrupt is generated and LED connected to P44 flashes The setting stored in the base register determines the number of rising edge detections that is counted until an inter...

Страница 14: ...Timer 0 underflow interrupt enable flag 0 Disabled 1 Enabled 7 6 5 G4IR1 Timer 1 underflow interrupt request flag 0 No interrupt request 1 Interrupt request 4 G4IR0 Timer 0 underflow interrupt reques...

Страница 15: ...TM1CNE Timer operation enable 0 Operation disabled 1 Operation enabled 6 TM1LDE Timer initialization 0 Normal operation 1 Initialization TM1BR value is loaded into TM1BC Timer pulse output 1 is reset...

Страница 16: ...ration Port 3 Output Mode Register P3MD 0x0000A033 bp Flag name Description 7 4 3 P33M Switching outputs 0 I O port 1 TM3IO 2 P32M Switching outputs 0 I O port 1 TM2IO 1 P31M Switching outputs 0 I O p...

Страница 17: ...count clock source Initialize CPU Set the base register Set Timer 1 input pin Select Timer 1 normal operation Set an interrupt level Enable the interrupt Start event Initialize Timer 1 int_timer1 Bina...

Страница 18: ...rs Unused Interrupt External interrupt Unused 2004 09 Rev 0 1 include sr103s92 h include int h Declaration of function void main void void initialize void After the assembler boot processing is comple...

Страница 19: ...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...

Страница 20: ...Microcomputer Web site We offer you technical information regarding microcomputers at http panasonic co jp semicon e micom Microcomputer Manual Download Site http panasonic co jp semicon e micom manua...

Страница 21: ...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 Malaysi...

Отзывы: