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

📄 main.asm

📁 ADI BLACKFIN BF533 的IIC驱动程序
💻 ASM
字号:
/*****************************************************************************************/
//
// Name: 	BF533 EZ-KIT video ITU-656 receive mode (8bit) for the Omnivision chip OV6630
//
/*****************************************************************************************

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

File Name:				Main.asm

Date Modified:			01/08/07		TL		Rev 2.0

Software:       		VisualDSP++4.5, Assembler 1.1.0.2, Linker 3.8.0.2

Hardware:				BF533 EZ-KIT Board (rev 1.2), Blackfin EZ-Extender (rev 1.2)

Chip:					ADSP-BF533 REV 0.2

Special Connections:  	Be aware that all the EZ-KIT LITE switches are off! Set the 
                        jumpers on the extender card as follows:
                        
					        JP1: Not populated
					        JP2: 1-2
					        JP3: 3-5; 4-6
					        JP4: 7-8
					        JP5: 1-2
					        JP6: 3-5; 4-6
					        JP7: Not populated
					        JP8: Not populated
					        JP9: 3-5; 4-6
					       JP10: Not populated
					       
					    For connection of Omnivision sensor:
					    Connect the EXT-KIT "Extender Card" to the ADSP-BF533 EZ-KIT LITE
						Connect also the Omnivision camera OV6630 or simular to the dedicated
                        header.    
						
                        For connection of ADV7183B from extender card please populate:
                        Make sure that no image sensor is connected to the board!
							JP3: 19-20
							
******************************************************************************************/

#include <defBF533.h>
	
/*****************************************************************************************/
// Program Variable Section
/*****************************************************************************************/
// place data in the section L1_data_a shown in the *.ldf
.section L1_data_a;

.var Recive_DMA_In_Progress = 0;
/*****************************************************************************************/
// Program Define Section
/*****************************************************************************************/
#define Omnivion_via_extender_card
//#define ADV7183A_via_EZ-KIT
//#define ADV7183B_via_extender_card

/*****************************************************************************************/
// Global and extern subroutines
/*****************************************************************************************/
.global		_main;
.global		Recive_DMA_In_Progress;
.extern     BF533_EZ_KIT_flash_setup;
.extern		BF533_EZ_KIT_Omnivision_reset;
.extern		Enable_ADV7183;
.extern		BF533_EZ_KIT_SDRAM_Config;
.extern		BF533_EZ_KIT_ISR_Config;
.extern		BF533_EZ_KIT_PPI_Input_Config;
.extern		BF533_EZ_KIT_DMA_Receive_Config;
.extern     Config_of_Omnivision;
.extern		Config_of_ADV7183;
.extern		Read_of_ADV7183_Config;
.extern		SCCB_In_Progress;
.extern		SCCB_Interface;
.extern		SCCB_DataOut;
/*****************************************************************************************/
// Main Program
/*****************************************************************************************/
// place code in the section L1_code shown in the *.ldf
.section L1_code;
_main:

	//some settings must be done to link the signals over the EZ-KIT to the EZ-Extender
    CALL BF533_EZ_KIT_flash_setup;			//setup the flashs GPIO pins
    
#ifdef ADV7183A_via_EZ-KIT
    CALL Enable_ADV7183;					// Enables the decoder output (OE) on the EZ-KIT
	CALL Config_of_ADV7183;					// Setup for all the SCCB registers
#endif

#ifdef ADV7183B_via_extender_card
	CALL Config_of_ADV7183;					// Setup for all the SCCB registers
#endif
	
#ifdef Omnivion_via_extender_card
	// Please be aware that the omnivision sensor cannot be read 
	// via I2C because the senor is not 100% I2C compliant
	CALL Config_of_Omnivision;				// Setup for all the SCCB registers
#endif

	CALL SCCB_Interface;					// Start SCCB Communication

// Wait while the I2C com is in progress		
I2C_LOOP1:
	NOP;
		
	p0.h = SCCB_In_Progress;				// takes care that the next transfer will not start
	p0.l = SCCB_In_Progress;				// before the last one ends
    r0 = [p0];   
    cc = r0 == 1;
if cc jump I2C_LOOP1;


#ifdef ADV7183A_via_EZ-KIT
    CALL Enable_ADV7183;					// Enable the decoder output (OE)
	CALL Read_of_ADV7183_Config;			// Setup for all the SCCB registers
	CALL SCCB_Interface;					// Start SCCB Communication
#endif	

#ifdef ADV7183B_via_extender_card
	CALL Read_of_ADV7183_Config;			// Setup for all the SCCB registers
	CALL SCCB_Interface;					// Start SCCB Communication
#endif	


// Wait while the I2C com is in progress		
I2C_LOOP2:
	NOP;
		
	p0.h = SCCB_In_Progress;				// takes care that the next transfer will not start
	p0.l = SCCB_In_Progress;				// before the last one ends
    r0 = [p0];   
    cc = r0 == 1;
if cc jump I2C_LOOP2;

	p0.l = SCCB_DataOut;
	p0.h = SCCB_DataOut;
	r0 = [p0];

	CALL BF533_EZ_KIT_ISR_Config;			// Configure the Interrupt service routine for DMA interrupt
  
  // The SDRAM Config Routine can just be taken if the option "Use XML Values" 
  // at Settings/Target Options is de-tagged.
//  CALL BF533_EZ_KIT_SDRAM_Config;	

  
	// The SDRAM will be filled with zeros for test purposes.    
	p2.h=0x27;
	p2.l = 0xDF92;
	p1 = 0;
	R1 = 0;
	LSETUP(SDRAM_Fill_Zero_Start, SDRAM_Fill_Zero_End) LC0 = P2;
SDRAM_Fill_Zero_Start:
SDRAM_Fill_Zero_End: 	[p1++] = R1;

 
  
  	//Configure DMA.
  CALL BF533_EZ_KIT_DMA_Receive_Config;
  
    //Configure and start the PPI finally
  CALL BF533_EZ_KIT_PPI_Input_Config;	

      

	idle;

END_TEST:
 	NOP;
	NOP;
	JUMP END_TEST;





_main.END:    	

⌨️ 快捷键说明

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