亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? sst25vf040_2005.txt

?? sst25vf040接口程序 可作為單片機(jī)與FPGA通信接口
?? TXT
?? 第 1 頁 / 共 3 頁
字號:
Software Driver

SST25VF040B 4 Mbit(512K x 8) Serial Flash Memory

November 4th, 2005, Rev. 1.0

ABOUT THE SOFTWARE
This application note provides software driver examples for SST25VF040B,
Serial Flash. Extensive comments are included in each routine to describe 
the function of each routine.  The interface coding uses polling method 
rather than the SPI protocol to interface with these serial devices.  The
functions are differentiated below in terms of the communication protocols
(uses Mode 0) and specific device operation instructions. This code has been 
designed to compile using the Keil compiler.


ABOUT THE SST25VF040B

Companion product datasheets for the SST25VF040B should be reviewed in 
conjunction with this application note for a complete understanding 
of the device.


Device Communication Protocol(pinout related) functions:

Functions                    		Function
------------------------------------------------------------------
init					Initializes clock to set up mode 0.
Send_Byte				Sends one byte using SI pin to send and 
						shift out 1-bit per clock rising edge
Get_Byte				Receives one byte using SO pin to receive and shift 
						in 1-bit per clock falling edge
Poll_SO					Used in the polling for RY/BY# of SO during AAI programming
CE_High					Sets Chip Enable pin of the serial flash to high
CE_Low					Clears Chip Enable of the serial flash to low
Hold_Low				Clears Hold pin to make serial flash hold
Unhold					Unholds the serial flash
WP_Low					Clears WP pin to make serial flash write protected
UnWP					Disables write protection pin

Note:  The pin names of the SST25VF040B are used in this application note. The associated test code
will not compile unless these pinouts (SCK, SI, SO, SO, CE, WP, Hold) are pre-defined on your
software which should reflect your hardware interfaced. 	 


Device Operation Instruction functions:

Functions                    		Function
------------------------------------------------------------------
Read_Status_Register	Reads the status register of the serial flash
EWSR					Enables the Write Status Register
WRSR					Performs a write to the status register
WREN					Write enables the serial flash
WRDI					Write disables the serial flash
EBSY					Enable SO to output RY/BY# status during AAI programming
DBSY					Disable SO to output RY/BY# status during AAI programming
Read_ID					Reads the manufacturer ID and device ID
Jedec_ID_Read			Reads the Jedec ID
Read					Reads one byte from the serial flash and returns byte(max of 25 MHz CLK frequency)
Read_Cont				Reads multiple bytes(max of 25 MHz CLK frequency)
HighSpeed_Read			Reads one byte from the serial flash and returns byte(max of 50 MHz CLK frequency)
HighSpeed_Read_Cont		Reads multiple bytes(max of 50 MHz CLK frequency)
Byte_Program			Program one byte to the serial flash
Auto_Add_IncA			Initial Auto Address Increment process
Auto_Add_IncB			Successive Auto_Address_Increment process after AAI initiation
Auto_Add_IncA_EBSY		Initial Auto Address Increment process with EBSY
Auto_Add_IncB_EBSY		Successive Auto_Address_Increment process after AAI initiation with EBSY and WRDI/DBSY
Chip_Erase				Erases entire serial flash
Sector_Erase			Erases one sector (4 KB) of the serial flash
Block_Erase_32K			Erases 32 KByte block memory of the serial flash
Block_Erase_64K			Erases 64 KByte block memory of the serial flash
Wait_Busy				Polls status register until busy bit is low
Wait_Busy_AAI			Polls status register until busy bit is low for AAI programming
WREN_Check				Checks to see if WEL is set
WREN_AAI_Check			Checks to see if WEL and AAI mode is set



                                                                     
"C" LANGUAGE DRIVERS 

/********************************************************************/
/* Copyright Silicon Storage Technology, Inc. (SST), 1994-2005	    */
/* Example "C" language Driver of SST25VF040B Serial Flash			*/
/* Conrado Canio, Silicon Storage Technology, Inc.                  */
/*                                                                  */
/* Revision 1.0, November 4th, 2005			  						*/   
/*                                                                  */
/*																	*/
/********************************************************************/

#include <stdio.h>
#include <stdlib.h>

/* Function Prototypes */

