ECEN3000/3360 - Digital Design Lab  


Lab 2: Understanding How the Arm Cortex M0 Actually Works

2 lab periods

The LPCXpresso Development
        Board
Figure 1.  The LPCXpresso LPC1114 board.

Introduction

In the previous lab, we learned how to use the Arm Cortex M0 to do some work for us--specifically, we made a digital oscilloscope, and with less than $5 in parts (1 microprocessor, 1 oscillator, 1 resistor, 6 capacitors, and an LED).  In doing so, we learned how an embedded software IDE is used and got a feel for some of the capability available to us through such a platform.  So, now that we are able to use it we can do some pretty powerful things, but without knowing how our code is working underneath we will always be limited in what we can do.

Pre-lab

For the pre-lab, write a function in C which implements a look-up style table to convert a single digit integer 0-9 into it's Morse code equivalent, with 1 being long and 0 being short. This will be similar to the code needed as part of the translateFib function described below.
You must implement this without enumerating all possibilities using if and else statements (Hint: Look into structures and arrays: C-Array and Structure examples)

Print out and hand in the code for the function, one per group. It will be collected at the beginning of lab on Tuesday and don't forget there will also be a quiz!

Part 1

The LPCXpresso Development
          Board
Figure 2. 
The Code Red debugging environment (see Section 4.1.2 of the Code Red getting started manual).

                1. Core Register View: This shows all of the registers in the processor core. Registers that have changed from step to step are
                  highlighted in yellow.
                2. Debug View: This shows you the stack trace and the debug toolbar. Using the icons at the top of the view, you can step through
                  code or execute at full speed. In the ‘stopped’ state, you can click on any particular function and inspect its local variables in the
                  right hand panel on the Variables tab.
                3. Editor: In here you will see the code you are executing and can step from line to line. By pressing the ‘i’ icon at the top of the
                  Debug view, you can switch to stepping by assembly instruction. Clicking in the left margin will set and delete breakpoints.
                4. Console View: On the lower right is the Console View. The Console View displays status information on compiling and debugging,
                  as well as program output.
                5. Quick Start View: Below, the ‘Quick Start’ view has fast links to commonly used features. This is the best place to go to find
                  options such as Build, Debug, and Import.

Part 2 (The "asm_sum_cm0.s" example)

Part 3 (The Fibonacci-driven Morse Code Generator)

For this lab portion, we will be leveraging all the knowledge you have learned over the past 2 weeks into one assignment--C programming, assembly programming, and Arm peripheral control.  Since we are covering so much, you will want to get started as early as possible to make sure it works by the end-of-lab deadline by next Tuesday.  Specifically, you will be writing a program that recursively generates Fibonacci numbers based on an always incrementing Fibonacci index n that is in the range [1,20], translate that number into it's Morse Code equivalent of short and long pulses, and display those pulses in an easy to read duration using the LED.

Code Requirements

Reference Materials

LPCXpresso Information

Cortex-M0 Information

Fibonacci and Morse Code Information