野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9354|回复: 2

新手求助 寄存器寻址,为什么下面的程序没有点亮红灯呢?

[复制链接]
发表于 2017-2-15 19:12:03 | 显示全部楼层 |阅读模式
#include "stm32f10x.h"
int main(void)
{
//打开GPIO端口时钟
         *(unsigned int *)0x40021018 |= (1<<3);
//配置IO口为输出       
        *(unsigned int *)0x40010C00 &= ~((0x0f)<<(4*4));
        *(unsigned int *)0x40010C00 |= (0x01<<(4*4));
//控制ODR寄存器
         *(unsigned int *)0x40010C0C &=~ (1<<5);       
         
  }
(~I$_3FX20B1BOK}WWTGG86.png
回复

使用道具 举报

 楼主| 发表于 2017-2-15 19:23:37 | 显示全部楼层
加了清零的语句后也是没有现象
回复 支持 反对

使用道具 举报

发表于 2017-4-3 17:16:05 | 显示全部楼层
应该是4*5呀 你干嘛4*4,你是PB5
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-9-22 04:38 , Processed in 0.059399 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表