|
楼主 |
发表于 2024-11-8 15:33:37
|
显示全部楼层
- //读写T5L片内256KW Flash,mod=0x5A 为读取,mod=0xA5为写入
- //addr=DGUS变量地址,必须是偶数;addr_flash=flash读取地址,必须是偶数;len=读取字长度,必须是偶数。
- void T5L_Flash(unsigned char mod,unsigned int addr,long addr_flash,unsigned int len)
- { ADR_H=0x00;
- ADR_M=0x00;
- ADR_L=0x04;
- ADR_INC=0x01;
- RAMMODE=0x8F; //启动读Flash
- while(APP_ACK==0);
- DATA3=mod;
- DATA2=(unsigned char)(addr_flash>>16);
- DATA1=(unsigned char)(addr_flash>>8);
- DATA0=(unsigned char)(addr_flash&0xFE);
- APP_EN=1;
- while(APP_EN==1);
- DATA3=(unsigned char)(addr>>8);
- DATA2=(unsigned char)(addr&0xFE);
- DATA1=(unsigned char)(len>>8);
- DATA0=(unsigned char)(len&0xFE);
- APP_EN=1;
- while(APP_EN==1);
- RAMMODE=0x00;
- wait_ok(0x0004);} //等待数据读取OK
复制代码
如果可以 的话 addr_flash是多少呢?是怎样一个换算关系? |
|