请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:MSP430F6775A 主题中讨论的其他器件:MSP430F6775
工具与软件:
我想自我保证一下、寄存器中是否有访问字节、就像在这个屏幕中一样。 我将以*(int*)(0x0020)比? 我是否也可以访问 地址0x0021上的数据? 它将在一个字中作为 MSB 和 LSB 返回? 还是不呢?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具与软件:
我想自我保证一下、寄存器中是否有访问字节、就像在这个屏幕中一样。 我将以*(int*)(0x0020)比? 我是否也可以访问 地址0x0021上的数据? 它将在一个字中作为 MSB 和 LSB 返回? 还是不呢?
当你执行一个字读取时、地址的 lsb 无关。 硬件将始终将其视为零。 在一个字中返回两个字节。 因此、这两个函数都会返回相同的值:
mov.w &0xca0,r15 mov.w &0xca1,r15
您必须小心编译器提供的位定义。 如果它们假定是字节访问、那么具有字访问权限、除非您对它们进行调整、否则它们将不起作用。
一些寄存器有两组位定义以允许字节和字访问。 查看器件头文件。
从 msp430f6775.h:
/* RTCTCCTL0 Control Bits */ #define TCEN (0x0001) /* RTC Enable for RTC Tamper Detection with Time Stamp */ #define AUX3RST (0x0002) /* RTC Indication of power cycle on AUXVCC3 */ /* RTCTCCTL1 Control Bits */ #define RTCCAPIFG (0x0001) /* RTC Tamper Event Interrupt Flag */ #define RTCCAPIE (0x0002) /* RTC Tamper Event Interrupt Enable */