diff -up ./coridium-armmite-lpc2103-equates.asm.orig ./coridium-armmite-lpc2103-equates.asm
--- ./coridium-armmite-lpc2103-equates.asm.orig 2012-04-12 19:29:36.000000000 -0700
+++ ./coridium-armmite-lpc2103-equates.asm 2012-04-12 19:58:50.000000000 -0700
@@ -0,0 +1,33 @@
+;;; -*- Mode:Asm Mode:outline-minor-mode outline-regexp:";;;+" comment-start: "; " -*-
+
+;;; coridium-armmite-equates.asm
+
+;;; Frank Sergeant frank@pygmy.utoh.org modified by John Comeau jc.unternet.net
+;;; Equates specific to the Coridium ARMmite board
+
+ ;; it will be preprocessed into armmite-p2103-equates.s by
+ ;; the preprocessor that converts semicolons to at-signs so
+ ;; it can be included in various assembly programs for the
+ ;; Coridium board.
+
+;;; Equates
+
+ ;; The STAT LED is on PORT0, pin 15
+ ;; Note, P0.15 is in position 15 (dec) or 0x0F (hex)
+ ;; in decimal
+
+ ;; 3322 2222 2222 1111 1111 1100 0000 0000
+ ;; 1098 7654 3210 9876 5432 1098 7654 3210
+ ;; xxxx xxxx xxxx xxxx Yxxx xxxx xxxx xxxx
+ ;; 0000 0000 0000 0000 0000 0000 0000 0000 in binary
+ ;; 0 0 0 0 8 0 0 0 = 0x00008000 in hex
+
+ ;; So an orr or bic(and) mask is 0x00008000
+
+ .equ STAT_LED_MASK, 0x00008000
+ .equ LED_MASK, STAT_LED_MASK
+
+;;; Test of an equate that cannot be loaded into the Lisp *equates* table
+
+ .equ BADKEY, 37 + 24
+ .equ BADKEY2, 0B00110101
diff -up ./custom-lpc2103.asm.orig ./custom-lpc2103.asm
--- ./custom-lpc2103.asm.orig 2012-04-12 19:21:48.000000000 -0700
+++ ./custom-lpc2103.asm 2012-04-12 21:22:17.000000000 -0700
@@ -36,15 +36,15 @@
;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.include "equates-lpc2xxx.s"
- .include "olimex-lpc2103-equates.s"
+ .include "coridium-armmite-lpc2103-equates.s"
- .equ PLLCLKIN, 14745600 ; Main crystal clock frequency
+ .equ PLLCLKIN, 20000000 ; Main crystal clock frequency
.equ PLL_MULTIPLIER, 1 ; Multiplier must be 1 since we turn off PLL
.equ CPUDIVISOR, 1 ; (does the 2103 have a cpu clock divisor?)
.equ PCLKDIVISOR, 4 ; must be 1, 2, or 4
.equ TIMER0_PRESCALE_DIVISOR, 1 ; (does the 2103 have a timer prescale divisor?)
;.equ BAUDRATE, 115200
- .equ BAUDRATE, 38400
+ .equ BAUDRATE, 19200
.equ SPIDIVISOR, 128 ; slow it way down for testing -- fcs 31 July 2006
@@ -356,4 +356,4 @@ ledOffSub:
;; add r6, r6, #4
;; ldr TOS, [r6] ; read AD0DR3
;; nxt
-
\ No newline at end of file
+
diff -up ./makefile.orig ./makefile
--- ./makefile.orig 2012-04-12 19:14:17.000000000 -0700
+++ ./makefile 2012-04-12 19:21:32.000000000 -0700
@@ -10,17 +10,17 @@
# Set especially these variables for your environment
# ######################################################################
-PORT = /dev/ttyS0
+PORT ?= /dev/ttyUSB0
BIN = /usr/local/arm/bin
PREASM = /usr/local/bin/preasm.tcl
# I would like to make CCLK conditional upon the chip (or board) but
# that information is not available at the time 'make xxx.dl' is run.
# So, this must be edited for the particular board you are working with.
-CCLK = 14746
+CCLK ?= 20000 # 20MHz for ARMmite revs 1 and 2
# Download speed for the serial port (for the flash loader)
-DLBAUD = 38400
+DLBAUD = 19200 # default for ARMmite revs 1 and 2
INCLUDES = custom-lpc23xx.s custom-lpc2106.s custom-lpc2103.s custom-lpc2294.s
diff -up ./manual.html.orig ./manual.html
--- ./manual.html.orig 2012-04-12 22:55:20.000000000 -0700
+++ ./manual.html 2012-04-12 23:13:04.000000000 -0700
@@ -1906,6 +1906,45 @@ where /dev/ttyS0
is the ser
rate and 14746
is the speed of the crystal in KHz of the board I'm
using (i.e., 14.746 MHz).
+If the above doesn't work, as it doesn't in the case of the Coridium ARMmite which uses DTR and RTS, you will need the -control
option. Here it is without:
+
+
+jcomeau@intrepid:~/rentacoder/jcomeau/armmite$ lpc21isp src/sample.hex /dev/ttyUSB0 19200 20000 +lpc21isp version 1.79 +File src/sample.hex: + loaded... + converted to binary format... + image size : 5232 +Image size : 5232 +Synchronizing (ESC to abort).................................................................................................... no answer on '?' ++ +
+and here with -control
active:
+
+
+jcomeau@intrepid:~/rentacoder/jcomeau/armmite$ lpc21isp -control src/sample.hex /dev/ttyUSB0 19200 20000 +lpc21isp version 1.79 +File src/sample.hex: + loaded... + converted to binary format... + image size : 5232 +Image size : 5232 +Synchronizing (ESC to abort). OK +Read bootcode version: 2 +2 +Read part ID: LPC2103, 32 kiB ROM / 8 kiB SRAM (0x4FF11) +Will start programming at Sector 1 if possible, and conclude with Sector 0 to ensure that checksum is written last. +Erasing sector 0 first, to invalidate checksum. OK +Sector 1: ............................... +Sector 0: .............................................................................................. +Download Finished... taking 6 seconds +Now launching the brand new code ++ diff -up ./riscy.tcl.orig ./riscy.tcl --- ./riscy.tcl.orig 2012-04-12 23:59:15.000000000 -0700 +++ ./riscy.tcl 2012-04-13 14:05:36.000000000 -0700 @@ -27,7 +27,7 @@ set ::serialPort1 "/dev/ttyS0" # note, serial port can be overridden on the command line with the # -port option (e.g., ./riscy.tcl ... -port /dev/ttyS0) -set ::baudrate 38400 +set ::baudrate 19200 proc filenameFromBlockNumber {num} { if {[between $num 0 999]} {return kernel.fth} @@ -1754,7 +1754,9 @@ proc openSerialPort1 {} { } if {[catch { set tty1 [open $serialPort1 w+] - fconfigure $tty1 -mode $::baudrate,n,8,2 -translation binary -buffering none \ + fconfigure $tty1 -mode $::baudrate,n,8,1 \ + -translation binary -buffering none \ + -ttycontrol {RTS 0 DTR 0} \ -blocking 1 -handshake none -timeout $::serialTimeout1 }] != 0} { error "cannot open serial port1 $serialPort1"