当前位置:网站首页>STC8A8K64D4 EEPROM读写失败
STC8A8K64D4 EEPROM读写失败
2022-06-11 01:26:00 【ytech_cn】
项目场景:
STC8A8K64D4制作led条屏,上位机下发数据,单片机划分32keeprom空间存储点阵数据
问题描述
上位机提示下发数据正常,单片机无法保存点阵数据,测试eeprom写入失败
void IapProgram(int addr, char dat)
{
IAP_CONTR = WT_12M; //使能IAP
IAP_CMD = 2; //设置IAP写命令
IAP_ADDRL = addr; //设置IAP低地址
IAP_ADDRH = addr >> 8; //设置IAP高地址
IAP_DATA = dat; //写IAP数据
IAP_TRIG = 0x5a; //写触发命令(0x5a)
IAP_TRIG = 0xa5; //写触发命令(0xa5)
_nop_();
IapIdle(); //关闭IAP功能
}
使用stcisp例程测试,写入失败
原因分析:
STC8A8K64D4,注意尾缀为D4(尾缀S4已停产,这次自己也是中途换的D4芯片),此型号使用时寄存器操作类似STC8H系列,而不是STC8A,使用中增加了一个寄存器IAP_TPS来设置等待参数。
解决方案:
IAP_TPS = 12; //设置等待参数12MHz
在读写函数中增加该寄存器操作,eeprom可正常读写
注:stc新型号更新太快,建议关注厂家资料,非必要不必使用型号太新的单片机。
边栏推荐
- ABAP CDS实现多行字段内容拼接
- C language practice (IX)
- SQL | 返回顾客名称和相关订单号以及每个订单的总价
- Can the soft exam certificate be settled in Shanghai? Many people don't know
- Find - (block find)
- 环糊精金属有机骨架(β-CD-MOF)装载二巯丁二酸/大黄素/槲皮素/三氯蔗糖/二氟尼柳/奥美拉唑(OME)
- Blue Bridge Cup: the sixth preliminary round - "temperature recorder"
- Fb02 edit coding block field
- 14: 00 interview, came out at 14:08, the question is really too
- Talk about an annotation implementation interface retry
猜你喜欢

FB02编辑Coding Block字段
![[3.delphi common components] 6 scroll bar](/img/55/891e56de4500a9128ac89e3c5b1721.jpg)
[3.delphi common components] 6 scroll bar

Sword finger offer II 095 Longest common subsequence dynamic programming

浅析直播间海量聊天消息的架构设计难点

14:00面试,14:08就出来了 ,问的实在是太...

English subtitle video translated into Chinese subtitles

Find - (block find)

当逻辑删除遇上唯一索引,遇到的问题和解决方案?

Secret

NFT Insider #61:Animoca Brands 在 340 项投资中持有 15 亿美元的加密资产
随机推荐
Enrichment of core knowledge points of interface automation to add points to the interview
2022 simulated 100 questions and answers for crane driver (limited to bridge crane) examination
Can the soft exam certificate be settled in Shanghai? Many people don't know
92. CompletableFuture 实战
Number of different paths
2022 safety officer-b certificate examination question bank and answers
10 years of domestic milk powder counter attack: post-90s nannies and dads help new domestic products counter attack foreign brands
Core principle and code explanation of epoll reactor model
如何保障数仓数据质量?
Switch case uses enumeration classes to compare
SAP SMARTFORMS文本内容手动换行输出
InfoQ 极客传媒 15 周年庆征文|容器运行时技术深度剖析
Oracle tablespaces, users, and authorization to users
[3.delphi common components] 7 timer
Day code 300 lines learning notes day 22
Analysis of the difficulties in the architecture design of massive chat messages in the live broadcast room
Colab reported an error: importerror: cannot import name '_ check_ savefig_ extra_ args‘ from ‘matplotlib. backend_ bases‘
贵金属白银行情走势图缘何强势?
CRS-5017
Defense measures for common vulnerabilities