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

📄 het_pcnt_01_h.het

📁 tmp470开发板的源程序
💻 HET
字号:
;******************************************************************************
;  TMS470 Demo -  HET PCNT Sample Program
;
;  Program name :  HET_PCNT_01_H.het associated with C program HET_PCNT_01.c
;
;  This program uses the PCNT instruction to determine the width of a pulse.
;  The pulse is generated by the HET on CC0 and read back into the HET on CC2.
;  When the pulse width is valid the HET will trigger an interrupt.
;  At this point the data may be viewed. Pins CC0 and CC2 must be connected
;  together. These are HET0 and HET2 on the TMS470R1VFA256 EVM. You may use
;  the jumpers to connect these two pins together.
;
;  John Mangino / Andreas Dannenberg
;  Texas Instruments, Inc
;  May 2005
;  Built with IAR Embedded Workbench Version: 4.20A
;  A256 EVM
;*******************************************************************************

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

; Create a pulse starting at count 0x1000
L01: ECMP {next=L02, reg=A, hr_lr=LOW, en_pin_action=ON, pin=CC2, action=SET, irq=Off, data=0x1000}

; Reset the pulse at 0x3000
L02: ECMP {next=L03, reg=A, hr_lr=LOW, en_pin_action=ON, pin=CC2, action=CLEAR, irq=Off, data=0x3000}

; Get the pulse count value and trigger an interrupt
L03: PCNT {next=L04, irq=ON, type=RISE2FALL, pin=CC0}
L04: BR	  {next=L00, cond_addr=L00, event=NOCOND}


⌨️ 快捷键说明

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