void init();
void Send_Byte(unsigned char out);
unsigned char Get_Byte();
void Poll_SO();
void CE_High();
void CE_Low();
void Hold_Low();
void Unhold();
void WP_Low();
void UnWP();
unsigned char Read_Status_Register();
void EWSR();
void WRSR(byte);
void WREN();
void WRDI();
void EBSY();
void DBSY();
unsigned char Read_ID(ID_addr);
unsigned long Jedec_ID_Read(); 
unsigned char Read(unsigned long Dst);
void Read_Cont(unsigned long Dst, unsigned long no_bytes);
unsigned char HighSpeed_Read(unsigned long Dst); 
void HighSpeed_Read_Cont(unsigned long Dst, unsigned long no_bytes);
void Byte_Program(unsigned long Dst, unsigned char byte);
void Auto_Add_IncA(unsigned long Dst, unsigned char byte1, unsigned char byte2);
void Auto_Add_IncB(unsigned char byte1, unsigned char byte2);
void Auto_Add_IncA_EBSY(unsigned long Dst, unsigned char byte1, unsigned char byte2);
void Auto_Add_IncB_EBSY(unsigned char byte1, unsigned char byte2);
void Chip_Erase();
void Sector_Erase(unsigned long Dst);
void Block_Erase_32K(unsigned long Dst);
void Block_Erase_64K(unsigned long Dst);
void Wait_Busy();
void Wait_Busy_AAI();
void WREN_Check();
void WREN_AAI_Check();

void Verify(unsigned char byte, unsigned char cor_byte);

unsigned char idata upper_128[128];		/* global array to store read data */
										/* to upper RAM area from 80H - FFH */

/************************************************************************/
/* PROCEDURE: init														*/
/*																		*/
/* This procedure initializes the SCK to low. Must be called prior to 	*/
/* setting up mode 0.													*/
/*																		*/
/* Input:																*/
/*		None															*/
/*																		*/
/* Output:																*/
/*		SCK																*/
/************************************************************************/
void init()
{
	SCK = 0;	/* set clock to low initial state */
}

/************************************************************************/
/* PROCEDURE: Send_Byte													*/
/*																		*/
/* This procedure outputs a byte shifting out 1-bit per clock rising	*/
/* edge on the the SI pin(LSB 1st).										*/
/*																		*/
/* Input:																*/
/*		out																*/
/*																		*/
/* Output:																*/
/*		SI																*/
/************************************************************************/
void Send_Byte(unsigned char out)
{
	
	unsigned char i = 0;
	for (i = 0; i < 8; i++)
	{
		
		if ((out & 0x80) == 0x80)	/* check if MSB is high */
			SI = 1;
		else
			SI = 0;					/* if not, set to low */
		SCK = 1;					/* toggle clock high */
		out = (out << 1);			/* shift 1 place for next bit */
		SCK = 0;					/* toggle clock low */
	}
}

/************************************************************************/
/* PROCEDURE: Get_Byte													*/
/*																		*/
/* This procedure inputs a byte shifting in 1-bit per clock falling		*/
/* edge on the SO pin(LSB 1st).											*/
/*																		*/
/* Input:																*/
/*		SO																*/
/*																		*/
/* Output:																*/
/*		None															*/
/************************************************************************/
unsigned char Get_Byte()
{
	unsigned char i = 0, in = 0, temp = 0;
	for (i = 0; i < 8; i++)
	{
		in = (in << 1);		/* shift 1 place to the left or shift in 0 */
		temp = SO;			/* save input */
		SCK = 1;			/* toggle clock high */
		if (temp == 1)			/* check to see if bit is high */
			in = in | 0x01;		/* if high, make bit high */

		SCK = 0;			/* toggle clock low */

	}
	return in;
}

/************************************************************************/
/* PROCEDURE: Poll_SO													*/
/*																		*/
/* This procedure polls for the SO line during AAI programming			*/
/* waiting for SO to transition to 1 which will indicate AAI programming*/
/* is completed															*/
/*																		*/
/* Input:																*/
/*		SO																*/
/*																		*/
/* Output:																*/
/*		None															*/
/************************************************************************/
void Poll_SO()
{
	unsigned char temp = 0;
	CE_Low();
	while (temp == 0x00)	/* waste time until not busy */
		temp = SO;
	CE_High();
}

/************************************************************************/
/* PROCEDURE: CE_High													*/
/*																		*/
/* This procedure set CE = High.										*/
/*																		*/
/* Input:																*/
/*		None															*/
/*																		*/
/* Output:																*/
/*		CE																*/
/*																		*/
/************************************************************************/
void CE_High() 
{
	CE = 1;				/* set CE high */
}

/************************************************************************/
/* PROCEDURE: CE_Low													*/
/*																		*/
/* This procedure drives the CE of the device to low.  					*/
/*																		*/
/* Input:																*/
/*		None															*/
/*																		*/
/* Output:																*/
/*		CE																*/
/*																		*/
/************************************************************************/
void CE_Low() 
{	
	CE = 0;				/* clear CE low */
}

/************************************************************************/
/* PROCEDURE: Hold()													*/
/*																		*/
/* This procedure clears the Hold pin to low.							*/
/*																		*/
/* Input:																*/
/*		None															*/
/*																		*/
/* Output:																*/
/*		Hold															*/
/************************************************************************/
void Hold_Low()
{
	Hold = 0;			/* clear Hold pin */
}

/************************************************************************/
/* PROCEDURE: Unhold()													*/
/*																		*/
/* This procedure sets the Hold pin to high.							*/
/*																		*/
/* Input:																*/
/*		None															*/
/*																		*/
/* Output:																*/
/*		Hold															*/
/************************************************************************/
void Unhold()
{
	Hold = 1;			/* set Hold pin */
}

/************************************************************************/
/* PROCEDURE: WP()														*/
/*																		*/
/* This procedure clears the WP pin to low.								*/
/*																		*/
/* Input:																*/
/*		None															*/
/*																		*/
/* Output:																*/
/*		WP																*/
/************************************************************************/
void WP_Low()
{
	WP = 0;				/* clear WP pin */
}

/************************************************************************/
/* PROCEDURE: UnWP()													*/
/*																		*/
/* This procedure sets the WP pin to high.								*/
/*																		*/
/* Input:																*/
/*		None															*/
/*																		*/
/* Output:																*/
/*		WP																*/
/************************************************************************/
void UnWP()
{
	WP = 1;				/* set WP pin */
}

