; ; wiohw2.inc - Wand IO definitions for HW rev2 (production) ; ; ; Copyright (C) 2006 Nathan (Acorn) Pooley ; ; This program is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public License ; version 2 as published by the Free Software Foundation. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License (gpl.txt) for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ; ; You can contact the author, Nathan (Acorn) Pooley, by writing ; to Nathan (Acorn) Pooley, 949 Buckeye Drive, Sunnyvale, CA 94086, USA ; or through the form at http://www.rawbw.com/~acorn/wand/feedback.html ; ; ; RE3/MCLR is always an input; need pullup resistor ; PORTA ; bit t v ; 7 0 0 unused (output low) ; 6 0 0 unused (output low) ; 5 1 1 Enable max bright leds (W) (use tris to switch on/off) ; 4 1 0 IR LED (Z) (use tris to switch on/off) ; 3 1 1 Enable medium bright leds (X) (use tris to switch on/off) ; 2 1 0 Enable accelerometer (G) (use tris to switch on/off) ; 1 1 0 Analog input (D) ; 0 1 0 Analog input (A) ; KERNVAL_PORTA equ 0x28 KERNVAL_TRISA equ 0x3f #define b_maxbright_disable TRISA,5 #define b_medbright_disable TRISA,3 #define b_acc_disable TRISA,2 ; PORTB ; bit t v ; 7 1 0 display LED (K) (use tris to switch on/off) (base) ; 6 1 0 display LED (L) (use tris to switch on/off) ; 5 1 0 display LED (M) (use tris to switch on/off) ; 4 1 0 display LED (N) (use tris to switch on/off) ; 3 1 0 display LED (O) (use tris to switch on/off) (tip) ; 2 1 0 display LED (P) (use tris to switch on/off) (NONEXISTANT) ; 1 1 0 display LED (Q) (use tris to switch on/off) (NONEXISTANT) ; 0 1 0 display LED (R) (use tris to switch on/off) (NONEXISTANT) ; KERNVAL_PORTB equ 0x00 KERNVAL_TRISB equ 0xff KERNVAL_TRISB_LED_MASK equ 0xf8 #define bk_led7 TRISB,0 ; NONEXISTANT #define bk_led6 TRISB,1 ; NONEXISTANT #define bk_led5 TRISB,2 ; NONEXISTANT #define bk_led4 TRISB,3 ; tip #define bk_led3 TRISB,4 #define bk_led2 TRISB,5 #define bk_led1 TRISB,6 #define bk_led0 TRISB,7 ; base #define bki_led_alive vki_led_val,4 #define bki_led_serial vki_led_val,3 KERNVAL_TRISB_LED_RUN equ 0xff ; RUNSTATE_RUN KERNVAL_TRISB_LED_DEBUG equ 0xff ; RUNSTATE_DEBUG KERNVAL_TRISB_LED_HALT equ 0x6f ; RUNSTATE_HALT KERNVAL_TRISB_LED_ERROR equ 0x1f ; RUNSTATE_ERROR KERNVAL_TRISB_LED_BREAK equ 0x3f ; RUNSTATE_BREAK ; PORTC ; bit t v ; 7 1 1 RX pin (also serial_detect) ; 6 0 1 TX pin (NOTE: TRISC,TX is set by serial_enable) ; 5 0 0 unused (output low) ; 4 0 0 unused (output low) ; 3 0 1 Alive LED (S) (use tris to switch on/off) ; 2 0 0 unused (output low) ; 1 1 0 T1 OSC pin ; 0 1 0 T1 OSC pin ; ; bit7 (RX=bki_serial_detect) is SET when connected to serial ; and CLEAR when disconnected ; ; KERNVAL_PORTC equ 0xc8 KERNVAL_TRISC equ 0xc3 #define bki_alive TRISC,3 |
This file Copyright (C) 2006 by Nathan (Acorn) Pooley
Go to TOP Wand page
Go to Acorn's personal webpage
Go to Hogwarts website: www.gotohogwarts.com
Snout: www.snout.org/game
Gadgets of Justice Unlimited
Snout GC (Wiki)
Snout Wiki
File created by do_doc at Wed May 30 03:22:44 PDT 2007