📄 blink_code.asm
字号:
/******************************************************************************
(C) Copyright 2003 - Analog Devices, Inc. All rights reserved.
File Name: Boot_Blink_Code.ASM
Date Modified: 7/11/03 Rev 1.0
Purpose: This blink example is being used to explain how to create a
loader file. The loader file will be programmed into the flash
on the ADSP-BF533 Ez-Kit Lite. Upon RESET, code will be booted
into the start of L1 memory.
This example includes the use of initialization code which, in
the case, will be Sdram initialization. Upon RESET, the On-Chip
Boot Rom will load in the Init Code into internal L1 memory. It
will make a CALL to this code and after execution, the processor
will jump back to the On-Chip Boot Rom for application code
booting. The application code is a blink program which resides
in Sdram Memory.
*******************************************************************************/
#include <defBF533.h>
/******************************************************************************
FLASH A Port B Controls: 0 = LED OFF; 1 = LED ON
Bit0: LED4
Bit1: LED5
Bit2: LED6
Bit3: LED7
Bit4: LED8
Bit5: LED9
*******************************************************************************/
#define Flash_A_Registers 0x20270000 //Base Address for Flash A Registers
#define PortB_Data_Out 0x00000005 //offset
#define PortB_Data_Dir 0x00000007 //offset
#define Delay 0x1FFFFFF //Loop Delay
.section program;
P0.H = START;
P0.H = START;
JUMP(P0);
.section sdram;
START:
P0.H = HI(EBIU_AMGCTL);
P0.L = LO(EBIU_AMGCTL);
R0.L = W[P0];
//Enable all AMS Banks
R1 = 0xE;
R0 = R0 | R1;
W[P0] = R0.L;
//Set all Flags as Outputs
P1.H = HI(Flash_A_Registers);
P1.L = LO(Flash_A_Registers) + PortB_Data_Dir;
R0 = 0xFF;
B[P1] = R0;
//Turn On LEDs
P1.H = HI(Flash_A_Registers);
P1.L = LO(Flash_A_Registers) + PortB_Data_Out;
R0 = 0x7;
//Initialize Loop Counter
P2.H = HI(Delay);
P2.L = LO(Delay);
Blink_Loop:
//Write Port B
B[P1] = R0;
LSETUP(Delay_Start, Delay_End) LC0 = P2;
Delay_Start:
Delay_End: NOP;
//Toggle LEDs
R0 = ~R0;
JUMP Blink_Loop;
//End Label
START.END: NOP;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -