共2条
1/1 1 跳转至页
IO 请教为什么调试中无法向IO寄存器写值
问
我用2812 的片子,编写了下面的一个小程序测试IO口:
void main()
{
volatile unsigned int* GPAMUX = (volatile unsigned int*)0x70C0;
volatile unsigned int* GPADIR = (volatile unsigned int*)0x70C1;
volatile unsigned int* GPAQUAL= (volatile unsigned int*)0x70C3;
volatile unsigned int* GPADAT = (volatile unsigned int*)0x70E0;
volatile unsigned int* GPASET = (volatile unsigned int*)0x70E1;
volatile unsigned int* GPACLEAR= (volatile unsigned int*)0x70E2;
volatile unsigned int* GPATOGGLE= (volatile unsigned int*)0x70E3;
int a;
*GPAMUX =0x0000;
*GPADIR =0xFFFF;
*GPADAT =0x0505;
}
在调试时通过view-〉memory来观察以上几个寄存器的值,很可惜看不到有任何变化,万分不解,请高手指点 答 1: 看看GEL,是不是使能相关地址的读写 答 2: 谢谢问题解决了是ALLOW位的问题,只要对allow位置位 ,我不清楚受allow位影响的寄存器有哪些,我在手册上 没找到 ,能不能告知一二
void main()
{
volatile unsigned int* GPAMUX = (volatile unsigned int*)0x70C0;
volatile unsigned int* GPADIR = (volatile unsigned int*)0x70C1;
volatile unsigned int* GPAQUAL= (volatile unsigned int*)0x70C3;
volatile unsigned int* GPADAT = (volatile unsigned int*)0x70E0;
volatile unsigned int* GPASET = (volatile unsigned int*)0x70E1;
volatile unsigned int* GPACLEAR= (volatile unsigned int*)0x70E2;
volatile unsigned int* GPATOGGLE= (volatile unsigned int*)0x70E3;
int a;
*GPAMUX =0x0000;
*GPADIR =0xFFFF;
*GPADAT =0x0505;
}
在调试时通过view-〉memory来观察以上几个寄存器的值,很可惜看不到有任何变化,万分不解,请高手指点 答 1: 看看GEL,是不是使能相关地址的读写 答 2: 谢谢问题解决了是ALLOW位的问题,只要对allow位置位 ,我不清楚受allow位影响的寄存器有哪些,我在手册上 没找到 ,能不能告知一二
共2条
1/1 1 跳转至页
回复
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |