Flameman/fingerboard

EARLY PROOF VERSION

= 68hc11 =

intro


http://www.embeddedtronics.com/computers.html


 * BSP
 * app
 * 68hc11 cross compiler build
 * buffalo
 * etc

Introduction to the 68HC11

 * "La complessità architetturale è una mezza via tra le semplificazioni fin quasi eccessive dei PIC midrange o ATMega, e i più cervellotici 16-bit con gli occhi a mandorla come alcuni design legacy di Renesas (Hitachi + Mitsubishi) o Fujitsu. Tuttavia si tratta di un chip che - pur con tutto il suo enorme fascino, come d'altronde l'80552 Philips o altri colpi di genio dell'epoca - ormai pare risentire dell'età, specialmente per le criticità e le palesi limitazioni nelle aree del clock, dell'ADC, delle seriali sincrone/asincrone."

The 68HC11 (6811 or HC11 for short) is a 8-bit microcontroller (µC) family originally from Motorola, now produced by Freescale Semiconductor, descended from the Motorola 6800 microprocessor. It is a CISC microcontroller. The 68HC11 devices are more powerful and more expensive than the 68HC05 microcontrollers, and are used in barcode readers, hotel card key writers, amateur robotics, and various other embedded systems. The MC68HC11A8 is available in a 48-pin dual in-line package (DIP), as well as the 52-pin plastic leaded chip carrier (PLCC) as shown above.

Internally, the HC11 instruction set is upward compatible with the 6800, with the addition of a Y index register. (Instructions using the Y register have opcodes prefixed with the byte 0x18). It has two eight-bit accumulators, A and B, two sixteen-bit index registers, X and Y, a condition code register, a 16-bit stack pointer, and a program counter. In addition, some instructions treat the A and B registers as a combined 16-bit D register.

Different versions of the HC11 have different numbers of external ports, labeled alphabetically. The most common version has five ports, A, B, C, D, and E, but some have as few as 3 ports (version D3). Each port is eight-bits wide except for D, which is six bits (in some variations of the chip, D also has eight bits). It can be operated with an internal program and RAM (1 to 768 bytes) or an external memory of up to 64 kilobytes. With external memory, B and C are used as address and data bus. In this mode, port C is multiplexed to carry both the lower byte of the address and data.

A MC68HC24 port replacement unit is available for the HC11. When placed on the external address bus, it replicates the original functions of B and C. Port A has input capture, output compare, pulse accumulator, and other timer functions; port D has serial I/O, and port E has an analog to digital converter (ADC).

The Freescale 68HC12 is an enhanced 16-bit version of the 68HC11.

The Freescale 68HC16 microcontroller is intended as a 16-bit mostly software compatible upgrade of the 68HC11.

synthesizable VHDL implementation
http://www.gmvhdl.com/hc11core.html

