NET3001 Teaching Board

MTS: microcontroller training system

motivation
current status
design
teaching opportunities
notes on machine code

Motivation

For the last few years I have been teaching a course in real time programming. The 3 month course consists of
The students write code on an embedded microprocessor, the HC12 for the last few years. The students work with a large development box which is kept in the lab area.

I wanted to create a course where the students could bring the development system home, and work with their own PC. That meant:
To demonstrate the various aspects of the course, the board must have:

Current status

I am settling on something like this

Design

CPU

I'd like the CPU to be easy to teach, which precludes the AVR series; it's Harvard architecture, and that doesn't fit well with my notes. I suppose I could jig them around a bit........

The AT91SAM series of ARM chips has a really awkward way of controlling the DDR (data direction register) on the I/O ports.

Overall, the MSP430 series seems to give a nice mixture of Von Neumann architecture and extremely low power.
Choices:
Atmel AVR
Atmel AT91SAM
Luminary ARM
TI MSP430

Debugging

The CPU needs to allow easy download and single stepping, as well as the ability to view registers and control I/O ports. All the candidate CPU's provide this function, although some of them are quite costly.

I'm settling on the MSP430 series. It can be debugged by controlling the JTAG pins, and I can add a slave CPU to the board to convert a serial protocol to the JTAG twiddling required. There is already open source software to drive the serial port and it's integrated with the development system.

The slave CPU is a $4 part, which has a built-in UART to talk to the host, and enough pins to drive the JTAG. Hopefully I will find enough pins & code space to have this device also drive the LCD. If not, at least there should be enough room in it to at least drive the LCD power; it would be to distracting to the students if they have to learn about driving a square wave out, just to light up the LCD.

Power

Almost all the chips on the board run at 3V, which is perfect for a coin cell, without regulator. In the dollar-store, you can get 2 CR2032 cells for $1.

In order to run the two motors, however, we need a lot more current, so the board has a separate set of connectors on the back to allow a 2xAAA cell battery pack to be used as an alternative, again without a regulator. If the usage does not require the two motors, then the coin cell supply will do.

The only module which requires 5V is the LCD display. So the slave CPU drives it, and pumps up a voltage doubler circuit to power the LCD when it is required.

Radio

The students in the course are also learning about network protocols in their other courses. So this board has a 2.4GHz radio transceiver. This unit is low cost, only chews about 10mA when it's running, and has a full packet fifo and MAC features (preamble, header and CRC assembly). The students can either use it at this level, or introduce a link-level protocol. The packet payload can be up to about 25 bytes, or even more if the CRC & address fields are reduced.

Motors

There are two motors on board. The DC motor is driven by two PWM pins, which allows us to speed it up and slow it down, and even reverse it.

The stepper motor is a 4 pin unipolar drive, so the drive sequences are
A...A...A...
.B...B...B..
..C...C...C.
...D...D...D
or
AA.....AAA......
.BBB.....BBB...
...CCC.....CCC..
.....DDD.....DDD
Both should be fairly easy to teach.

When the motors are used, we will have to use the AAA batteries.

Cost

Provisional: CDN$50 for parts. Labor will probably be me-&-free. Many of the parts are coming from surplus houses, and Digikey.

Teaching Opportunities

Some assignments which I am considering

Machine code notes


Just for information, I took the assignments from the last two years and compiled them on the various architectures. This table shows the bytes of code only; the bytes of data didn't change much between architectures.
Architecture
Assignment-05 (482 lines of source)
Assignment-06 (826 lines of source)
default
-Os
-O3
default
-Os
-O3
HC12
2520
1822
2214
3698*
2774*
3100*
AVR
2848
1520
5130
6738
4418
6568
ARM
3976
2672
3180/2212**
6012*
4000*
6588*
MSP430
2052
1462
1750
5402
4456
4456
x86
2929
2159
7756
5245*
3652*
7860*
*I had a hard time merging in libc, so this number is without printf() & sprintf(), which probably add a kB or so
**Thumb mode