element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Freedom development platform
  • Products
  • Dev Tools
  • Freedom development platform
  • More
  • Cancel
Freedom development platform
Blog How to create new project on LPCXpresso for OM13077[Creating new project on GPIO button polling method and turning on/off LED]
  • Blog
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Freedom development platform requires membership for participation - click to join
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: bheemarao
  • Date Created: 10 Jun 2016 12:36 PM Date Created
  • Views 519 views
  • Likes 1 like
  • Comments 0 comments
  • om13077
  • lpcxpressopro
  • lpc54102
  • lpcopen
  • dual core cortex m4f/m0+
Related
Recommended

How to create new project on LPCXpresso for OM13077[Creating new project on GPIO button polling method and turning on/off LED]

bheemarao
bheemarao
10 Jun 2016

This blog is in continuation to my earlier blog on out of box on  OM13077OM13077 LPCXpresso board

Introduction to OM13077 Dual processor cores NXP LPCXpresso development board and demonstrating the existing project using LPCXpresso tool [Importing the example project and executing on NXP LPC54102  board]

Here I am creating new project for demonstrating GPIO button based on polling the input switch and glowing the user led. If button is pressed then blue led is turned on continuously and if released the led will turn off

 

The LPCXpresso54102 board includes the following features:

 

  • Dual processor cores: ARM Cortex-M4 and ARM Cortex-M0+. The M0+ core runs at the same frequency as the M4 core. Both cores operate up to a maximum frequency of 100 MHz.
  • On-board high-speed USB based debug probe with CMSIS-DAP and LPCXpresso IDE Redlink protocol options, can debug on-board LPC54102 or external target
  • Support for external debug probes
  • Tri-color LED
  • Target Reset, ISP and WAKE buttons
  • Expansion options based on Arduino UNO and PmodTm, plus additional expansion port pins
  • On-board 1.8/3.3V or external power supply options
  • Built-in MCU power consumption and supply voltage measurement
  • UART, I2C and SPI port bridging from LPC54102 target to usb via the on-board debug probe
  • FTDI UART connector

image

The board contains the new LPC54102 ultra-low-power dual core ARM Cortex-M4F/M0+microcontroller targetted at always on-sensor processing applications that can run up to 100MHz each core.

The main idea is to use the cortex-M0+ core for sensor listening data collection and aggregation, and then wake up periodically the cortex-M4F to perform complex data processing tasks.

To proceed further the below are the prerequisites:

 

1. Installed LPCXpresso IDE tool chain or you can download it from below link:

https://www.lpcware.com/lpcxpresso/download

 

2. LPCOpen examples and libraries:

http://cache.nxp.com/files/microcontrollers/software/LPCWare/lpc5410x_lpcxpresso_54102_lpcxpresso_3.01a.000_11.zip

       or

C:\nxp\LPCXpresso_8.1.4_606\lpcxpresso\Examples\LPCOpen

 

3. LPCXpresso 54102 development board hardware  OM13077OM13077

 

Open LPCXpress and select the workspace as shown below:

image

Select on New project option under quick start panel as shown below:

image

Next select the LPC54100 family and select LPC5410x (M0+) > LPCOpen- C Project as shown below:

image

Next select the project name

“GPIO-polling”

image

Next select the device:

image

Now we need to select an LPCOpen Chip library project within the current workspace

As this is the new workspace we need to import the library into working directory

image

Now select the examples archive file to import.

image

Browse the LPCXpresso installed location

“C:\nxp\LPCXpresso_8.1.4_606\lpcxpresso\Examples\LPCOpen” and select the zip file “lpc5410x_lpcxpresso_54102_lpcxpresso_3.01a.zip” which is our target board

image

image

Then select “lpc_chip_5410x_m0” as chip library for cortex-M0+ core and

LPC board library as “lpc_board_lpcxpresso_54102_m0” as shown below:

image

Now you will be able to pop down the LPCOpen Libraries as shown below

image

Now repeat the same for LPCOpen Board Library as shown

image

CMSIS DSP Library Project Selection is optional so we proceed further by clicking Next

image

Next in Memory Configuration Editor select default flash driver

image

Next in printf option page let it be as default and click “finish”

image

Now our project folder looks as shown below:

image

It has Board library and Chip library included in the project as shown

Now we will start to perform our task i.e implement polling based button sensing, if button is pressed then LED-Blue is turned on and if we release the button then Blue led is turned off

 

The hardware switch connection of the board is as shown below:

 

image

And the LED part is connected as shown below:

image

i.e SW-1 connected to Port-0-24 pin

And Blue LED is connected to Port-0-31 port pin

 

LED’s are defined in the file ”board.c”

ledBits[] = {29, 30, 31};

 

i.e RED LED connected to Port-0-29 Green to Port-0-30 and Blue to Port-0-31

 

Below is our code written in GPIO-polling.c file

 

int main(void) {

          SystemCoreClockUpdate();
                   Board_Init();
                       Board_LED_Set(0, false); //red led turned off
                             Board_LED_Set(1, false); //Green led turned off
                             Board_LED_Set(2, false); //Blue led turned off
                   Chip_GPIO_SetPinDIRInput(LPC_GPIO, 0, 24);

    // TODO: insert code here

                   while (1) {
                                      //__WFI();
                             if(Chip_GPIO_ReadPortBit(LPC_GPIO, 0, 24)== 0){
                                                Board_LED_Set(2, true);// turn on led
                                      }
                                      else
                                                Board_LED_Set(2, false); // turn off
                             }

    return 0 ;
}

 

image

Save the file and click on build button as shown above

You can see our project builds successfully as shown below

image

At this point of time we have two options in executing the project either by going to Flashing the builded binary file or selecting the debug option and execute it.

  • Flashing the program

Note: remember to build the project first this will generate GPIO-polling.axf file

Select the Flash button as shown below

image

image

Browse and select the project *.axf file to flash the board

image

“C:\Users\brao\Documents\LPCXpresso_8.1.4_606\New project\GPIO-polling\Debug”

image

Now the board is loaded with the binary and you can reset the board and check the working

 

The output execution of this demo is showed in below video

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Happy creating new project on LPCXPresso using NXP LPC54102 Development board image image image

 

 

 

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube