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.

[参考译文] MSP430FR2355:奇怪的 A/D 行为

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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1311645/msp430fr2355-strange-a-d-behavior

器件型号:MSP430FR2355

#include  "msp430fr2355.h"

;-------------------------------------------------------------------------------
            ORG     08000h                  ; Program Reset
;-------------------------------------------------------------------------------
RESET       mov     #03000h,SP               ; Initialize stackpointer
            mov     #WDTPW+WDTHOLD,&WDTCTL  ; Stop watchdog timer
            call    #SetupA2D
Loop
            call    #ReadA2D
            jmp     Loop       
            
;-------------------------------------------------------------------------------
ReadA2D
            bic     #ADCIFG0,&ADCIFG
            bis     #ADCON+ADCENC+ADCSC,&ADCCTL0
A2DLoop
            bit     #ADCIFG0,&ADCIFG
            jz      A2DLoop
            bic     #ADCENC+ADCSC,&ADCCTL0
            ret
            nop
            
;-------------------------------------------------------------------------------
SetupA2D
            ; 8 S/H clock cycles
            mov     #ADCSHT_1+ADCON,&ADCCTL0
            mov     #ADCSHP,&ADCCTL1
            mov     #ADCRES_2,&ADCCTL2
            ret

;-------------------------------------------------------------------------------
            ORG     0FFFEh
            DW      RESET
            END

当我执行代码第16行中的指令(单步执行代码)时、ADCSC 位永远不会开启。  它会保持为0。

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

    没关系。  我被这样一个事实所欺骗:A/D 以微秒为单位完成其转换、因此、在单步执行时、它似乎根本不发生。