Part Number: TMS320F280039C
Other Parts Discussed in Thread: LAUNCHXL-F280039C, , SYSCONFIG, C2000WARE
Hi,
I am using a TMS320F280039C on the LAUNCHXL-F280039C and have some trouble with the APIO H analog pins. I want to configure ADCINA1 as input for one comparator subsystem. ADCINA1 is connected to Pin A1/B7/DACB_OUT of the controller.
I wanted to write all the code from scratch, to learn how the MCU works. I read all the necessary section from the technical reference maual SPRUIW9A and device datasheet SPRSP61A.
According to the GPHAMSEL register definition on page 1136 of SPRUIW9A i need to set the corresponding register for my ADCINA1 input. As described on page 1136, the default values of GPHAMSEl are all bit set to 0x1, which means all analog functions are enabled.


Table 15-3 on page 1759 of SPRUIW9A shows that A1/B7/DACB_OUT is connected to AIO232.

The AIO pins are described on page 1054 of SPRUIW9A. There is no mapping, but from my understanding AIO232 is just a synonym to GPIO232.

So if I only want to activate A1/B7/DACB_OUT as analog input, I don't have to configure anything according to the manaul, because everything is already configured for my purposes. But the bit definitions of the GPHAMSEL must be wrong. The comparator only works if the GPHAMSEL is cleared. The test designs from TI I have seen so far do this with the bit-field function InitGpio().
First I tried to clear all bits in GPHAMSEL register. My comparator worked as expected. After the fundamental function test I wanted to clean up my code. By doing this I just wanted to enable A1/B7/DACB_OUT as analog input by clearing just bit 8 (GPIO232) in the GPHAMSEL register. But the comparator did not work in this configuration. By cheking all bits separately in debug mode, i found that GPIO242 instead GPIO232 must be cleard for A1/B7/DACB_OUT as analog input. This means that there are at least two wrong pin mappings in Table 15-2.
I am not familiar with MCU design. In the past i worked with FPGAs, so maybe I'm missing a critical part for correct initialization. I would be very grateful for any help.
Best regards,
Stefan