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 SAC smart analog Example 设定问题

我參考了以下網址

https://www.digikey.com/en/articles/use-mcu-functionality-quickly-implement-analog-signal-chains-compact-designs

 

並且使用了下面的程式碼進行 SAC的設定
//Select external source for both positive and negative inputs
SAC_OA_init(SAC0_BASE, SAC_OA_POSITIVE_INPUT_SOURCE_EXTERNAL, SAC_OA_NEGATIVE_INPUT_SOURCE_EXTERNAL);

//Select low speed and low power mode
SAC_OA_selectPowerMode(SAC0_BASE, SAC_OA_POWER_MODE_LOW_SPEED_LOW_POWER)

// Enable OA
SAC_OA_enable(SAC0_BASE);

// Enable SAC
SAC_enable(SAC0_BASE);

//!             MSP430FR2xx_4xx Board
//!             -------------------
//!          /|\|                     OA0-|----||---------R2=100Kohm---GND
//!           | |                              |    R1=200Kohm
//!           | |                    OA0O|----||
//!           --| RST                     |
//!             |                     OA0+|<----
//!             |                              |
//!             |                              |

P1.1 OA0O

P1.2 OA0l0

P1.3 OA0l1    外接300mv

電阻按照上面描述

可是, 我再OA0O 怎樣也沒辦法得到正確的放大電壓(理論上應該是量到900mv),用三用電表測量都只有230mv

請問我是哪邊操作錯誤了呢?

謝謝

  • 图片上传失败,请您以附件形式上传一下图片,谢谢
  • 请问您使用的是官方板子还是自制板?

    若是可以的话,请您上传/私信一下您的完整代码。我之后使用开发板测试一下,谢谢
  • 您好~ 以下是我直接從example搬過來的code 值接執行~~
    使用的pin腳是 P1.1 P1.2 P1.3
    P1.1 OA0O
    P1.2 OA0l0
    P1.3 OA0l1 外接300mv(自己產生的外部電源)

    使用的版子是這一款
    www.ruten.com.tw/.../show





    //!*****************************************************************************
    //! SAC - SAC-L3, General-Purpose Mode
    //!
    //! Description: Configure SAC-L3 for general purpose mode.
    //! The "+" terminal is connected to OA0+ and the "-" terminal is connected to OA0-.
    //! OA0_ and OA0O are connected as below to implement x3 amplifier.
    //! SAC OA is selected to low speed and low power mode.
    //! ACLK = n/a, MCLK = SMCLK = default DCODIV ~1MHz.
    //!
    //! MSP430FR2xx_4xx Board
    //! -------------------
    //! /|\| OA0-|----||---------R2=100Kohm---GND
    //! | | | R1=200Kohm
    //! | | OA0O|----||
    //! --|RST |
    //! | OA0+|<----
    //! | |
    //! | |
    //!
    //! Wallace Tran
    //! Texas Instruments Inc.
    //! May 2018
    //******************************************************************************
    #include "Board.h"
    #include "driverlib.h"

    int main(void)
    {
    //Stop WDT
    WDT_A_hold(WDT_A_BASE);

    //Configure OA0 functionality
    GPIO_setAsPeripheralModuleFunctionOutputPin(
    GPIO_PORT_SACOA0O,
    GPIO_PIN_SACOA0O,
    GPIO_FUNCTION_SACOA0O);
    GPIO_setAsPeripheralModuleFunctionInputPin(
    GPIO_PORT_SACOA0N,
    GPIO_PIN_SACOA0N,
    GPIO_FUNCTION_SACOA0N);
    GPIO_setAsPeripheralModuleFunctionInputPin(
    GPIO_PORT_SACOA0P,
    GPIO_PIN_SACOA0P,
    GPIO_FUNCTION_SACOA0P);

    /*
    * Disable the GPIO power-on default high-impedance mode
    * to activate previously configured port settings
    */
    PMM_unlockLPM5();

    //Select external source for both positive and negative inputs
    SAC_OA_init(
    SAC0_BASE,
    SAC_OA_POSITIVE_INPUT_SOURCE_EXTERNAL,
    SAC_OA_NEGATIVE_INPUT_SOURCE_EXTERNAL);

    //Select low speed and low power mode
    SAC_OA_selectPowerMode(
    SAC0_BASE,
    SAC_OA_POWER_MODE_HIGH_SPEED_HIGH_POWER);
    //Enable OA
    SAC_OA_enable(SAC0_BASE);
    //Enable SAC
    SAC_enable(SAC0_BASE);







    //Enter LPM3
    __bis_SR_register(LPM3_bits);
    //For debug
    __no_operation();
    }
  • 谢谢您的详细反馈!我会在明天测试后给您回复
  • 如例程所述:

    //!             MSP430FR2xx_4xx Board
    //!             -------------------
    //!          /|\|                     OA0-|----||---------R2=100Kohm---GND
    //!           | |                              |    R1=200Kohm
    //!           | |                    OA0O|----||
    //!           --| RST                     |
    //!             |                     OA0+|<----
    //!             |                              |
    //!             |                              |

    您需要自己在OA0-和OA0O外接电阻完成测试,开发板上是没有R1 R2的

    另外关于该开发板上的SAC,您可以查看文档的 

    2.2.5.1 Smart Analog Combo (SAC)