Typo's in PN7462 phhalCt module

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

Typo's in PN7462 phhalCt module

537 Views
roberto74
Contributor I

While experimenting with the CT interface of the PN7462 I encoutered some typo's and double defined declarations that I want to share with you:

#define PHHAL_CT_CARD_DEFAULT_CLOCK is defined in phhalCt_Int.h and phhalCt_Common.c

Luckily with the same value and afterall only used within phhalCt_Common.c.

In the end it should be defined only once is my advise.

Furthermore in both files the comment that goes with it mentions:

/** Macro for Default clock value 4.92MHz for activation.*/
#define PHHAL_CT_CARD_DEFAULT_CLOCK 0x05

Since the crystal is 27.12MHZ and 0x05 means Fclk/6 it is actually 4.52MHz

And in the file phhalCt_Common.c the following comment can be found within phhalCt_SetTimer():

/* Load the default values of ETU */
/* Set the card clock default value to 5 Mhz max */
PH_REG_SET_FIELD(CT_CCRx_REG, ACC2_ACC0 ,PHHAL_CT_CARD_DEFAULT_CLOCK);
/* The PDR default value 372 is multiplied by 8 will result in 0xBA0, Since we are dividing the Card clock
* frequency by 8 [ACC2- ACC0 = clock/6], we have to multiply the default 372 etu value with 8 for sampling and
* hence the value 0x8B8 is loaded as the default value in the PDR register */
PH_REG_SET(CT_PDRx_LSB_REG, 0xB8);
PH_REG_SET(CT_PDRx_MSB_REG, 0x08);

'by 8' and '8' should actually be 'by 6' and '6' since 372 * 6 = 0x8B8

Kind regards,

Robert

Labels (1)
0 Kudos
0 Replies