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.

[参考译文] MSP430F2619S-HT:P6.4上的意外脉冲

Guru**** 2391095 points


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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1045520/msp430f2619s-ht-unexpected-pulses-on-p6-4

器件型号:MSP430F2619S-HT

您好!

我的客户在定制板上报告了奇怪的行为。
当低于简单程序运行时、会在 P6.4上生成脉冲。

#include <msp430.h>

int main(void)
{
    WDTCTL = WDTPW + WDTHOLD;// Stop watchdog timer

    for(;;){
        int i;
        P3IN;
        i = 5000;
        do (i--);
        while (i != 0 );
    }
}


P6.4波形。


如果使用 P3IN、P2IN 或 P4IN、则会发生此问题。
如果使用 P1IN、P5IN 或 P6IN、则不会生成脉冲。
我选中了*。asm generated、代码将 PxIN 地址移动到 R15。

具有 P3IN 源代码的*。asm:P6.4上生成的脉冲。
;* --------------------------------------------------------------------------*
;*   BEGIN LOOP $C$L1
;*
;*   Loop source line                : 7
;*   Loop closing brace source line  : 13
;*   Known Minimum Trip Count        : 1
;*   Known Maximum Trip Count        : 4294967295
;*   Known Max Trip Count Factor     : 1
;* --------------------------------------------------------------------------*
$C$L1:    

$C$DW$4	.dwtag  DW_TAG_lexical_block
	.dwattr $C$DW$4, DW_AT_low_pc(0x00)
	.dwattr $C$DW$4, DW_AT_high_pc(0x00)
$C$DW$5	.dwtag  DW_TAG_variable
	.dwattr $C$DW$5, DW_AT_name("i")
	.dwattr $C$DW$5, DW_AT_TI_symbol_name("i")
	.dwattr $C$DW$5, DW_AT_type(*$C$DW$T$10)
	.dwattr $C$DW$5, DW_AT_location[DW_OP_breg1 0]

	.dwpsn	file "../main.c",line 9,column 9,is_stmt,isa 0
        MOV.B     &P2IN+0,r15           ; [] |9| 
	.dwpsn	file "../main.c",line 10,column 9,is_stmt,isa 0
        MOV.W     #500,0(SP)            ; [] |10| 


具有 P1IN 源代码的*。asm:P6.4上无脉冲。
;* --------------------------------------------------------------------------*
;*   BEGIN LOOP $C$L1
;*
;*   Loop source line                : 7
;*   Loop closing brace source line  : 13
;*   Known Minimum Trip Count        : 1
;*   Known Maximum Trip Count        : 4294967295
;*   Known Max Trip Count Factor     : 1
;* --------------------------------------------------------------------------*
$C$L1:    

$C$DW$4	.dwtag  DW_TAG_lexical_block
	.dwattr $C$DW$4, DW_AT_low_pc(0x00)
	.dwattr $C$DW$4, DW_AT_high_pc(0x00)
$C$DW$5	.dwtag  DW_TAG_variable
	.dwattr $C$DW$5, DW_AT_name("i")
	.dwattr $C$DW$5, DW_AT_TI_symbol_name("i")
	.dwattr $C$DW$5, DW_AT_type(*$C$DW$T$10)
	.dwattr $C$DW$5, DW_AT_location[DW_OP_breg1 0]

	.dwpsn	file "../main.c",line 9,column 9,is_stmt,isa 0
        MOV.B     &P1IN+0,r15           ; [] |9| 
	.dwpsn	file "../main.c",line 10,column 9,is_stmt,isa 0
        MOV.W     #500,0(SP)            ; [] |10| 


该问题发生在定制板上、而不会发生在使用同一器件的其他板上。
因此、客户怀疑这是电路板问题、但不知道上述代码为什么会在 P6.4上生成脉冲。

您对 这种奇怪的行为有什么想法吗?

谢谢、此致、
田志郎一郎

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

    您好、Koichiro、

    为什么他们写入 P3IN; 他们没有为此寄存器分配值。   

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

    您好、Allen、

    该代码仅用于测试。
    在客户的生产代码中发现了问题本身。 在该代码中、访问 P3IN 寄存器。
    我知道测试代码没有意义、但它在语法中仍然有效。
    客户想知道这会导致 P6.4上产生脉冲的原因。

    谢谢、此致、
    田志郎一郎

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

    ,一郎一郎

    P6.4的状态是什么?  它似乎是一个输入引脚。 我认为这可能是由于客户电路板上的某些外部信号而不是 IC 内部的信号造成的。  您是否尝试像配置输出 I/O 那样配置引脚6.4? 它是否仅发生在 P6.4或 P6.x 上? 其他 P6.x 或 Px.x 是否有相同的问题?