PN7462 start CLX_AUX and IO_AUX

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PN7462 start CLX_AUX and IO_AUX

971 Views
davidsagasta97
Contributor I

Hi! I want to operate a TDA3084 using a PN7412. Im getting problems when interfacing the CLK_AUX.

I have a test point outside the PN7412 CLK_AUX and I get no response. Is there any guide to working this AUX outputs?

I have tried 

PH_REG_SET_BIT(CT_SSR_REG,CLKAUXEN);

 and also :

PH_REG_SET_FIELD( PCR_PAD_CLK_AUX_REG,CLK_AUX_GPIOMODE_EN, 0); //Not as GPIO
 PH_REG_SET_FIELD( PCR_PAD_CLK_AUX_REG,CLK_AUX_PUPD, 2); // Pull up
PH_REG_SET_FIELD(PCR_PAD_CLK_AUX_REG,CLK_AUX_SLEW_RATE, 1); //Slew rate yes 
PH_REG_SET_FIELD(PCR_PAD_CLK_AUX_REG, CLK_AUX_EN_OUT, 1); // Output driver enabled

Thanks

0 Kudos
Reply
3 Replies

949 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @davidsagasta97 ,

 

There is a demo for TDA8026 Aux slot, which can be shared via SFDC , please kindly submit a private ticket for it following the guide video as below:

https://www.nxp.com/video/tutorial-for-nxp-support-case-portal:NCP-VIDEO 

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

922 Views
davidsagasta97
Contributor I

Hello! thanks for the answer. I will try to explain myself properly this time.

 

After the check, we were able to run a clock using the designated registers in the PN7412 for it. However, we also checked that in the PN7462 is a set of ROM service APIs, and one of them is called during the function phhalCt_SwitchSlot(). The program we are doing at the moment is this : ) this is from the PN7464AU code. No changes besides this were done. Also, in our hardware, the card is always present since the presence pin of the TDA is wired to ground, as well as the one in the PN7412 for the SLOT 1.

in phExCcid_CT.c we set active the TDA, on the Example_APP, which is called on phExCcid_CtTask()  

 

 

 

phStatus_t phExCcid_Ct_Example_App(void)
{
    uint16_t wOutLen;
    phStatus_t eStatus = PH_ERR_FAILED;
    /* Global instance for  CT pal parameter's structure */
    phpalCt_DataParams_t tDataParams ;
    uint8_t gbAtrBuffer[33]={0};
    volatile uint32_t dwBits = 0;
    uint32_t dwEventTimeOut = 0x20;
    uint8_t bApduRespBuffer[256];
    uint8_t bRetryCount = 0;
    /* Local Variables to store Chaining parameter and Status parameter,
     * that will be sent in response RDR_to_PC_DataBlock Message
     */
    uint8_t bRdrToPcChainingParam;
    uint8_t bRdrToPcStatusParam;
    /* PC_to_RDR_XfrBlock Message mode of operation for CT PAL Transceive */
    phpalCt_TransceiveOption_t eOption;



    do
    {
    	/* Stop the polling timer */
		phhalTimer_Stop(gpphExCcid_PollTimer);
		phhalTimer_Stop(pLedTimer);


	    ///TDA INITIALIZATION//
	    PH_HAL_GPIO_SETGPIOVAL(PH_EXCCID_CMDVCCN, true);
	    (void)phUser_Wait(1000);
		PH_HAL_GPIO_SETGPIOVAL(PH_EXCCID_RSTIN, false);
		(void)phUser_Wait(1000);
	    PH_HAL_GPIO_SETGPIOVAL(PH_EXCCID_CLKDIV1, true);
	    (void)phUser_Wait(1000);                             //fTDA=fXtal
		PH_HAL_GPIO_SETGPIOVAL(PH_EXCCID_CLKDIV2, false);
		(void)phUser_Wait(1000);
		PH_HAL_GPIO_SETGPIOVAL(PH_EXCCID_VCC_SEL1, true);
		(void)phUser_Wait(1000);                                 //5V
		PH_HAL_GPIO_SETGPIOVAL(PH_EXCCID_VCC_SEL2, true);
		///TDA INITIALIZATION//


		//CARD ACTIVATION//

 

 

 

After that is done, since card pressent

 

 

 

 

If we measure in debug just after the function phhalCt_SwitchSlot(E_AUXILIARY_SLOT); we get a CLK_AUX clock comming from the PN7412 at 0,6VCC and 27,12MHz. No VCC in the card and an OFFN of 3,3V. 

When we enter on the function, phpalCt_ActivateCard(&tDataParams) , which has inside the funciontion phhalCt_CardActivate.

 

 

phStatus_t phhalCt_CardActivate(uint8_t bVccSel, uint8_t* pbAtrBuffer, uint8_t* pbAtrSize,
                                phhalCt_ProtocolParams_t  *psAtrPalParameters)
{
    phhalCt_AtrParameterType_t sAtrParams;
    phStatus_t eStatus = PH_ERR_INVALID_PARAMETER;

    do
    {
#if PHFL_PARAM_CHECK >= PH_PARAM_CHECK_VERBOSE
        /*Check for the null pointers.*/
        if ((pbAtrBuffer == NULL) || (pbAtrSize == NULL) || (psAtrPalParameters == NULL))
        {
            break;
        }
        /* Vcc select should be 1.8V, 3V or 5V as per the input.*/
        if( (PHHAL_CT_VCC1M8 != bVccSel) &&
            (PHHAL_CT_VCC3   != bVccSel) &&
            (PHHAL_CT_VCC5   != bVccSel) )
        {
            break;
        }
#endif

        /* Consume pending Card Removal events, if any(artf187980) */
        (void)phhalCt_Event_Consume((phhalCt_EventType_t)E_PH_HALCT_EVENT_CARD_REMOVED);

        /* Check if the card is present */
        eStatus = phhalCt_CheckCardPres();
        if(gphhalCt_ESlotType == E_AUXILIARY_SLOT)         	//TODO AUXILIARY: 3. Init different voltages, and also power up TDA
        {
            //Try all the other values
			switch (bVccSel) {
			case PHHAL_CT_VCC1M8:
				PH_HAL_GPIO_SETGPIOVAL(PH_EXCCID_VCC_SEL2, FALSE);
				  (void)phUser_Wait(1000);
				PH_HAL_GPIO_SETGPIOVAL(PH_EXCCID_VCC_SEL1, FALSE);
				break;
			case PHHAL_CT_VCC3:
				PH_HAL_GPIO_SETGPIOVAL(PH_EXCCID_VCC_SEL2, FALSE);
				 (void)phUser_Wait(1000);
				PH_HAL_GPIO_SETGPIOVAL(PH_EXCCID_VCC_SEL1, TRUE);
				break;
			case PHHAL_CT_VCC5:
				PH_HAL_GPIO_SETGPIOVAL(PH_EXCCID_VCC_SEL2, TRUE);
				 (void)phUser_Wait(1000);
				PH_HAL_GPIO_SETGPIOVAL(PH_EXCCID_VCC_SEL1, TRUE);
				break;
			}

        }
        else
        {
            if(eStatus != PH_ERR(CT_MAIN_CARD_PRESENT,HAL_CT))
            {
                break;
            }
            /* Check if the card is already activated */
            if (PH_REG_TEST_BIT(CT_PCR_REG, START))
            {
                eStatus = PH_ERR_CT_CARD_ALREADY_ACTIVATED;
                break;
            }
        }

        sAtrParams.psAtrPalParams = psAtrPalParameters;

        /* Clear global variables and Set default values before receiving Warm atr */
        phhalCt_ClearGLobalVar();
        (void)phhalCt_SetDefaultValues(&sAtrParams);
        /* Set the activation state */
        gphhalCt_BActivationState = TRUE;
        /* Clear the global count of ATR bytes in ISR */
        gphhalCt_WDataCount = 0x00;
        /* artf555048: Explicitly Clear PEC to ensure that Parity error will be detected during ATR */
        PH_REG_SET_FIELD(CT_FCR_REG ,PEC2_PEC0,PHHAL_CT_RESET_PARITY_ERR_COUNT);
        /* Clear All Events */
        (void) phhalCt_Event_Consume((phhalCt_EventType_t)(E_PH_HALCT_EVENT_ALL));
        gphhalCt_InEvent = E_PH_HALCT_EVENT_WAITING;

        /* Call the ROM3 Api */
        eStatus = phRomhalCt_ColdActivateConfig(bVccSel, gphhalCt_BEmvEn);
        PH_BREAK_ON_FAILURE(eStatus);

        //TODO AUX : since coldactivate is a bit hard, we use the TDA Reset, when implemented add here with an if using
        //eStatus = phRomhalCt_ColdActivateConfig(bVccSel, gphhalCt_BEmvEn); // This sets the VCC in SAM1

        PH_HAL_GPIO_SETGPIOVAL(PH_EXCCID_CMDVCCN, false);
	    (void)phUser_Wait(1000);
        PH_HAL_GPIO_SETGPIOVAL(PH_EXCCID_RSTIN, true); //TDA8034HN page 11 //activation secuence
        (void)phUser_Wait(1000);


        /* Wait for ATR bytes and process */
        eStatus = phhalCt_ProcessActivation(pbAtrBuffer,pbAtrSize,&sAtrParams);  // ** THERE HAS TO BE VCC ON TP138


      if(eStatus == PH_ERR_CT_ATR_WARM_RESET_INDICATED)
        {
            /* In EMVCo if warm ATR required is indicated in the cold ATR bytes,
             * start warm activation and wait for the bytes */
            if(gphhalCt_BEmvEn)
            {
                /* In case of warm ATR issue request from the parser, call the warm ATR from here.*/
                eStatus = phhalCt_WarmReset(pbAtrBuffer,pbAtrSize,psAtrPalParameters);
            }
        }
    }while (0);

    /* If the ATR is not returned with success then clear the return structure parameter */
    if((eStatus != PH_ERR_SUCCESS) &&
       (eStatus != PH_ERR_CT_CLASS_CHANGE_INDICATED) &&
       (eStatus != PH_ERR_CT_EARLY_ERROR))
    {

 

It gets inside the function and VCC_SEL1 and 2 are set to TRUE. then, when another ROM is called : 

eStatus = phRomhalCt_ColdActivateConfig(bVccSel, gphhalCt_BEmvEn);

The clock_aux is set to 4V and 4,57Mhz (Which is consistent with the 27,12Mhz default sistem clock but divided by 6). If CLK_DIV are set like in the code that, the value in the contact card connector is also 4,57MHz. We also can measure 3V on I/O AUX and VCC in the card connector. After this, the card should get into phhalCt_WarmReset, and at this point the flow is the same as a card which is connected in SLOT1, but not ATR is recieved from the card since (PH_ERR_SUCCESS =! eStatus).

 

 

Then, coming back to the the ExCCid_Ct.c, after doing  eStatus = phpalCt_ActivateCard(&tDataParams);

If (PH_ERR_SUCCESS == eStatus) loop it doesnt enter, since its value is 255, so it goes to card deactivate.

 So we are guessing it is problem of the initialization of the TDA. ¿Is there any example of any TDA that uses gpio being initializated? Also, a bit of insight on what the Switch_slot function that is in the ROM does, would be appreciated since we dont know what registers does or doesnt set, and that might be interferring in our TDA initialization flow. 

Thanks for your time 

0 Kudos
Reply

906 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @davidsagasta97 ,

 

Sorry, but there is no CT example using gpio instead, and as the ROM based APIs are just used inside the library APIs, so R&D team would not release the details, while from the input parameter definition , you should easily understand the usage, right?

Kan_Li_0-1638541394657.png

 

Hope that makes sense,

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 Kudos
Reply