專注電子技術(shù)學(xué)習(xí)與研究
當(dāng)前位置:單片機(jī)教程網(wǎng) >> MCU設(shè)計(jì)實(shí)例 >> 瀏覽文章

單片機(jī)訪問外部RAM原程序

作者:佚名   來源:本站原創(chuàng)   點(diǎn)擊數(shù):  更新時(shí)間:2013年11月01日   【字體:

//-----------------------定義尋址的基址--------------------------------------------------------
#define base_Adr 0x060000
//-----------------------定義地址指針,指向基址--------------------------------------------------------
unsigned char xdata *ORAM_base_Adr = base_Adr;
//------------------------------------------------------------------------------------------------------
// 函數(shù)名稱 ORAM_write
// 入口函數(shù) SJAREG_ADR,setting
// 出口函數(shù) 無
// 函數(shù)功能 寫外部數(shù)據(jù)存儲(chǔ)區(qū)
//------------------------------------------------------------------------------------------------------
void ORAM_write(unsigned char ORAM _ADR, unsigned char setting)
{
*( ORAM _base_Adr+ ORAM _ADR)=setting;
}
//------------------------------------------------------------------------------------------------------
// 函數(shù)名稱 ORAM _read
// 入口函數(shù) ORAM _ADR
// 出口函數(shù) ORAM _data
// 函數(shù)功能 讀外部數(shù)據(jù)存儲(chǔ)區(qū)
//------------------------------------------------------------------------------------------------------
unsigned char ORAM _read(unsigned char ORAM _ADR)
{
unsigned char ORAM _data;
ORAM _data=*( ORAM _base_Adr+ ORAM _ADR);
return(ORAM _data);
}  

關(guān)閉窗口

相關(guān)文章