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

📄 main.asm

📁 ADSP 地层驱动
💻 ASM
字号:
/*****************************************************************************
**																			**
**	 Project Name: 	Video_Output											**	
**																			**
******************************************************************************

(C) Copyright 2006 - Analog Devices, Inc.  All rights reserved.

File Name:		Main.asm

Date Modified:	4/4/03		Rev 1.0

Software:       VisualDSP++4.5

Hardware:		ADSP-BF533 EZ-KIT Board

Special Connections:  None

Purpose:		This is an example ADSP-BF533 video output project that 
				initializes SDRAM memory, sets up the DMA configuration 
				registers to DMA data from SDRAM to the PPI, and configures 
				the PPI port for 656 output transmit mode.	
				
				This Main.asm file contains all the subroutine calls and 
				interrupt service handlers.
				
******************************************************************************/


#include "defBF533.h"
					

.section L1_data_a;

.byte ADV7171_data[48] = "zero.dat";	

// bit mapping of line type for PAL, 1 Vblank line 0 active line  
// 0,   32,  64,  96
// 128, 160, 192, 224
// 256, 288, 320, 352
// 384, 416, 448, 480
// 512, 544, 576, 608

.byte4 PalLineMap[20]  = 0x007FFFFF, 0x00000000, 0x00000000, 0x00000000, \
   0x00000000, 0x00000000, 0x00000000, 0x00000000, \
   0x00000000, 0xFF800000, 0x0000FFFF, 0x00000000, \
   0x00000000, 0x00000000, 0x00000000, 0x00000000, \
   0x00000000, 0x00000000, 0x00000000, 0xFFFF0000; 
.global PalLineMap;
   
// bit mapping of line type for NTSC, 1 Vblank line 0 active line    
// 0,   32,  64,  96
// 128, 160, 192, 224
// 256, 288, 320, 352  
// 384, 416, 448, 480
// 512

.byte4 NtscLineMap[17] = 

   0x0007FFFF, 0x00000000, 0x00000000, 0x00000000, \
   0x00000000, 0x00000000, 0x00000000, 0x00000000, \
   0x03FFFF00, 0x00000000, 0x00000000, 0x00000000, \
   0x00000000, 0x00000000, 0x00000000, 0x00000000, \
   0x00010000;
.global NtscLineMap;  
   
// SAV, EAV for active video   in field 1
// SAV, EAV for vertical blank in field 1
// SAV, EAV for active video   in field 2
// SAV, EAV for vertical blank in field 2
.byte4 SystemCodeMap[12] =  

   0xFF000080, 0xFF00009D, 1, \
   0xFF0000AB, 0xFF0000B6, 0, \
   0xFF0000C7, 0xFF0000DA, 1, \
   0xFF0000EC, 0xFF0000F1, 0; 
.global SystemCodeMap; 
   
// black
// blue 
// red  
// magenta
// green
// cyan
// yellow
// white
.byte4 ColorBarTable[8] =

   0x80108010,	\
   0xF0296E29,	\
   0x5A51F051, 	\
   0xCA6ADE6A, 	\
   0x36912291, 	\
   0xA6AA10AA, 	\
   0x10D292D2, 	\
   0x80EB80EB; 
.global ColorBarTable;

/*****************************************************************
 Program Define Section
****************************************************************/


/****************************************************************
 Main Program
****************************************************************/
.global _main;
.extern _NtscVideoOutFrameBuffInit;
.extern setup_sdram;
.extern setup_gptimer;
.extern config_dma;
.extern config_ppi;
.extern Flash_Setup_ADV_Reset;

.section L1_code;

_main:

	p0.l = lo(PLL_CTL);
	p0.h = hi(PLL_CTL);
	r1 = w[p0](z);
	r2 = r1;
	r0 = 0(z);
	
	r0.l = 0x81ff;
	r1 = r1 & r0;
	r0.l = (0x16) << 9; // Changing the MSEL to 594MHz
	r1 = r1 | r0;		// Default MESL is 270MHz
	
	w[p0] = r1;          // Apply PLL_CTL changes.
	ssync;
	
	// Because I am in the reset routine
	// there is no need to disable(cli)/enable(sti)
	// interrupts.
	
	idle;	// wait for Loop_count expired wake up
	ssync; // (no ssync required).


// reset from ADV7171 device (flashA portA bit 2) 

    CALL Flash_Setup_ADV_Reset;
    
	P0.L = lo(IMASK);
	P0.H = hi(IMASK);
	R0 = [P0];
	BITSET(R0,8);	
	[P0] = R0;			//Unmask DMA interrupt in Core Interrupt Controller.
	
	
	P0.L = lo(SIC_IMASK);
	P0.H = hi(SIC_IMASK);
	R0 = [P0];
	BITSET(R0,8);	
	[P0] = R0;			//Unmask DMA interrupt in System Interrupt Controller.
	
	//Setup PPI DMA interrupt vector location
	P0.L = lo(EVT8);
	P0.H = hi(EVT8);
	R0.L = DMA_ISR;	
	R0.H = DMA_ISR;
	[P0] = R0;
	
	CALL setup_sdram;
  	CALL _NtscVideoOutFrameBuffInit;  	
  	CALL config_dma;
  	CALL config_ppi;
	
	
	//Enable DMA
	P0.L = lo(DMA0_CONFIG);
	P0.H = hi(DMA0_CONFIG);	
	R0.L = W[P0];
	bitset(R0,0);	
	W[P0] = R0.L;
	ssync;
	
	//Enable PPI
	P0.L = lo(PPI_CONTROL);
	P0.H = hi(PPI_CONTROL);
	R0.L = W[P0];
	bitset(R0,0);		
	W[P0] = R0.L;
	
	IDLE;

do_nothing:  jump do_nothing;	
	
	
DMA_ISR:
	
	//Clear DMA Interrupt.
	P0.L = lo(DMA0_IRQ_STATUS);
	P0.H = hi(DMA0_IRQ_STATUS);
	R0.L = W[P0];
	BITSET(R0,0);	
	W[P0] = R0.L;
	
	RTI;
	
_main.END:	

⌨️ 快捷键说明

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