#include "mc32p7311.inc"

        org     0x00
        goto    start
    
        
start:      
        movai      0xff;P1output
        movra      OEP1
       
        movai      0xff;P1口数据全1
        movra      IOP1
        movai       0x01
        movra       MCR         ;外部中断0 下降沿中断
        movai       0x00
        movra       PWMCR0
        movai       0x90
        movra       ADCR1      ;AD采样频率FHIRC/32=1MHz  ,内部参考2V                
        movai       0x09
        movra       ADCR0 ;测内参2V时要开AD              
        
        bset      TC0EN
        bset      PWM0OE
        
        bset      PWMCR0,7   ; 允许PWM1 翻转输出到PWM0 故PWM0无需设置
        
        bset      TC1EN
        bset      PWM1OE
        movai     0x95
        movra     DRVCR   ;增强驱动能力选择                        
        
LOOP:         
         COMR   IOP1      ;测试32M 时，io翻转频率1M 即为准确值
         NOP
         GOTO   LOOP     
         
         END
