Showing posts with label NXP. Show all posts
Showing posts with label NXP. Show all posts

Monday, 28 September 2015

New toy: LPC11U68 (Cortex-M0, 256KB of Flash, 36 KB RAM)

This is a very interesting device. Low-power Cortex-M0 but with plenty of program and RAM memory. Unfortunately, I didn't instantly find a dev board that I liked, so I built my own.

Its running but ... external oscillator PLL lock fails. Maybe its just that the oscillator is poorly placed (long legs etc).

On internal RC runs 100% like it should (yes, MBED blinky example works, led is blinking in pin PIO1_13). Unfortunately, that means that USBPLL can't be used (the accuracy of the IRC is not enough = USBPLL lock fails).

Any advice on debugging PLL lock problems and external oscillator considerations are welcome.



 

Wednesday, 22 July 2015

Debugging in EmBlocks part 1: LPC1347 core speed and .SVD files

I now have my Jlink up and running and debugging the EzSBC2 in EmBlocks. Since I am a bit suspicious how the mbed library handles things, I wanted to check the core clock speed from the debugger.

Checking the core speed from System Registers


However, when I tried to look at the System Registers debug window to verify that my LPC1347 is indeed running at the correct MHz, the window was empty.

What we need is a so-called device description file (.SVD) that describes the internal registers of the MCU to the debugger.

You can get the .SVD for LPC1347 from NXP lpcware site here. 

Stick the .svd file path into your Debug->Interfaces settings thus:


After I had put in the .svd and restarted the debugger, I finally got the info I needed:

NOTE: you will see register values only when the debugger is halted !! NOT when the MCU is running.

SYSPLLCTRL says MSEL is 5. Therefore main clock is (MSEL+1)*oscillator (12 MHz) = 72 Mhz.
SYSAHBCLKDIV says DIV is 1, therefore core clock is main / 1.

= System Core Clock is 72 MHz, as intended.

Monday, 20 July 2015

Blinking EzSBC2 LED's in mbed online compiler

User Jim Kizos has written the basic blinky for EzSBC2 in the mbed environment.

main.cpp is like thus:

#include "mbed.h"

// EzSBC2 has 2 LEDs P1_15 and P1_16

DigitalOut Led1(P1_15);

DigitalOut Led2(P1_16);

int main()
{
    while(1)
    {
        Led2 = !Led2;
        wait_ms(250);
        Led1 = !Led1;
        wait_ms(250);
    }
    }


 Tricky bit 1:

There is no target "EzSBC2" in the mbed online compiler. We need to target DipCortex-M3. You can use all the mbed examples for DipCortex M3, provided you change the pinout to suit the EzSBC2 !

 Tricky bit 2:

Remove the precompiled mbed library. Import the mbed-src full source library into your program. This is because there is a bug in the export to offline IDE / EmBlocks script - the library is not included in the package if you export the official pre-built mbed library - i.e. you won't be able to build in EmBlocks with the package you'll get !! When you export the program with the mbed-src, you'll get everything and will be able to build in EmBlocks (the next blog entry will be about this).


Wednesday, 24 June 2015

Getting started with NXP LPC1347 (ARM Cortex-M3)

After working on AVR ATmegas for a while, I decided to get back to ARM's.
This blog is intended to be a journal of all the things I encounter on the way.

Out with ATmega (Arduino), in with ARM

I have nothing against Arduino. This picture depicts my general feeling on the state of my hobby at the moment.

Playing around with Arduinos and the ATmega328 (32 kB Flash, 2kB RAM) in particular I got frustrated by the need to have a USB to Serial converter in my projects (i.e. the chip that enables you to connect your Arduino to your PC). I also constantly ran out of program space. Going to "bigger" ATmegas was not an option - ATmega2560 is hugely expensive in my opinion and still doesn't have USB built in.


I set my sights on the LPC1347 because it had the right mix of features for me:
  • drag n' drop programming (built-in USB bootloader)
  • 64 kB of on-chip Flash
  • 12 kB of SRAM
  • runs at 72 Mhz
  • is 32 bits
  • can be programmed on the mbed platform