The LPC55S69 EVK has an onboard ADC that can be used to power monitor your kit. In particular this is monitoring the power usage of the processor. To enable this feature some minor rework is required in addition to modifying the lpadc_dma SDK example. Join me as we walk through this process of enabling this functionality.
Version
Date | Version | Revision |
---|---|---|
April 2021 | 01 | Initial Release |
1.Required Hardware
- LPC55S69-EVK
- MAX471 Amplifier
- Soldering Equipment
2. Required Development Software
3. Hardware Setup
- Solder the MAX471 amplifier onto the back of your LPC55S69-EVK as shown
- You may question what is the need of the MAX471. The MAX471 is nessecary to allow of higher bit resolution. Without the amplifier your applicaiton would be limited to 4 bit resolution due to the 2.43 ohm current measurment resistor (R91) that is on the board. With the addition of this amplifer we are able to utilize all 16bits of ADC operation that is supported by the ADC on the EVK. This allows us to get more useful information in terms of power management.
- Plug into the microUSB port P6 on the LPC55S69 EVK and connect it to your PC. This is your debug and power link between the EVK and the IDE.
- Your Hardware is setup and ready to begin your development.
4. Application Setup
- Create a new workspace using the NXP IDE you have installed.
- Import the lpadc_dma SDK example into this workspace
- Now we must edit this application to properly configure the output we are reading over the ADC. Make the following changes to your lpadc_dma.c source file located in the source directory
- Add the following under the variable section *Line 44
- Remove Line144 through Line 146
- On Line 144 add the following
ADC_CONVERSION = ((uint16_t)(g_AdcConvResult[0] & ADC_RESFIFO_D_MASK) >> g_LpadcResultShift); Current = ADC_CONVERSION/311.65; PRINTF("Adc conversion word : 0x%X\r\n", g_AdcConvResult[0]); PRINTF("Adc conversion value: %d\r\n", ADC_CONVERSION); PRINTF("Current value: %d mA \r\n", Current); }
- Your application is now all configured and ready to read the ADC.
- Run the Application
- Select Clean & then Debug from the Quick Start Panel
- This will force the applciation to rebuild and kickstart the application on your LPC55S69-EVK
- Slect OK to connect to your LPC55S69 target
- Select resume from the top of the menu to start the application
- The demo will now be running, go to the conose window and select ENTER on your keyboard. This will kick off an ADC read as shown
- You will see the ADC conversion word, conversion value and the interpretation into mA. You are now successfully monitoring the PWR of the LPC55S69-EVK.
- One thing of note is the ADC is operation is 12 bit mode currently. For 16 bit operation you will need to add DEMO_LPADC_USE_HIGH_RESOLUTION into the Preprocessor settings.
- Now that the Preprocessor setting are updated your application will now be reporting back in 16 bit operation. Please note, the conversion between the ADC value and the current in mA will need to be corrected to get useful information. This can be done by going to line 146 and updating it as shown below.
- You can now rerun the demo in 16 bit operation using clean and debug once again.
- Select Clean & then Debug from the Quick Start Panel