Skip navigation

LPCScrypt v2.1 is now available. This release incorporates bug fixes and the latest versions of LPC-Link2 CMSIS-DAP firmware.

 

LPCScrypt is a command-line based, fast flash (internal and QSPI), EEPROM, OTP and security programming tool for LPC1800 and LPC4300 series microcontrollers. It is also the primary delivery mechanism for supplying and programming CMSIS-DAP firmware images for LPC-Link2 and LPCXpresso Boards.

 

Yours,

 

MCUXpresso IDE Support

We've been working on making the flagship member of the LPC800 series more accessible to more users than ever before, and are delighted to announce the LPC845 Breakout Board is now available from our distribution partners and also direct from nxp.com! Setting a new price point for a fully featured, debug enabled platform, this board includes CMSIS-DAP compatible debug and a VCOM port in a very compact yet flexible form factor. Of course it can be used with MCUXpresso IDE, Keil, IAR and other popular tools.

 

MCUXpresso SDK based examples are available now, and you will have seen some examples of interfacing to MEMS sensors, LDRs, SPI displays and a UART GPS module already on this site, all using commonly available from Adafruit and distributors.

 

Keen LPC user Kevin Townsend has been working on some other, more complex projects that he's posted on his github and on hackster.io ... an I2C co-processor for Raspberry Pi and today a fun smart Jenga block. He tells me he has another project one the way next week, so keep a look out for that!

 

We hope you enjoy this new board and, as always, we love to hear what you think and what you create!

The new LPC845 breakout board has 3 onboard LEDs- Red, Green, and Blue. The brightness of these LEDs can be controlled using a PWM signal by changing the duty cycle values for each of them. As this board has an SDK support, I have used the SDK drivers to implement this application. 

The SCTimer0 generates the PWM pulse at pins which are assigned as the SCT output pins. I have assigned the PWM output to the Green LED (PIO1_0) in my source code. You can assign the PWM output to be on any other LED by using the inbuilt configuration tool which is explained later. 

 

The source code below shows how to set the duty cycle percentage to increase or decrease the brightness of the assigned LED (here I have set it to 60%) 

 

pwmParam.level = kSCTIMER_HighTrue;
pwmParam.dutyCyclePercent = 60;

Writing the source code for this application was easy as the LPC845 Breakout board has an SDK package support. I used the SCT (Sctimer) SDK driver API in the software. The MCUXpresso SDK Builder has open source drivers, middleware, and reference example applications for software development. Customize and download the SDK specific to the processor and then import the zip file to the project in MCUXpresso IDE.
                                                                                                                                                                                               
The LPC845 Breakout board also features function-configurable I/O ports through a switch matrix (SWM). This makes it easier to configure pin routing and other pin electrical features. The configuration tool which is integrated into the IDE is useful for making changes in the switch matrix. The source code is auto-generated when the pin configuration or peripherals are changed.
/* SCT_OUT2 connect to P1_0 */
SWM_SetMovablePinSelect(SWM0, kSWM_SCT_OUT2, kSWM_PortPin_P1_0);
 
The source code for this application and board info for the LPC845 Breakout board can be found here.
I have built an application to interface an accelerometer with the new LPC845 Breakout board using the I2C SDK driver.
The accelerometer acts as an I2C slave device to the LPC845 master device. Colors on the on-board RGB LED change according to the accelerometer position.
 
The accelerometer is a slave device in this application with slave address: 0x1D. The position of the board is determined by the x,y,z-axis values obtained from this slave device. The change in these x,y,z values detects the movement of the LPC845 Breakout board. I have assigned various patterns to the RGB LEDs for each movement along the y-axis. 

 

Refer to the table for the hardware Connections for this application:
The NXP MMA8652 3-axis accelerometer on the breakout board can be connected using I2C protocol. SCL, SDA lines and can be powered via VDD, VDDIO and GND pins.

Connect pins of I2C master and slave as below:
MasterSlave
Pin NameBoard LocationPin NameBoard Location
SCL CN1-23SCL J2-3
SDACN1-22SDAJ2-4
VCCCN1-40VDD/VDDIOJ1-3/4
GND CN1-20GND J1-5

