Blinker example for mbed board

Newcomers to Astrobe and Oberon are welcome to ask any beginner-level questions here
Post Reply
Helpdesk
Posts: 37
Joined: Sat Jan 01, 2011 5:43 am
Contact:

Blinker example for mbed board

Post by Helpdesk » Sat Aug 03, 2013 3:06 am

The Blinker.mod example included with Astrobe does not work on the LPC1768 mbed board. I tried both example at ..\LPC1769\Coridium and at ..\LPC1769\LPCXpresso, but it did not work.

Are they suppose to work out of the box on the LPC1768 mbed?

cfbsoftware
Site Admin
Posts: 517
Joined: Fri Dec 31, 2010 12:30 pm
Contact:

Re: Blinker example for mbed board

Post by cfbsoftware » Sat Aug 03, 2013 3:08 am

All the generic examples for the LPC17x boards (e.g. the mbed) are located in the LPC1769\General folder. The examples in the other folders are specific to those boards. However, they can be used as a starting point if the peripherals are very similar (i.e. I2C-based, SPI-based etc.)

Refer to:

Astrobe > Help > Contents and Index > Getting Started > Quick Start Guide > LPC1769 Microcontrollers

For a step-by-step example of how to modify the Blinker examples to work on different boards.

The mbed has 4 LEDs that you can use. They are connected to pins P1.18, P1.20, P1.21, P1.23. So, if you started with the LPCXpresso example and wanted to flash the LED connected to pin P1.18, you should

a) Change the declaration:

Code: Select all

CONST
  (* led connected to pin P0.22 *)
  ledBit = {22};
to

Code: Select all

CONST
  (* led connected to pin P1.18 *)
  ledBit = {18};
b) change all occurrences of FIO0xxx to FIO1xxx as the pins are on port 1 not port 0. e.g.

Code: Select all

SYSTEM.PUT(MCU.FIO1CLR, ledBit);

Post Reply