⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tms470r1b1m_het_pwm_02_h.het

📁 TMS-FET470B1M C Examples
💻 HET
字号:
;*******************************************************************************
;  TMS470 Demo -  HET PWM Sample Program
;
;  Program name : tms470r1b1m_HET_PWM_02_H.het, associated with
;                 tms470r1b1m_HET_PWM_02.c
;
;  This is a simple HET program that generates a PWM and interrupt
;  using the ECMP instruction to generate pulses on HET on HET0 (CC0)lighting
;  the corresponding LED and sends an interrupt to synchronously update the
;  new duty cycle.
;
;  J.Mangino
;  Texas Instruments, Inc
;  July 29th 2005
;  Built with IAR Embedded Workbench Version: 4.30A
;*******************************************************************************

; Implement a counter that uses register A and rolls over at 0x214A
L00: CNT  {next=L01, reg=A, irq=OFF, max=0x214A, data=0}

; PWM (50% duty cycle)
L01: ECMP {next=L02, reg=A, hr_lr=LOW, en_pin_action=ON, pin=CC0, action=PULSELO,
           irq=Off, data=0x10A5}

; When count reaches 0, trigger interrupt. Now the ISR loads
; a new data value into the MOV32 instruction.
L02: ECMP {next=L03, reg=A, hr_lr=LOW, en_pin_action=OFF, pin=CC0,
           cond_addr=L03, irq=ON, data=0x0 }


; When count reaches 0x214A, load the next ECMP compare value used
; for PWM generation.
L03: ECMP {next=L00, reg=A, hr_lr=LOW, en_pin_action=OFF, pin=CC0,
           cond_addr=L04, irq=OFF, data=0x214A }

; Load ECMP data value with the value stored in the MOV32 instruction
L04: MOV32 {next=L00, remote=L01, control=OFF, init=OFF, type=IMTOREG&REM,
            reg=NONE, data=0x0, hr_data=0x0}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -