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.

TMS570LC4357: N2HET as Digital Input

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

I am trying to use N2HET pins as Digital input configuration. I have disabled the HET drivers both 1 & 2 in HalcoGen and added the following settings at the end of  hetInit() function. 

hetReg1->GCR = 0x01000001;//enable HET

hetReg1->PULDIS = 0x00000000;//Enable PULL

hetReg1->PSL = 0xFFFFFFFF;//Configure PULLUP

hetReg1->DIR = 0x00000000;//Configure as DIN

hetReg2->GCR = 0x01000001;//enable HET

hetReg2->PULDIS = 0x00000000;//Enable PULL

hetReg2->PSL = 0xFFFFFFFF;//Configure PULLUP

hetReg2->DIR = 0x00000000;//Configure as DIN

I have tried to pull down one of the pins by connecting to ground and did not see any change in value by calling gioGetPort(hetPORT1);

Am I missing something here?

Regards,

Chandra

  • Hello,

    1. Enable GIO

    2. Enable N2HET1

    3. Configure All NHET1 pins as input and with pull-up or pull-down

    4. Disable the BIT HR share for all the NHET1 pins: /** - Set HET pins high resolution share */
    hetREG1->HRSH = (uint32) 0x00000000U;

  • Hi,

    I wonder why my configuration is not working.

    It is exactly same (expect I am using pull high) as you spelled out. I have tried pull low configuration too.

    Do you have any example for one or two pins configured as digital inputs with pull high configuration.

    Regards,

    Chandra

  • Just tested for only 2 pins. It works as expected.

  • Please configure the PINMUX correctly. If the pin is used for other functionality for example MibSPI, this pin won't be controlled by N2HET DIR/PSL etc.

  • Hi,

    I have succeeded configuring N2HET1 pins as input pins. Thanks for the support.

    I have followed the same steps with N2HET2 port pins as inputs, and I do not see any data change by providing the input.

    I have verified the multiplexing table, input pin muxing, 

    I am looking to configure Pin D7 as input.

    Is there something more to be done for N2HET port pins? 

    Regards,

    Chandra

  • Hello Chandra,

    Nothing special for N2HET2. If the pinmux and input pinmux are configured properly, it should work without any problem. 

    For N2HET2 output, the module provides a capability to cause the N2HET output to be tri-stated through the PIN Disable input signal. The GIOB[2] is used as N2HET2 disable pin. Please refer to LC43x datasheet. But this pin should not affect the N2HET input.

  • Hi,

    Attached the HalCoGen project files for N2HET2 configuration.

    My interest is to look at pins N2HET2(02) - D7 and N2HET2(11) - N16.

    I did not see the data change by providing the input toggle. Request to check what is the mistake.

    Regards,

    Chandra1680.N2HET.zip

  • Hi Wang,

    Can you please have a look in to the above attached project file and verify input configuration.

    Regards,

    Chandra

  • Chandra,

    Your configuration in HALCOGen looks good. I just tested N2HET2[2] (D7 pin) on TMS570LC43x launchpad by connecting this pin to 3.3V and GND, the value in DIN register is correct (1 and 0).

    As I said, nothing special on N2HET2. Please do same test on your board. 

  • Dear Wang,

    Unfortunately I am not able to see the data toggle.

    Request you to share the complete project, HalCoGen and CCS files.

    Thanks in advance.

    Chandra

  • Hello Chandra,

    I don't have a test case. I configured the N2HET2[2] as input through the HALCOGen. After het module initialization, I connected N2HET2[2] to GND and 3.3V with a bluewire, and checked the value in DIN register. 

    The N2HET2[2] bit in DIN register toggles when the pin is switched to GND from 3.3V.

  • Hi Wang,

    I am attaching my project with HET1 and HE2 configured for GIO.

    I see the data toggle for HET1 but not for HET2. Can you please check.

    I have verified with two demo boards of TMS570LC43x Hercules Development Kit.

    I can see that the pullup configuration is not effective.I see the register change, but the voltage on the pin is still low.

    Regards,

    Chandra

  • Hi,

    Can you please have a look in to the attached project.

    Thanks.

    Chandra

  • Hi Chandra,

    Please check the pin DIN before hetInit(). hetInit() programs the nhet code into nhet RAM, and the code may use the nhet pins for other purpose.

  • Dear Wang,

    Still I did not see any change in input data register by connecting to 3.3V and GND.

    My sincere request to provide a clean CCS project with proper configuration for HET2 pins as input with pull high.

    I have two demo boards and both are not responding only for HET2 pins only.

    Sorry for the troubling you.

    Regards,

    Chandra

  • Dear Wang,

    Eagerly looking forward for your help. I am completely blocked because of HET2 configuration.

    Chandra

  • Chandra,

    No N2HET module configuration is necessary for the DIN registers to show the I/O pin status. The only possible configuration required is if any N2HET2 terminal has a multiplexor on its input.

    Input multiplexing for N2HET2 terminals is described in the datasheet, spns195c section 4.2.2.2 on page 53. I am pasting the table extract for N2HET2.

    So the connection to the N2HET2 DIN register is affected by the configuration of the PINMMR registers. Please make sure that you are driving the correct input terminal and looking for the state to be reflected in the DIN register based on the above table (or from the datasheet).

    Hope this helps.

  • Hi Sunil,

    I have checked the respective PINMMR registers for HET2 pins. Those are correct as Terminal 1 bit is SET and Terminal bit is RESET.

    I have tried many ways, and no success. This is the reason I have asked Wang to give me a working clean CCS project and HalCoGen configuration file for HET2 pins as input with pull high, so that I can verify there is no hardware issue on my board.

    This will help me as reference.

    Chandra

  • Hi Chandra,

    This is main() file used for my test. I tested N2HET2[2] on D7 and E1 using L43 Launchpad.

    #include "HL_sys_common.h"

    /* USER CODE BEGIN (1) */
    #include "HL_het.h"
    #include "HL_pinmux.h"
    #include "HL_esm.h"
    /* USER CODE END */

    /** @fn void main(void)
    * @brief Application main function
    * @note This function is empty by default.
    *
    * This function is called after startup.
    * The user can use this function to implement the application.
    */

    /* USER CODE BEGIN (2) */
    /* USER CODE END */

    int main(void)
    {
    /* USER CODE BEGIN (3) */
    unsigned int abc, i;

    /*clear ESM error*/
    esmREG->SR1[1] = 0xFFFFFFFF;
    esmREG->SR1[2] = 0xFFFFFFFF;
    esmREG->SR1[3] = 0xFFFFFFFF;
    esmREG->EKR = 0x5;
    esmREG->EKR = 0x0;

    esmREG->EKR = 0xA;
    esmREG->EKR = 0x0;
    esmREG->EKR = 0x5;
    esmREG->EKR = 0x0;

    hetInit();

    hetPORT2->DIR = 0x00000000;

    /* Enable Pin Muxing */
    pinMuxReg->KICKER0 = 0x83E70B13U;
    pinMuxReg->KICKER1 = 0x95A4F1E0U;

    /* N2HET2_[00] -- D6
    * N2HET2_[01] -- D8
    * N2HET2_[02] -- D7 N2HET2_2/N2HET2_NDIS, pin 18 of J9
    * N2HET2_[03] -- E2
    * */
    pinMuxReg->PINMUX[94] = 0x01010101; /* N2HET2[2] input on Pin D7 */

    /* Disable Pin Muxing */
    pinMuxReg->KICKER0 = 0x00000000U;
    pinMuxReg->KICKER1 = 0x00000000U;

    /* connect P18 0f J9 to 3.3V (pin3) or GND (pin2)
    * then read DIN
    * */
    for(i=0; i<6; i++){
    abc = hetPORT2->DIN; /* N2HET2_2/N2HET2_NDIS, pin 18 of J9 */
    }

    /* Enable Pin Muxing */
    pinMuxReg->KICKER0 = 0x83E70B13U;
    pinMuxReg->KICKER1 = 0x95A4F1E0U;

    /* N2HET2_[00] -- C1
    * N2HET2_[01] -- D4
    * N2HET2_[02] -- E1 GIOA_3/N2HET2_2, pin 18 of J10
    * N2HET2_[03] -- D5
    * */
    pinMuxReg->PINMUX[94] = 0x02020202;

    /* Disable Pin Muxing */
    pinMuxReg->KICKER0 = 0x00000000U;
    pinMuxReg->KICKER1 = 0x00000000U;

    /* connect P18 0f J10 to 3.3V (pin3) or GND (pin2)
    * then read DIN
    * */
    for(i=0; i<6; i++){
    abc = hetPORT2->DIN; /* GIOA_3/N2HET2_2, pin 18 of J10 */
    }

    while(1);
    /* USER CODE END */

    return 0;
    }

  • Hi Wang,

    I think there is an external SDRAM memory chip is interfaced with some EMIF pins configured on the Evaluation board. Because of this, I was not able to toggle the pins. I have tested a DATA pin of HET2 (T5) by connecting to 3.3V. This is toggling the DIN register value.

    I do not have a Launchpad board.

    Thanks.

    Chandra

  • Hello Chandra,

    Nice to know you can toggle the N2HET2 pin.