Interfacing Raspberry Pi and LPC1114FN28 via SPI

In one of my previous posts, i mentioned about building a toy car project using Raspberry Pi as the brain and the LPC1114FN28 for low level control. This post describes in detail of this hobby project.

Basically, in this project, the Raspberry Pi (running a minimal version of Debian, not Rasbian) acts as a master that :

  1. performs some high level calculation (software algorithm) base on the data it collects from the LPC chip (slave)
  2. Issues a control command to the slave chip (LPC) for low level control
  3. Reading image from Raspberry Camera for some vision stuffs
  4. Takes care of network communication for remote control
  5. Implements easily a lot of funny stuffs...

One question: why do not use the Pi to communicate directly with sensor or actuator ?. Although the Pi is a pretty performance system, it lacks some low level feature that we will need in this project, such as ADC for reading analog sensors, precise PWM hardware controller for motor control, etc. Therefore, i decided to used it along with the LPC chip that is more suitable for these low level stuffs.

Programming LPC1114FN28 with standard C using Newlib

Some of my old posts show how to program the ARM Cortex M0 LPC chip in a bare metal manner, although this approach provides a simple setup that requires no additional libraries, it is only for the studying purpose. It is not a good options for production since your code will be highly platform dependent and you need to handle so many low level stuffs (e.g. registers configuration). The Newlib offers a more productive way by providing a standard C interface to abstract the development on such embedded system. In using Newlib, the code is a lot simpler and more portable.

25/02/2018 LPC1114FN28, ARM, GPIO, interrupt

Arm-cortex m0 programming with LPC1114FN28 , a guild to GPIOs

This is a migrated version of my Wordpress post, written on : 14 Mars 2015

Input/Output

The LPC1114FN28 has two pin ports (0 and 1) that make totally 22 pins (12 for port 0 and 10 for port 1, as shown in the image below). All of these pins could be used as GPIOs. By default, they are all input and pull up-enable (that is each pin is connected to an internal pull-up resistor) except for PIO0_5 (dp5) and PIO04 (dp27) which are "open-drain" (a transistor connects to low and nothing else). Their functionalities can be configured easily by software.

The figure below shows the pin out of the chip, note that each PIOn_m refers to the pin m on the port n.

Programming the LPC1114FN28 using Raspberry Pi

This is a migrated version of my Wordpress post, written on : 27 February 2015

I had some Raspberries Pi A+ available on the toolbox, and i've just got idea to use one of them in my programmable car toy project. The point is that the Pi will be connected to a circuit based on the LPC1114FN28, in which, the ARM cortex M0 chip is used to collect sensor datas (IR sensor, sonar sensor, etc.) and control the motors on the car. The Pi talks to the LPC1114FN28 via a serial connection (UART or SPI), and takes care of some high level calculations based on the datas provided by the LPC chip, it then can analyse the environment's context and send commands to the slave chip to control the car. With the Pi, i can build an API to program the car's behaviour from distance via the network (using TCP protocol or HTTP protocol, via web). It's quite an interesting sujet for me.

So the first thing comes to my mind is that during the experiments, i will need to frequently update the firmware on the LPC1114FN28, so why not use the PI as a programmer for the LPC chip. The firmware is written and compiled on your PC and then is updated on the slave chip by sending it to the PI, no need to used the USB-serial adapter anymore. In this post, i'll show you how to do it, this is a part of my actual project.

ARM-Cortex M0 programming with lpc1114FN28 - an overview

This is a migrated version of my Wordpress post, written on : 27 February 2015

What is it?

The lpc1114FN28 is a low cost, low power 32 bit MCU designed in a 28dip package, it is breadboard friendly and very easy to set up for those who are new to ARM programming (like me). Some features :

  • An ARM cortex M0 processor, can run at the frequency up to 50 Hhz.
  • Built-in Nested Vectored Interrupt Controller (NVIC)
  • 32 kb on chip flash programming memory and 4kb of RAM
  • In-System Programming (ISP) and In-Application Programming (IAP)
  • UART, I2C, SPI, 10 bits ADC
  • Up to 22pins GPIO
  • And more..

It is designed mainly for micro-controller stuffs (applications), and can be easily programmed with a few more components. In fact, i'm just ancomputer scientist guy who is new to the MCU (ARM) world and that simplicity is a good point for me. I've bought some of them from Ebayand started to learn how to program it.

Powered by antd server, (c) 2017 - 2024 Dany LE.This site does not use cookie, but some third-party contents (e.g. Youtube, Twitter) may do.