;The Num of Instruction(Size):77. The Max Address(Begin with 0):76 

                MCU  ES7P169C

A    equ    0
R    equ    1
HRAM_0X83  equ  0X83
HRAM_0X84  equ  0X84
HRAM_0XC0  equ  0Xc0
HRAM_0XC1  equ  0Xc1
HRAM_0XC2  equ  0Xc2
HRAM_0XC5  equ  0Xc5
HRAM_0XD1  equ  0Xd1
HRAM_0XD3  equ  0Xd3
HRAM_0XD4  equ  0Xd4
HRAM_0XD8  equ  0Xd8
HRAM_0XDC  equ  0Xdc
HRAM_0XDD  equ  0Xdd
HRAM_0XDE  equ  0Xde
HRAM_0XDF  equ  0Xdf
HRAM_0XE1  equ  0Xe1
HRAM_0XE2  equ  0Xe2

                ORG             0X00
HADR_0X0:
:0X0  c703f000                  AJMP            HADR_0X3
                                ORG             0X2
:0X2  6800                      GOTO            HADR_0X0
HADR_0X3:
;
;/*******************************************************
;函数名：void main(void)
;描  述：主函数，T31_CH1(PB5)/T31_CH1N(PB2)输出死区互补pwm，PB0高电平时T31_CH1输出低，T31_CH1N输出高，
;        PB1高电平刹车刹车自动关闭管脚输出功能，即刹车CHOE自动清0，重启需手动置CHOE为1
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void main(void) 
;{
;    RAMclear();
:0X3  e783                      CLR             HRAM_0X83
:0X4  ec00                      PAGE            (_RAMclear)>>11
:0X5  602b                      CALL            HADR_0X2B
:0X6  ec00                      PAGE            (_0)>>11
;    GPIOInit();
:0X7  ec00                      PAGE            (_GPIOInit)>>11
:0X8  603d                      CALL            HADR_0X3D
:0X9  ec00                      PAGE            (_1)>>11
;    T31C0H = 0xC2;          //T31C0H<6>(HTOEOFF)调试模式下需软件固定为1，死区发生器时钟频率tDTS=2*tCK_INT，PWM时钟源选择INTHRC
:0Xa  e5c2                      MOVI            0XC2
:0Xb  e6c2                      MOVA            HRAM_0XC2
;    T31C0L = 0x80;          //边沿计数模式，向上计数，使能T31CNTLD缓冲功能(即写入值在下一次更新事件时生效)
:0Xc  e580                      MOVI            0X80
:0Xd  e6c1                      MOVA            HRAM_0XC1
;    T31CH1C = 0xE8;         //通道1配置为输出，使能输出比较1清零，pwm1模式,使能TIM_CCR1缓冲功能 
:0Xe  e5e8                      MOVI            0XE8
:0Xf  e6d4                      MOVA            HRAM_0XD4
;    T31PINCL = 0x05;        //T31_CH1高电平有效，使能输出。T31_CH1N通道高电平有效，使能输出。
:0X10  e505                     MOVI            0X5
:0X11  e6d8                     MOVA            HRAM_0XD8
;    T31C2L = 0x08;          //禁止从模式,使能外部事件清除OCnREF
:0X12  e508                     MOVI            0X8
:0X13  e6c5                     MOVA            HRAM_0XC5
;    T31PRSH = 0x00;         //预分频系数1:16
:0X14  e7dd                     CLR             HRAM_0XDD
;    T31PRSL = 0x0F;
:0X15  e50f                     MOVI            0XF
:0X16  e6dc                     MOVA            HRAM_0XDC
;    T31CNTLDH = 0x03;       //重装载值，代表pwm周期长度
:0X17  e503                     MOVI            0X3
:0X18  e6df                     MOVA            HRAM_0XDF
;    T31CNTLDL = 0xE8;
:0X19  e5e8                     MOVI            0XE8
:0X1a  e6de                     MOVA            HRAM_0XDE
;    T31CH1RH = 0x01;        //比较寄存器1值，代表pwm占空比长度
:0X1b  e501                     MOVI            0X1
:0X1c  e6e2                     MOVA            HRAM_0XE2
;    T31CH1RL = 0x4D;
:0X1d  e54d                     MOVI            0X4D
:0X1e  e6e1                     MOVA            HRAM_0XE1
;    T31CHBK |= 0x30;        //使能高电平刹车
:0X1f  50bf                     MOV             _T31CHBK_0,     A                    ;_T31CHBK_0: Bank 511    Addr: 65471    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
:0X20  e130                     IORI            0X30
:0X21  e6bf                     MOVA            _T31CHBK_0                           ;_T31CHBK_0: Bank 511    Addr: 65471    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
;    T31DLYT = 0x7F;         //Tdtg=tDTS=2*tCK_INT,死区时间31.75us
:0X22  e57f                     MOVI            0X7F
:0X23  e6c0                     MOVA            HRAM_0XC0
;    HALT_PWM = 0;           //在线调试暂停状态下，PWM仍输出
:0X24  a8a7                     BCC             (_HALT_PWM_0)>>3,               0    ;(_HALT_PWM_0)>>3: Bank 511    Addr: 65447    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
;    UPT = 1;        //更新所有寄存器的缓冲器，使写入值立即生效
:0X25  a0d3                     BSS             HRAM_0XD3,      0
;    BKIC = 1;       //清刹车标志位
:0X26  a7d1                     BSS             HRAM_0XD1,      7
;    CHOE = 1;       //使能输出
:0X27  a7bf                     BSS             (_CHOE_0)>>3,   7                    ;(_CHOE_0)>>3: Bank 511    Addr: 65471    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
;    T31EN = 1;      //使能计数器
:0X28  a0c1                     BSS             HRAM_0XC1,      0
HADR_0X29:
;    while (1)
:0X29  c18b                     CWDT
;    }
:0X2a  6829                     GOTO            HADR_0X29
HADR_0X2B:
;/*******************************************************
;*Copyright(C),2020,Shanghai Eastsoft Microelectronics Co.,Ltd.
;*文件名：pwm_complementary_deadtime_INTHRC64M.c
;*作  者：AE Team
;*版  本：v1.0，编译于iDesigner(v4.2.3.166) + 工具链HRCC(v1.2.0.106)
;*日  期：2020/12/17
;*描  述：多功能定时器，PWM模式计时时钟源选择INTHRC，T31_CH1(PB5)/T31_CH1N(PB2)输出死区互补pwm，T31_ETR(PB0)高电平时T31_CH1输出低，
;        T31_CH1N输出高(与CH1P/CH1NP有关)，PB1高电平刹车。
;        注意：PWM模式调试状态下，须软件固定设置T31C0H<6>=1，否则PWM输出可能会异常。
;*备  注：对用户直接引用代码所带来的风险或后果不承担任何法律责任。
;*******************************************************/
;#include <hic.h>
;
;#define CLRWDT()   {__Asm CWDT;}        //宏定义清狗指令
;
;/******************************************************
;函数名：void RAMclear(void)
;描  述：RAM区数据清零，RAM区地址0x0000~0x03FF
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void RAMclear(void)
;{
;    for (IAAH=0; IAAH<=0x03; IAAH++)
:0X2b  e783                     CLR             HRAM_0X83
:0X2c  e782                     CLR             _IAAH_0                              ;_IAAH_0: Bank 511    Addr: 65410    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
HADR_0X2D:
:0X2d  5082                     MOV             _IAAH_0,        A                    ;_IAAH_0: Bank 511    Addr: 65410    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
:0X2e  ce03                     SUBI            0X3
:0X2f  9084                     JBS             HRAM_0X84,      0
:0X30  683c                     GOTO            HADR_0X3C
;    {
;        for (IAAL=0; IAAL<0xFF; IAAL++)
:0X31  e781                     CLR             _IAAL_0                              ;_IAAL_0: Bank 511    Addr: 65409    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
HADR_0X32:
:0X32  e5ff                     MOVI            0XFF
:0X33  ee81                     SUB             _IAAL_0,        A                    ;_IAAL_0: Bank 511    Addr: 65409    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
:0X34  9884                     JBC             HRAM_0X84,      0
:0X35  6839                     GOTO            HADR_0X39
;            IAD = 0x00;
:0X36  e780                     CLR             _IAD_0                               ;_IAD_0: Bank 511    Addr: 65408    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
:0X37  5581                     INC             _IAAL_0,        R                    ;_IAAL_0: Bank 511    Addr: 65409    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
:0X38  6832                     GOTO            HADR_0X32
HADR_0X39:
;        IAD = 0x00;
:0X39  e780                     CLR             _IAD_0                               ;_IAD_0: Bank 511    Addr: 65408    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
:0X3a  5582                     INC             _IAAH_0,        R                    ;_IAAH_0: Bank 511    Addr: 65410    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
;    }
:0X3b  682d                     GOTO            HADR_0X2D
HADR_0X3C:
;}
:0X3c  c183                     RET
HADR_0X3D:
;
;/******************************************************
;函数名：void GPIOInit(void)
;描  述：首先初始化所有未用到的IO口为输出低电平
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void GPIOInit(void)
;{
;    ANSL = 0xFF;        //选择对应端口为数字IO功能
:0X3d  e783                     CLR             HRAM_0X83
:0X3e  e5ff                     MOVI            0XFF
:0X3f  e6bc                     MOVA            _ANSL_0                              ;_ANSL_0: Bank 511    Addr: 65468    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
;	ANSH = 0xFF;        //选择对应端口为数字IO功能
:0X40  e5ff                     MOVI            0XFF
:0X41  e68d                     MOVA            _ANSH_0                              ;_ANSH_0: Bank 511    Addr: 65421    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
;    PAT = 0x00;         //所有IO设为输出低电平
:0X42  e7ad                     CLR             _PAT_0                               ;_PAT_0: Bank 511    Addr: 65453    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
;    PBT = 0x00;
:0X43  e7ae                     CLR             _PBT_0                               ;_PBT_0: Bank 511    Addr: 65454    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
;    PCT = 0x00;
:0X44  e7af                     CLR             _PCT_0                               ;_PCT_0: Bank 511    Addr: 65455    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
;    PA = 0x00;
:0X45  e7a8                     CLR             _PA_0                                ;_PA_0: Bank 511    Addr: 65448    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
;    PB = 0x00;
:0X46  e7a9                     CLR             _PB_0                                ;_PB_0: Bank 511    Addr: 65449    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
;    PC = 0x00;
:0X47  e7aa                     CLR             _PC_0                                ;_PC_0: Bank 511    Addr: 65450    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
;
;    PBT0 = 1;           //T31_ETR设为输入
:0X48  a0ae                     BSS             (_PBT0_0)>>3,   0                    ;(_PBT0_0)>>3: Bank 511    Addr: 65454    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
;    PBPD0 = 1;          //使能下拉
:0X49  a0b1                     BSS             (_PBPD0_0)>>3,  0                    ;(_PBPD0_0)>>3: Bank 511    Addr: 65457    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
;    PBT1 = 1;           //TIM1_BRK设为输入
:0X4a  a1ae                     BSS             (_PBT1_0)>>3,   1                    ;(_PBT1_0)>>3: Bank 511    Addr: 65454    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
;    PBPD1 = 1;
:0X4b  a1b1                     BSS             (_PBPD1_0)>>3,  1                    ;(_PBPD1_0)>>3: Bank 511    Addr: 65457    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\pwm_complementary_deadtime_INTHRC64M\debug\pwm_complementary_deadtime_INTHRC64M.obj 
;}
:0X4c  c183                     RET

                                END
