当前位置:网站首页>STC89C52RC的P4口的应用问题
STC89C52RC的P4口的应用问题
2022-08-04 23:51:00 【喜暖知寒】
所用芯片 STC89C52RC-40I LQFP-44

发现这个芯片有 P4 端口,但是直接如下操作会报错!
P4 = OXff;解决办法:
要选择 <reg52.h>,需要用到 sfr 声明地址:
在STC89C51的数据手册中找到了特殊功能寄存器 SFRs
![]()
可知 P4 的地址为 E8H 。
直接定义:
sfr P4 0Xe8;这样定义后,以下方式进行操作都可以:
sbit P4_0 = P4^0;
P4 = (P4 & 0xfe);
P4_0 = 0;OK,问题圆满解决了!
边栏推荐
- KT148A语音芯片怎么烧录语音进入芯片里面通过串口和电脑端的工具
- ~ hand AHB - APB Bridge 】 【 AMBA AHB bus
- @Async注解的作用以及如何实现异步监听机制
- Security software Avast and Symantec NortonLifeLock merge with UK approval, market value soars 43%
- 中日颜色风格
- Develop a SpaceX website based on the Appian low-code platform
- Xiaohei leetcode surfing: 94. Inorder traversal of binary tree
- 未上市就“一举成名”,空间媲美途昂,安全、舒适一个不落
- Mysql based
- 365天深度学习训练营-学习线路
猜你喜欢

【LeetCode】图解 904. 水果成篮

深度|医疗行业勒索病毒防治解决方案

Basic web in PLSQL

Day118.尚医通:订单列表、详情、支付

uniapp sharing function - share to friends group chat circle of friends effect (sorting)

【云原生--Kubernetes】调度约束

Statistical words (DAY 101) Huazhong University of Science and Technology postgraduate examination questions

美团二面:Redis与MySQL双写一致性如何保证?

Develop a SpaceX website based on the Appian low-code platform

The market value of 360 has evaporated by 390 billion in four years. Can government and enterprise security save lives?
随机推荐
MVCC是什么
七牛云图片上传
游戏3D建模入门,有哪些建模软件可以选择?
对“为什么一些程序员很傲慢”的解读
node中package解析、npm 命令行npm详解,node中的common模块化,npm、nrm两种方式查看源和切换镜像
4-《PyTorch深度学习实践》-反向传播
Develop a SpaceX website based on the Appian low-code platform
【七夕情人节特效】-- canvas实现满屏爱心
KT148A voice chip ic working principle and internal architecture description of the chip
LeetCode Hot 100
#yyds dry goods inventory #Switching equipment serious packet loss troubleshooting
注解@EnableAutoConfiguration的作用以及如何使用
LeetCode Hot 100
The role of the annotation @ EnableAutoConfiguration and how to use
Security software Avast and Symantec NortonLifeLock merge with UK approval, market value soars 43%
Xiaohei's leetcode journey: 95. Longest substring with at least K repeating characters
[Happy Qixi Festival] How does Nacos realize the service registration function?
407. 接雨水 II
uniapp 分享功能-分享给朋友群聊朋友圈效果(整理)
@Import注解的作用以及如何使用