Introduction


This website contains information and tutorials that were gathered and developed for the purposes of developing an advanced course in Embedded System Design. Dr. Chris Myers from the ECE department heads the project collaborating with Dr. John Regehr from the School of Computing. Sivaram Gopalakrishnan, a graduate student from the ECE department is the TA involved in this course development.
 
Initially, there are links to some interesting embedded system design courses that are being taught at various universities. Later, there is information regarding different ARM micro-controller boards (their datasheets, cost, features etc.).  Furthermore, there are some links to software, hardware and tutorials necessary for programming a specific ARM micro-controller board (LPC-2129). 


Courses

Links on ARM boards

http://www.newmicros.com/

Datasheet for the ARM7TDMI-S core that the Philips chip is based on

Datasheet.pdf


Boards

Plug an ARM, Click on Plug-an-ARM link after you enter the website. Price: $90
Philips LP2129 ARM Proto Board, 2xCAN & RS232. Price:$80
Philips LPC2214 (ARM) Header Board, USB. Price:$90
Philips LPC2106 (ARM) Prototype Board, RS232. Price:$60
Philips LPC2124 (ARM) Header Board, RS232. Price:$60
Philips LPC2129 (ARM) Header Board, RS232, CAN. Price:$65
Philips LPC2294 (ARM) Header Board, USB, CAN. Price:$100

Here is a link that lists a set of ARM microcontroller boards from various companies such as Philips, Analog Devices, TI, ATMEL etc. It gives a brief description about the interface and some features, however does not include the price. Also there is a link for some ARM projects from this website. 

Equipments to be ordered

Boards: Philips LPC2129 (ARM) Header Board, RS232, CAN. Price:$65

Cable
: ARM JTAG Debugger & Programmer for Philips LPC21xx. Price: $24
Additional info for ARM-JTAG is found here.

Optional: RS-232 DB-9 Cable. Must be available in the lab.

Interface Cable between the microprocessor board and the bread board. Price: $??
More info: Chris Strong

Power Supply: 5-9 volts power adapter. Price: $12-$15

Breadboards, LEDs, Resistors. Price: $??

Potentiometer 3310C. Price: $??

Software:
Option#1: Rowley Associates CrossWork for ARM 30 days evaluation version. C compiler and debugger works smoothly with ARM-JTAG and programs both Flash and RAM on LPC21xx. So far Rowley is the only vendor who has worked around the undocumented Philips FLASH programming via JTAG problem. They first load a small bootloader into RAM that then gets data from the JTAG interface that is then passed on to the Philips IAP bootloader to write Flash segments.
Price: CrossWorks (educational) for ARM — £99

Option#2: IAR Systems EWARM - 30 days C compiler and debugger evaluation version. Can't program LPC21xx Flash; user can debug and program only in RAM, then re-build project and use Philips' ISP utility to load the program through RS232 bootloader. There are also starter kits for the LPC2129 board.

Latest information: EW-ARM C compiler and debugger (free for assembly language, 16K limit for C) from IAR Systems. Latest release can program LPC21xx Flash. C-SPY driver for ARM-JTAG have some glitches on newer and faster computers and does several crashes before connect to target. It works fine on older and slower computers though. IAR either is not able to support Wiggler either is interested to not support it to may sell their expensive J-LINK USB tool.

Option#3: Macraigor Systems GCC Free Gnu Toolchain: Debugger works smoothly with ARM-JTAG. Can't program LPC21xx Flash via JTAG; user can debug and program only in RAM, then re-build project and use Philips' ISP utility to load the program through RS232 bootloader.

Option#4:  WinARM  The gnu-tool chain and several tools and samples for ARM controller/processors for MS-Windows-Platforms. This website has a plethora of information.

Debugging using ARM-JTAG + OCDRemote + Insight Debugger:  test.ps

Note: While debugging make sure the following configuration is maintained. 

1. The pins (8 and 15) are shorted in the ARM-JTAG Cable. All recently produced ARM-JTAG cables by Olimex already have these pins shorted in them.
2. The printer port on the computer set to EPP mode in the BIOS. 
3. Changes to Makefile

RUN_MODE = RAM_RUN :Code should be compiled for RAM. Cannot debug in Flash   
OPT = 0 : To avoid compiler optimization
DEBUG = stabs : dwarf-2 is not supported by the old gdb version
4. Make sure the DBG jumper pin is shorted while downloading and open while running the program.

Debugging:

1. Install the Macraigor cygwin environment (www.macraigor.com/full_gnu.htm). For windows install the cygwin environment + GNUARM toolkit + OCDRemote. For Linux install GNUARM toolkit + OCDRemote.

2. Open the Macraigor cygwin shell

3. go to /usr/local/bin

4. Connect the arm-jtag to the board

5. type

ocdremote -c ARM7TDMI -p 8888 -d WIGGLER -a 1 -s 7 -b 115200

6. You should get a message

ocdremote 2.13: WIGGLER via LPT 1 at speed : 7

JTAG <-| CPU<1> ARM7TDMI : listening on port 8888 |<- JTAG SDI

7. Open another Macraigor cygwin shell

8. goto /usr/bin/

9. type

arm-elf-insight

10. A debugger opens up. Click on File/Target Setting and configure the following

Target: Remote/TCP

Hostname: localhost

Port: 8888

11. Select File/Open and choose the file that was created during compilation.

12. Select Run/Connect to target. The ocd-remote window will display a message

CPU[1] Accepted gdb connection on port 8888

13. Select Run/Download. The download status can be seen at the bottom of the insight-window.

14. Now remove the DBG jumper on the board

15. Click on Run/Run.

16. The debugger can be run on the source or assembly or mixed mode. Alternatively the source and the assembly can also be viewed in a split window format. 


In-System Programming (ISP) using Philips Flash Utility for Linux: lpc.ps

1. Download the lpc21isp utility from

http://www.cs.utah.edu/~regehr/lpc21isp

2. To check the various options available in the command type

lpc21isp

The following information is obtained.

Portable command line ISP for Philips LPC2000 family and
Version 1.27                              Analog Devices ADUC 70xx
Compiled for Linux: Aug 26 2005 17:35:55
Copyright (c) by Martin Maurer, 2003-2005 Email: Martin.Maurer@clibb.de
Portions Copyright (c) by Aeolus Development 2004
                             http://www.aeolusdevelopment.com

Syntax: lpc21isp [Options] file comport baudrate Oscillator_in_kHz

Example: lpc21isp test.hex com1 115200 14746

Options: -bin                  for uploading binary file
              -hex                  for uploading file in intel hex format (default)
              -term                for starting terminal after upload
              -termonly         for starting terminal without an upload
              -detectonly       detect only used LPC chiptype (PHILIPSARM only)
              -debug              for creating a lot of debug infos
              -control            for controlling RS232 lines for easier booting
                                       (Reset = DTR, EnableBootLoader = RTS)
              -logfile             for enabling logging of terminal output to lpc21isp.log
              -ADARM           for downloading to an Analog Devices
                                       ARM microcontroller ADUC70xx
             -PHILIPSARM   for downloading to a microcontroller from
                                       Philips LPC2000 family (default)

3. Connect the RS232 cable to your micro-controller board and make sure that the BSL and the JRST pins are shorted.

4. To be able to get it to work on linux the com port is usually /dev/cua0 (or /dev/ttyS0) for COM1, /dev/cua1 (or /dev/ttyS1) for COM2 and so on.

5. Additionally the -control option should also be used as it helps in controlling the RS232 lines for easier booting and helps in eliminating synchronization issues.

6. A typical command to program using COM1 with a baudrate of 115200 and an oscillator frequency of 14746 would look like

lpc21isp -control -PHILIPSARM filename.hex /dev/ttyS0 115200 14746


Programs

1. LED Blink switch example (lpc2129_blinkswitch)

2. Analog to Digital Conversion (lpc2129_adc)

3. Pulse width modulation (lpc2129_pwm)

4. CAN implementation (lpc2129_CAN)

5. LED Blink switch example: interrupt driven (lpc2129_irq

Documents

Design of an ARM microcontroller based cirsuit board for the AmphiBot II robot 

ARM Cross development with eclipse 

These documents are a good read and they are useful in addressing some hardware issues.