?? ht48f06edemo.c
字號:
/*******************************************************************************
*
* Filename:EEPROM.c
*
* Author: Ricky
* Company: Holtek
* Case:
* Device: HT48F06E
* Date: 2007/01/18
* Modifier: Maggie (Holtek)
* Modify Date: 2007/01/18
* Visions: 1.0
* Compiler: HT-IDE3000 V6.5
* Clock: 4MHz Cystral
*
********************************************************************************
*
* Function:
* HT48F06E Read/Write EEPROM data memory Example Program
*
********************************************************************************
*
* Pin assignemt:
*
*******************************************************************************/
#include "HT48F06EDEMO.h"
/******************************************************************************/
/*Main program area */
/******************************************************************************/
void main(void)
{
UC EEADDR;
_bp = 1;
_mp1 = 0x40;
EWEN();
ERAL(); //Test1, Erase All test
for(EEADDR=0 ; EEADDR<0x80 ; EEADDR++)
{
if(READ(EEADDR) != 0xff)
goto Error;
}
ERAL(); //Test2, Write All using 55 test
WRAL(0x55);
for(EEADDR=0 ; EEADDR<0x80 ; EEADDR++)
{
if(READ(EEADDR) != 0x55)
goto Error;
}
ERAL(); //Test3, Write All using AA test
WRAL(0xaa);
for(EEADDR=0 ; EEADDR<0x80 ; EEADDR++)
{
if(READ(EEADDR) != 0xaa)
goto Error;
}
for(EEADDR=0 ; EEADDR<0x80 ; EEADDR=EEADDR+2) //Test4, Write one by one using 55 and AA test
{
WRITE(EEADDR, 0x55);
WRITE(EEADDR+1, 0xaa);
}
for(EEADDR=0 ; EEADDR<0x80 ; EEADDR=EEADDR+2)
{
if(READ(EEADDR) != 0x55)
goto Error;
if(READ(EEADDR+1) != 0xaa)
goto Error;
}
for(EEADDR=0 ; EEADDR<0x80 ; EEADDR++) //Test5, Write one by one using ADDRESS as the writing data test
{
WRITE(EEADDR, EEADDR);
}
for(EEADDR=0 ; EEADDR<0x80 ; EEADDR++)
{
if(READ(EEADDR) != EEADDR)
goto Error;
}
//----- if all pass, program will run here. User can set breakpoint here
OK:
EWDS();
while(1);
//----- if any Error, program will jump here. User can set breakpoint here
Error:
EWDS();
while(1);
}
/******************************************************************************/
/*Sub program area */
/******************************************************************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -