当前位置:网站首页>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,问题圆满解决了!
边栏推荐
猜你喜欢

MySQL增删改查基础

How to burn the KT148A voice chip into the chip through the serial port and the tools on the computer

矩阵数学原理

Cloud native - Kubernetes 】 【 scheduling constraints

Flutter启动流程(Skia引擎)介绍与使用

没有这些「伪需求」,产品经理的 KPI 怎么完成?

Implementation principle of golang coroutine

招标公告 | 海纳百创公众号运维项目

【LeetCode】Summary of Two Pointer Problems

Xiaohei's leetcode journey: 95. Longest substring with at least K repeating characters
随机推荐
对写作的一些感悟
d枚举生成位
mysql基础
Brainstorm: Complete Backpack
[LeetCode] Summary of Matrix Simulation Related Topics
PZK学C语言之字符串函数(一)
Uniapp dynamic sliding navigation effect demo (finishing)
隐私计算综述
10 个关于 Promise 和 setTimeout 知识的面试题,通过图解一次说透彻
三、实战---爬取百度指定词条所对应的结果页面(一个简单的页面采集器)
深度|医疗行业勒索病毒防治解决方案
uniapp sharing function - share to friends group chat circle of friends effect (sorting)
DNS常见资源记录类型详解
MySQL增删改查基础
407. 接雨水 II
Go 语言快速入门指南:什么是 TSL 安全传输层
node中package解析、npm 命令行npm详解,node中的common模块化,npm、nrm两种方式查看源和切换镜像
导入JankStats检测卡帧库遇到问题记录
Laravel 实现redis分布式锁
安全软件 Avast 与赛门铁克诺顿 NortonLifeLock 合并案获英国批准,市值暴涨 43%