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.

[参考译文] 有关 boostxl-afe031的示例代码 f28004x DAC 模式的问题

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/998262/question-on-sample-code-f28004x-dac-mode-for-boostxl-afe031

主题中讨论的其他器件:BOOSTXL-AFE031AFE031

您好!

我对 boostxl-afe031的示例代码有疑问。 目前、我正在尝试了解此代码、以便为我的应用创建我的代码。 问题是、我在示例代码和数据表中发现了一些不相干的东西。  

首先、关于 SPI 通信、在数据表中、我们有两种 SPI 通信模式(0、0)或(1、1)、通常对应于时钟极性和时钟相位。 我看不到任何硬性引脚或寄存器来设置这两种模式中的一种。 但在示例代码中、时钟极性为1、时钟相位为0、因此与数据表不匹配。  

其次、它是一个称为 HAL_SPI_writeGain 的函数、该函数对应于用于在 AFE031上写入增益的函数。 数据通常应如下所示:

 R/W 位- 7位寄存器- 8位数据

但是、在该函数(HAL_SPI_writeGain)中 、我们以反向方式写入、而我们在 hal_afe031.h 中有宏定义、其工作方式与数据表中写入的类似。  

另外,您能否向我解释一下“TEST”引脚对应的是什么?

此致、

Abed

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

    尊敬的 Abed:

    [引用 userid="483346" URL"~/support/microcontrollers/c2000/f/c2000-microcontrollers-forum/998262/question-on-sample-code-f28004x-dac-mode-for-boostxl-afe031 ]首先关于 SPI 通信、在数据表中、我们有两种 SPI 通信模式(0、0)或(1、1)、通常对应于时钟极性和时钟相位。

    请参阅"22.3.6 SPI 时钟方案"部分和"图22-7。 《F28004x 器件技术参考手册》中的 SPICLK 信号选项。 CLK_PHASE 和 CLKPOLARITY 的描述在两个器件之间似乎不同。 为确保正常运行、请选择所需的波形以确定时钟相位和时钟极性设置。

    我认为我们的 F28004x 模式(1、0)与 AFE031的模式(1、1)相匹配。

    [引用 userid="483346" URL"~/support/microcontrollers/c2000/f/c2000-microcontrollers-forum/998262/question-on-sample-code-f28004x-dac-mode-for-boostxl-afe031 ]但在该函数(HAL_SPI_writeGain) 中、我们以反向方式写入、而我们在 hal_afe031.h 中有宏定义、其工作方式与数据表中编写的类似。  [/报价]

    我不确定你的意思。 此函数看起来像使用'HAL_afe031_regWrite ()'写入 AFE031的增益寄存器一样、与写入 AFE 寄存器的其他函数一样。

    [引用 userid="483346" URL"~/support/microcontrollers/c2000/f/c2000-microcontrollers-forum/998262/question-on-sample-code-f28004x-dac-mode-for-boostxl-afe031也可以解释一下" test "引脚对应的是什么?

    您的意思是"GPIO_TEST_MODE"? 请参阅以下代码注释以了解其用途:

        //
        // Initialize transmit data buffer based on test mode jumpers, Notes:
        // 1. Test Mode selected with jumper across J6.60-J8.80
        // 2. Tx Mode selected with jumper across J2.20-J4.40
        // 3. Input grounded with jumper installed, otherwise pulled high
        // 4. Pin states inverted in test mode computation (NO jumper='0')
        //    Test Mode   Tx Mode   Function
        //    ---------   -------   --------
        //        0          0      Logic "1" Word (Default, w/NO jumpers)
        //        0          1      Logic "0" Word
        //        1          0      Continuous MARK
        //        1          1      Continuous SPACE
        //

    最棒的

    Kevin