TMS320F280039C: The analog function of the pin is enabled or disabled

Part Number: TMS320F280039C
Other Parts Discussed in Thread: C2000WARE

通过对寄存器的GPHAMSEL了解,对其bit写1或0可以使能或禁止引脚的analog function,结合例程C2000Ware_5_00_00_00/adc_ex1_soc_software观察变量myADC0Result0,即使将GPHAMSEL置为0,myADC0Result0输出也会随着输入引脚的电压而变化。

By understanding the GPHAMSEL register, writing a 1 or 0 to its bits can enable or disable the analog function of the pins. In conjunction with the example C2000Ware_5_00_00_00/adc_ex1_soc_software, observing the variable myADC0Result0 shows that even if GPHAMSEL is set to 0, myADC0Result0 will still change according to the voltage on the input pin.

使用开发板LaunchPads280039C,将GPHAMSEL置为0(analog function is disabled),A0引脚连接至V3.3,观察到myADC0Result0接近4096。

Using the development board LaunchPads280039C, set GPHAMSEL to 0 (analog function is disabled), connect the A0 pin to V3.3, and observe that myADC0Result0 is close to 4096.

image.png

当A0引脚连接至GND,观察到myADC0Result0接近0。

When the A0 pin is connected to GND, myADC0Result0 is observed to be close to 0.

image.png

为什么GPHAMSEL置为0时,所有的采样看似依然正常呢?

Why does everything seem to be sampled normally when GPHAMSEL is set to 0? 

期待您的答复。

I look forward to your reply. 

  • 您好,

    已经收到了您的案例,调查需要些时间,感谢您的耐心等待

  • GPHAMSEL register takes effect for AGPIO pins that have analog and digital functionality. AGPIOs are mostly set with 3 digits GPIO253, GPIO258 etc.

    If you use AGPIO and set GPHAMSEL:

    0: The analog function of the pin is disabled, and the pin is capable of digital functions as specified by the other GPIO configuration registers

    1: The analog function of the pin is enabled, and the pin is capable of analog function

    Otherwise, if pin is just digital or just analog it would keep its functionality.

  • For pin 23 in 280039C, the GPHAMSEL can be used to select whether the pin operates in digital input mode or analog input mode. In the statement of the above question, even when the corresponding bit of the GPHAMSEL register is written with 0 or 1, the analog input variable myADC0Result0 is still unaffected. Why is that?