The LPC845 Breakout board has an SDK package support. I used the I2C SDK driver API in the software for interfacing the hardware components. The MCUXpresso SDK Builder has open source drivers, middleware, and reference example applications for software development. Customize and download the SDK specific to the processor and then import the zip file to the project in MCUXpresso IDE.
                                                                                                                                                                                               
The LPC845 Breakout board also features function-configurable I/O ports through a switch matrix (SWM). This makes it easier to configure pin routing and other pin electrical features. The configuration tool which is integrated into the IDE is useful for making changes in the switch matrix. The source code is auto-generated when the pin configuration or peripherals are changed.
/* I2C0_SDA connect to P0_11 */
SWM_SetFixedPinSelect(SWM0, kSWM_I2C0_SDA, true);

 

/* I2C0_SCL connect to P0_10 */
SWM_SetFixedPinSelect(SWM0, kSWM_I2C0_SCL, true);
 
The source code for this application and board info for the LPC845 Breakout board can be found here.
Using SDK drivers for LPC845 Breakout Board, this project measures the ambient light intensity by using LDR (Light Dependent Resistor). The voltage values from LDR are read through an ADC. The new LPC845 Breakout board has an SDK support which makes it a lot easier to interface an LDR for measuring light intensity compared to the conventional coding style. I have used the MCUXpresso IDE for modifying the pins and clock configuration settings.
The project requires a resistor and LDR (Light Dependent Resistor)/Photoresistor in a resistor divider circuit as shown below:
ldr-circuit.jpg

The value of R1 here is 4.4Kohm. 

The output of this resistor divider circuit is connected to the assigned ADC channel. In this application, I have assigned it to the ADC0_8 channel which is the PIO0_18 (pin 3) and configured it accordingly in the software.
Components used: LPC845 Breakout Board, Light Dependent Resistor(LDR)/Photoresistor, 2.2Kohm resistor (Quantity:2)
LPC845 Breakout Board connections to the LDR are as shown:
LPC845LDR
Pin NameBoard LocationPin Name
ADC_8PIO0_18 (CN1-3)resistor divider o/p
VCCCN1-40LDR
GNDCN1-204.4k resistor
image.png
For this application, I have used ADC0_8 as the ADC channel which converts the LDR output analog voltage values to digital values. The values printed on the console window reflect the change in the light intensity.
(For testing purposes, the light intensity can be changed by covering the LDR or using a cellphone flash)
The LPC845 Breakout board has an SDK package support. I used the ADC SDK driver API in the software for interfacing the hardware components. The MCUXpresso SDK Builder has open source drivers, middleware, and reference example applications for software development. Customize and download the SDK specific to the processor and then import the zip file to the project in MCUXpresso IDE.
                                                                                                                                                                            
The LPC845 Breakout board also features function-configurable I/O ports through a switch matrix (SWM). This makes it easier to configure pin routing and other pin electrical features. The configuration tool which is integrated into the IDE is useful for making changes in the switch matrix. The source code is auto-generated when the pin configuration or peripherals are changed.
 
/* ADC_CHN8 connect to P0_18 */
SWM_SetFixedPinSelect(SWM0, kSWM_ADC_CHN8, true);
The source code for this application and board info for the LPC845 Breakout board can be found here.
int main(void)
{
/* Initialize board hardware. */
BOARD_InitPins();
BOARD_BootClockRUN();
BOARD_InitDebugConsole();
/* Configure the converter and work mode. */
ADC_Configuration();
while(1)
{
/* Trigger the sequence's conversion by software */
ADC_DoSoftwareTriggerConvSeqA(DEMO_ADC_BASE);
/* Wait for the converter to be done. */
while (!ADC_GetChannelConversionResult(DEMO_ADC_BASE, DEMO_ADC_SAMPLE_CHANNEL_NUMBER, &adcResultInfoStruct))
{
}
/* Display the conversion result */
PRINTF("adcResult = %d\r\n", adcResultInfoStruct.result);
}
}