Flameman/fingerboard

From eLinux.org
< Flameman
Revision as of 12:20, 6 July 2009 by Flameman (Talk | contribs)

Jump to: navigation, search

EARLY PROOF VERSION

68hc11

intro

Fingerboard-board.jpg

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


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


Introduction to the 68HC11

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

crt

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

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

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/

finger board, model easII

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.


Memory Location I/O Device Notes
0000-00FF 68HC11 internal RAM Built in. (A1 chip)
0000-01FF 68HC11 internal RAM Built in. (E1 chip)
1000-103F 68HC11 control registers Built in.
4000-4FFF JP9 Memory mapped I/O Memory writes in this range enable pin 1 of JP9 expansion header. Memory reads in this range enable pin 3 of JP9 expansion header. When enabled, they are active low.
5000-5FFF JP9 Memory mapped I/O Memory writes in this range enable pin 5 of JP9 expansion header. Memory reads in this range enable pin 7 of JP9 expansion header. When enabled, they are active low.
6000-6FFF JP9 Memory mapped I/O Memory writes in this range enable pin 9 of JP9 expansion header. Memory reads in this range enable pin 11 of JP9 expansion header. When enabled, they are active low.
7000-7FFF JP9 Memory mapped I/O Memory writes in this range enable pin 13 of JP9 expansion header. Memory reads in this range enable pin 15 of JP9 expansion header. When enabled, they are active low.
8000-FFFF External RAM DS1230AB/Y Dallas 256kbit (32Kbyte) battery backed static ram. The RAM is mapped into the upper 32K block of the 68HC11 address space.
 ????-???? LCD HD44780, JP2 ... CD=PA4, addr{cmd, data}={RW=A8, RS=A9}


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 1 - gnd
Pin 2 - 5volts
Pin 3 - gnd (contrast pin, ground for highest contrast)
Pin 4 - RS (register select)
Pin 5 - R/W (read/write)
Pin 6 - enable
Pin 7 - db0 (data bus)
Pin 8 - db1
Pin 9 - db2
Pin 10 - db3
Pin 11 - db4
Pin 12 - db5
Pin 13 - db6
Pin 14 - db7 

finger board, model Adapt11C24DX

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


libraries

gel

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