中级会员
- 积分
- 472
- 威望
- 237
- 贡献
- 155
- 兑换币
- 149
- 注册时间
- 2013-9-12
- 在线时间
- 40 小时
|
#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
#include "DP_Flash.h"
uint Arr[4]={0x1111,0x2222,0x3333,0x4444};
uint Arr0[4];
ulong address=0x007E0000;
uint addr = 0x0000;
void main(void)
{
PORTB_PB0 =1;
DDRB_DDRB0=1;
EnableInterrupts;
Flash_Init();
/* //此处几句用来测试Dflash擦除与写入
DFlash_Erase_Sector(addr);
DFlash_Write_Phrase(addr+16,Arr);
Arr0[0]=DFlash_Read(addr+16);
Arr0[1]=DFlash_Read(addr+18);
Arr0[2]=DFlash_Read(addr+20);
Arr0[3]=DFlash_Read(addr+22);
*/
//此处几句用来测试Pflash擦除与写入
// PFlash_Erase_Sector(address);
// PFlash_Write_Phrase(address,Arr);
Arr0[0]=PFlash_Read(address);
Arr0[1]=PFlash_Read(address+2);
Arr0[2]=PFlash_Read(address+4);
Arr0[3]=PFlash_Read(address+6);
if(Arr0[0]==0x1111 && Arr0[1]==0x2222 && Arr0[2]==0x3333 && Arr0[3]==0x4444)
PORTB_PB0=0;
for(;;)
{
}
}
|
|