buffalo
The standard bootloader for the HC11 family is called BUFFALO, "Bit User Fast Friendly Aid to Logical Operation" (a BUFFALO prompt seen on the serial port at bootup is a sign that a board's flash memory has been erased). Not all HC11 models come with the BUFFALO bootloader. The 68HC11A0 and A1 do not but the A8 does.

srec talker
i am developing it

teach
http://www.owlnet.rice.edu/~elec201/Book/6811_asm.html

http://www.owlnet.rice.edu/~elec201/Book/hardware.html

Fast and simple insert code into crt0.s
Submitted by imajeff on Fri, 2006-09-22 18:22. Advise | Tricks

Some time ago there was a question of the sort, "How do I make my own crt0.o file". Then the buzz started, and everyone was talking about how to do these things, including relocating RAM and other hardware configuration.

It seemed overly dificult to worry about things like finding the original crt0.s file (I've only found it burried in the GCC source code), and taking chances of changing too much so it didn't properly initialize RAM and such. Well, I have a solution where all I do is insert my startup code in a specific slot within the default crt0.s without having to edit that file!

Here is my entire "startup.s" file:

startup.s
.section .install1 movb #0x39,0x10 ; INITRM: end 0x3fff movb #0x00,0x11 ; INITRG: start 0 movb #0x08,0x12 ; INITEE: end 0x0fff
 * Startup code
 * Author Jefferson Smith

Referring to the guide "Using the GNU Development Tools for 68HC11 and 68HC12" section 4.2, I notice that the memory section ".install1" is a "placeholder for applications". The reason is that if I add code to this section, it is automatically inserted between the stack pointer initialization and the default RAM initialization. This is a wonderful place to relocate RAM or hardware registers because no stack was used (have not called __premain yet) and no memory was accessed except the instruction to initialize SP.

If you have quite a lot of code to insert here, you could `call` into a PPAGE bank so the init code doesn't take up fixed Flash space.

This is an example of the link commandline that uses startup.s:

m6811-elf-gcc -m68hcs12 -mshort -Wl,-T,ldscript-rom.x -mrelax -o test.elf test.o vectors.o startup.o -lm -lbcc -lc -lbcc

Simply adding startup.o to the list of objects inserts the code.

interesting links
http://tcrobots.org/members/akili.htm

http://controls.ame.nd.edu/microcontroller/main/

cross compilers: http://www.geocities.com/ResearchTriangle/1495/ee_c_compilers.html

datasheet
http://www.freescale.com/files/microcontrollers/doc/data_sheet/M68HC11E.pdf

Features

 * Improved silkscreen.
 * Jumper selectable reset address. Reset vector can be located at 0xFFFE,0xFFFF or 0xBFFE,0xBFFF.
 * Optional external battery backup capable.
 * Optional external memory mapped LCD capable.
 * Optional Low Dropout voltage regulator ready.
 * Optional remote reset through serial port.
 * Reset switch now added along side download switch on the communications board.
 * Smaller overall footprint, 2" x 4", with the attached communications board.
 * Same professional board quality as before.

Specifications

 * Motorola 68HC11 CPU.
 * 256kbit (32Kbyte) Dallas battery-backed memory module, no need to use eproms or slower eeproms.
 * Compact size 2" X 2.85" (main CPU board)
 * Network capable Serial Peripheral Interface (SPI).
 * No expensive hardware programmer needed, programs can be downloaded using a standard serial port.
 * Expansion Ports, list of headers:
 * Port A of 68HC11, 8 multi function I/O pins (JP8).
 * Port E of 68HC11, 8 analog channels (JP7).
 * Memory mapped I/O, Finger Board can be easily expanded to have 32 digital inputs and 32 digital output lines (JP9).
 * IRQ and XIRQ lines brought out for external interrupts (JP11).
 * Standard 9 pin serial port (P1).
 * SPI high speed serial interface, an easy way to attach peripherals (JP4).
 * LCD display interface (JP2).
 * Sharp IR receiver input (JP10).
 * Speaker output (JP12).
 * Infrared transmitter output (JP13).
 * MODB select (JP18)
 * External A/D reference input (JP6)
 * SRAM battery backup (JP19)

Power requirements

 * 7 to 18 Volts DC. Can easily run from a 9 Volt DC battery.
 * Current consumption: 24ma.
 * DC without communications board < 10ma in WAIT mode, or STOP mode 30ma.
 * DC with communications board.
 * Dimensions:
 * CPU board only 2.85" long 2.0" wide.
 * Communications board 1.15" long 2.0" wide.
 * CPU board with attached communications board 4" long 2.0" wide.

Memory map
Reset vector can be located at 0xFFFE,0xFFFF or 0xBFFE,0xBFFF.

The Finger Board operates the 68HC11 in "Special Mode". This causes the interrupt vectors to be located at address $BFC0-BFFF. While operating in "Special Mode", the 68HC11 can switch back and forth between expanded mode operation and single-chip mode. Interactive C switches the 68HC11 to single-chip mode when it communicates with the LCD since the LCD module cannot communicate at the normal rate of the peripheral bus.

On power-up with S1 depressed, the 68HC11 enters "Special Bootstrap Mode". This is when the internal boot loader is used to upload a more extensive bootloader which will then load your srecord program code. After your program code has been loaded and a reset is issued, the 68HC11 enters "Special Test Mode" and will automatically jump to the program with the reset vector location stored at $BFFE:BFFF.

When using other languages, make sure to declare your interrupt vectors in the "Special Mode" range of $BFC0 to $BFFF.

The Finger Board II now has the option to set the reset vector to location $FFFE:FFFF with jumper JP18 (MODB).

For more information, please see chapter 3 of the Motorola 68HC11 reference manual.

How much free memory do I have after loading the IC pcode? After loading the pcode, there are approximately 16320 bytes of available program space. The pcode source code can be modified and re-compiled to take up a smaller footprint in memory. Routines such as the IR and Motor PWM subroutines can be deleted if not needed for your application.

This is the approximate breakdown of the memory space. (Thanks to fredm@media.mit.edu)

User program object code + user global variables: 16320 bytes available Runtime pcode OS: 7936 bytes Used stack space for user processes: 6656 bytes Used buffer for interaction process: 256 bytes Used buffer for printing: 256 bytes used

LCD
The Finger Board uses LCD's with the Hitachi chip set HD44100 and HD44780. Some of the older LCD displays require a -5volt bias and will not work. If the version of the LCD contains a single row header, 1 X 14, connect the pins in the same pattern as on JP2. Pin 1 on LCD connects to pin 1 on JP2 etc.

This is the pin assignment of the LCD.

Pin 01 - gnd Pin 02 - 5volts Pin 03 - gnd (contrast pin, ground for highest contrast) Pin 04 - RS (register select) < A9 Pin 05 - R/W (read/write) < A8 Pin 06 - /enable <- 68hc11.PortA.4 Pin 07 - db0 (data bus) Pin 08 - db1 Pin 09 - db2 Pin 10 - db3 Pin 11 - db4 Pin 12 - db5 Pin 13 - db6 Pin 14 - db7

Features

 * Compact "DX" form factor (2.8" x 2.1")
 * Works with any 68HC11 E series microcontroller
 * 9.8304 MHz crystal
 * 32K EEPROM
 * 512 bytes internal RAM (on MCUs)
 * Hardware Write Protect switch for EEPROM
 * Design incorporates 68HC24 port replacement unit (PRU) for full 68HC11 port compatibility
 * 26 general purpose I/O lines (including 3 input captures and 5 output compares)
 * Pulse accumulator, hardware timer, real-time interrupt, watchdog, 2 hardware interrupts
 * 8 channel 8-bit analog-to-digital converter
 * Serial peripheral interface (SPI) port offers virtually unlimited expansion
 * Serial Communications Interface (SCI) port, with programmable baud rate up to 38,400
 * RS-232 serial port, utilizing on-chip SCI (4-pin connector)
 * SCI compatible with MIDI and RS485/RS422
 * On-board reset circuit and button, 5V regulator, and RS232 interface
 * Low power requirements (45 mA nominal; much less in STOP mode)
 * All port pins are brought out to standard 50-pin connector pattern
 * Virtual plug-in interchangeability with all Adapt11 family boards
 * 11 connector options for the ultimate in modular design capabilities
 * Use programming language of your choice: C, BASIC, assembler, etc.
 * Compatible with JBug11 and PCBug11 debug/monitor programs
 * Easy program-loading via MicroLoad, JBug11, PCBug11, ICC11, etc.
 * Compatible with BASIC11 Compiler/Simulator/Debugger/Terminal IDE for Windows
 * Low cost-- ideal for educational and embedded applications
 * Many accessories available

Memory map
0000-01ff internal ram 0200-0fff 3.5K external ram 1000-103f internal register block 103f-1fff reserved 2000-7fff 24k external ram 8000-ffff 32k eeprom e000-ffff 8k eeprom

Features
http://handyboard.com/

Handy Board

The Handy Board is based on the 52-pin 8-bit CPU Motorola MC68HC11A1 processor, and includes:

* MIT Handy Board and Serial/Battery charger boards with ALL components soldered * All components on both boards (MC68HC11A1, L293D motor drivers, IR demodulator...etc.) * 16x2 LCD display * RJ11 modular cable * DB9&DB25/DB25 Serial downloading cable * Interactive-C 4.x (the freeware program from KISS the robot institute) * 1 (8 x 1.5V AA) battery holder * 32K of battery-backed static RAM * four outputs for DC motors * two outputs for servo motors - there are plans for an expansion board to increase this to 8 * digital and anlaog inputs that allow active sensors to be individually plugged into the board * This design is ideal for experimental robotics project, but the Handy Board can serve any number of embedded control applications.

The Handy Board is a based on the 6811 microprocessor with 32K of static RAM, so just about any 'HC11 development tools may be used with it. A wide range of options are available for developing software on the Handy Board, including free assembly language tools provided by Motorola, and commercial C compilers.

Additionally, the Handy Board is shipped with access to the free KISS Interactive C, the programming environment. Interactive C (IC4.0) is a multi-tasking, C language based compiler that includes a user command line for dynamic expression compilation and evaluation. Originally created for student use, IC has a wide range of applicability to research and prototyping efforts.

gel
http://gel.sourceforge.net/gel.php