📄 core timer.asm
字号:
///////////////////////////////////////////////////////////////////////////////////////
//NAME: Core Timer.asm
//DATE: 9/18/03
//PURPOSE: Core timer example for the ADSP-21262 Ez-kit
//
//USAGE: Sets up the Core Timer and High Priority Interrupt
// Toggles the flags for each timer interrupt serviced.
////////////////////////////////////////////////////////////////////////////////////////
#include <def21262.h>
.global _main;
.global isr_timer;
#define N 0x1ffffff
.section/pm seg_pmco;
_main:
bit set IMASK TMZHI; // enable high priority timer interrupt
bit set LIRPTL PPIMSK; // enable parallel port interrupt
bit set MODE1 IRPTEN; // enable global interrupt
TPERIOD = N; // set TPERIOD and TCOUNT
TCOUNT = N;
//The 8 user LEDs on the ADSP-21262 EZ-Kit are mapped to flag
//pins as well as the parallel port AD0-7 pins, so we can use the parallel port
//to write the latch to light the LEDs
ustat3=0x1400000; dm(EIPP)=ustat3;
ustat3=1; dm(ECPP)=ustat3;
ustat3=0; dm(EMPP)=ustat3;
ustat3= PPTRAN| // transmit in 8-bit mode
PPBHC| // bus hold cycle
PPDUR20| // cycle duration
PPEN; // Enable for core driven transfer.
dm(PPCTL)=ustat3;
ustat3=0x55000000;
bit set MODE2 TIMEN; // enable core timer
_main.end: nop;
jump (pc,0); // wait here forever
//Timer ISR, toggle the LEDs
isr_timer:
nop;
bit tgl ustat3 0xFF000000;
dm(TXPP)=ustat3;
isr_timer.end: rti;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -