LPC5504 ADC defines appear to be missing from header

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

LPC5504 ADC defines appear to be missing from header

332 Views
dlayne_i2
Contributor I

Hi,

I am attempting to use the onboard 16 bit ADC on the LPC5504 processor.  I am basing my code off of the sample project.  However, when I import the ADC sample for the 5504, it seems to actually be using the LPC55S06_features.h header file to define the chip features.

When I use the latest version of the LPC5504_features.h header file that I can find, I am not able to compile the fsl_lpacd driver files.  At least the following 3 defines seem to be missing from the 5504 header (as compared to the 55S06 header):

#define FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS 1U
#define FSL_FEATURE_ANACTRL_HAS_AUX_BIAS_REG 1U
#define FSL_FEATURE_LPADC_HAS_CFG_PWRSEL 1U


Without these defines, I am not able to build fsl_lpadc.c/h.  I get errors in various spots due to apparently missing header guards, such as this one in LPADC_SetCalibrationValue:

#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U))

*(((volatile uint32_t *)(&(base->CAL_GBR[0]))) + i) = ptrCalibrationValue->generalCalibrationValueB[i];

 

This will not compile because there is no guard checking for channel B support around this use of the field.  Without the other defines, other sections of the driver fail to compile.

Are these features actually not supported by the 5504, or are they simply not defined in the header for some reason?  Should I be using a different header file?

 

Thanks for any help you can provide.

0 Kudos
Reply
1 Reply

249 Views
Pablo_Ramos
NXP Employee
NXP Employee

Hi @dlayne_i2,

The examples in the LPC5504 SDK are actually for the LPC5506. This is because there is no dedicated development board for the LPC5504, as you can see in the SDK import wizard when selecting the LPC5504.

Pablo_Ramos_0-1751046251830.png

However, if you create an empty project for the LPC5504, you will find the definition you mentioned in the LPC5504 features header file.

In this case, my recommendation would be to use the LPC5506 example as a reference and create your LPC5504 code starting from an empty project.

I apologize for any inconvenience this may cause.

0 Kudos
Reply