/************************************************************************/
/* PROCEDURE: Read_Status_Register										*/
/*																		*/
/* This procedure read the status register and returns the byte.		*/
/*																		*/
/* Input:																*/
/*		None															*/
/*																		*/
/* Returns:																*/
/*		byte															*/
/************************************************************************/
unsigned char Read_Status_Register()
{
	unsigned char byte = 0;
	CE_Low();				/* enable device */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃一区二区三区在线观看| 午夜精品福利久久久| 91精品婷婷国产综合久久竹菊| 不卡的av网站| 高清beeg欧美| 国产精品456| 国产成人三级在线观看| 国产曰批免费观看久久久| 久久精品国产**网站演员| 奇米影视在线99精品| 久久激情五月婷婷| 激情综合色播五月| 久久99精品久久久久婷婷| 精品系列免费在线观看| 国产一区二区不卡在线| 成人久久18免费网站麻豆 | 亚洲精品欧美专区| 亚洲视频在线一区| 亚洲国产成人精品视频| 天天爽夜夜爽夜夜爽精品视频| 男男视频亚洲欧美| 国产激情视频一区二区在线观看| 国产69精品一区二区亚洲孕妇| 成人爽a毛片一区二区免费| 99久久精品国产导航| 欧美在线高清视频| 精品入口麻豆88视频| 国产人妖乱国产精品人妖| 亚洲欧美日韩成人高清在线一区| 一区二区成人在线| 久久99精品久久只有精品| 国产+成+人+亚洲欧洲自线| 色综合色狠狠综合色| 欧美视频完全免费看| 日韩欧美国产综合一区| 国产精品久久毛片| 日韩影院精彩在线| 国产精品99久久久久久有的能看| 99久久99精品久久久久久| 欧美视频中文字幕| 久久久久久久久久久久久夜| 亚洲精品一卡二卡| 久久精品国产免费| 日本高清不卡aⅴ免费网站| 日韩欧美激情在线| 亚洲综合色噜噜狠狠| 国产乱码一区二区三区| 欧美优质美女网站| 久久午夜电影网| 天堂va蜜桃一区二区三区 | 91啦中文在线观看| 日韩美女视频在线| 亚洲一区二区三区国产| 国产精品正在播放| 在线播放中文一区| 亚洲麻豆国产自偷在线| 国产一区二区三区| 欧美精品在线观看一区二区| 136国产福利精品导航| 国产原创一区二区| 欧美大黄免费观看| 亚洲成人免费影院| 色综合夜色一区| 久久久久久久av麻豆果冻| 中文字幕av资源一区| 91麻豆精品国产91久久久使用方法 | 欧美色视频在线| 亚洲精品高清视频在线观看| 狠狠色综合色综合网络| 欧美一区二区三区色| 亚洲国产欧美另类丝袜| 在线一区二区三区| 亚洲欧洲韩国日本视频| 成人小视频免费观看| 久久香蕉国产线看观看99| 久久精品国产第一区二区三区| 欧美日韩电影一区| 性久久久久久久久久久久| 在线观看91精品国产入口| 中文字幕中文字幕一区| 国产在线不卡视频| 久久一二三国产| 精品一区二区三区免费毛片爱 | 亚洲国产精品精华液2区45| 韩国三级在线一区| 日韩欧美国产午夜精品| 免费高清在线一区| 久久影院午夜片一区| 国产精品自拍av| 日本一区二区久久| 北条麻妃国产九九精品视频| 久久色.com| 成人免费毛片嘿嘿连载视频| 国产精品久久久久久久久快鸭| 99视频一区二区| 亚洲综合清纯丝袜自拍| 884aa四虎影成人精品一区| 久久国产夜色精品鲁鲁99| 精品成人一区二区三区| 国产一二精品视频| 日本一区二区三区视频视频| 91视频一区二区三区| 亚洲成人久久影院| 日韩欧美亚洲另类制服综合在线| 国产在线不卡视频| 亚洲视频图片小说| 91精品国产一区二区人妖| 激情偷乱视频一区二区三区| 国产精品久久777777| 欧美日韩国产美女| 韩国女主播成人在线| 自拍视频在线观看一区二区| 欧美三区在线视频| 九色porny丨国产精品| 国产精品美女久久久久久久久久久| 色哟哟一区二区三区| 久久精品国产网站| 亚洲天堂免费在线观看视频| 91精品国产综合久久精品图片| 国产真实乱子伦精品视频| 1024精品合集| 欧美成人一区二区| a在线欧美一区| 日韩电影在线观看一区| 国产精品美日韩| 欧美一区二区三区在线观看| 成a人片国产精品| 日韩制服丝袜av| 国产精品福利一区| 精品国内二区三区| 欧美日韩一区中文字幕| 成人a免费在线看| 视频一区视频二区中文字幕| 亚洲国产电影在线观看| 欧美一区二区免费视频| 91原创在线视频| 裸体一区二区三区| 亚洲国产日韩一级| 自拍偷拍国产精品| 国产欧美一区二区三区网站 | 亚洲美女免费视频| 国产三级三级三级精品8ⅰ区| 欧美日韩免费观看一区三区| 成人性色生活片免费看爆迷你毛片| 手机精品视频在线观看| 亚洲激情av在线| 国产欧美日韩另类一区| 日韩欧美中文一区| 欧美日韩mp4| 欧美日韩中字一区| 色中色一区二区| 成人高清免费在线播放| 国产老妇另类xxxxx| 奇米一区二区三区| 日韩成人免费看| 午夜精品成人在线| 天天综合色天天综合| 亚洲成人午夜影院| 亚洲自拍与偷拍| 亚洲国产一二三| 亚洲综合一区在线| 亚洲美女屁股眼交3| 亚洲男人的天堂在线观看| 中文字幕一区二区三区精华液| 久久久久久久久久久电影| 精品国产乱码久久久久久图片| 欧美私人免费视频| 欧美性生活久久| 在线影视一区二区三区| 日本韩国欧美一区二区三区| 在线一区二区观看| 欧美色综合天天久久综合精品| 日本高清无吗v一区| 欧美日韩亚洲综合在线| 在线播放亚洲一区| 亚洲精品一区二区三区四区高清| 欧美一二三在线| 欧美成人r级一区二区三区| 精品三级在线看| 国产亚洲精品aa午夜观看| 国产精品女人毛片| 日韩美女精品在线| 亚洲国产精品久久久久婷婷884| 亚洲一级二级在线| 美女国产一区二区三区| 国产麻豆成人传媒免费观看| 国产成人精品影视| 99免费精品在线观看| 欧美中文字幕一区| 欧美酷刑日本凌虐凌虐| 精品国产一区二区三区av性色| 精品国产乱码久久久久久浪潮| 精品国产sm最大网站免费看| 日本一区二区三区在线观看| 亚洲男帅同性gay1069| 视频在线观看一区二区三区| 国产一区二区三区久久久| 92精品国产成人观看免费| 欧美美女视频在线观看| 国产日韩高清在线|