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.

[参考译文] CCS/MSP430G2744:单个位操作问题

Guru**** 2536440 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/622920/ccs-msp430g2744-single-bit-manipulation-problem

器件型号:MSP430G2744

工具/软件:Code Composer Studio

大家好!

正如该帖子的标题所说、我正在尝试操作我的变量中的一个位、但不幸的是、我在这方面遇到了一些问题!

我要做的是:

-->设置一个16位寄存器以包含16个不同的标志

-->操作这些位中的每一位:我要打开和/或关闭并测试每个位。

我知道在汇编语言中有诸如 BIC.B、BIS.B 和 bit.B.之类的指令、但在 C 语言中呢?!

我该怎么做?

----------------------------------------------------------------------

在我的代码中、我还有一个用于显示的例程(由4个7段显示组成)、它与 INT 类型变量完美配合。

现在、我还需要处理每个显示屏的点、我尝试了很多组合、我失去了自己...

有人可以帮助我解决这个问题吗? 我认为这与上述有关位操作的问题有关

(事实上,DP 是每个显示屏的 BIT7,不幸的是,现在我无法在例程中设置它。-->为什么?!)

e2e.ti.com/.../Nuovo-documento-di-testo.txt

希望在您的回答中、

感谢您的关注

此致

Maria Angela