Hogwarts Wand Docs: ../sw/wiohw1.inc

Wand Sourcecode: ../sw/wiohw1.inc

;
; wiohw1.inc - Wand IO definitions for HW rev1 (prototype)
;
;
; 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 0 Analog input (F)
    ;  4  0 0 unused (output low)
    ;  3  1 0 Analog input (C)
    ;  2  1 0 Analog input (B)
    ;  1  1 0 Analog input (D)
    ;  0  1 0 Analog input (A)
    ;
KERNVAL_PORTA   equ 0x00
KERNVAL_TRISA   equ 0x2f

    ;          PORTB
    ; bit t v
    ;  7  1 0 display LED (P) (use tris to switch on/off) (base)
    ;  6  1 0 display LED (O) (use tris to switch on/off)
    ;  5  1 0 display LED (N) (use tris to switch on/off)
    ;  4  1 0 display LED (M) (use tris to switch on/off)
    ;  3  1 0 display LED (L) (use tris to switch on/off)
    ;  2  1 0 display LED (K) (use tris to switch on/off) (tip)
    ;  1  1 0 Enable accelerometer (G) (use tris to switch on/off)
    ;  0  1 0 Analog input (E)
    ;
KERNVAL_PORTB   equ 0x00
KERNVAL_TRISB   equ 0xff

KERNVAL_TRISB_LED_MASK  equ 0xfc

#define bk_led5     TRISB,2     ; tip
#define bk_led4     TRISB,3
#define bk_led3     TRISB,4
#define bk_led2     TRISB,5
#define bk_led1     TRISB,6 
#define bk_led0     TRISB,7     ; base

#define b_acc_disable       TRISB,1
#define bki_led_alive       vki_led_val,4
#define bki_led_serial      vki_led_val,2
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 (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

;
; PORTA pin 0 is a dont care so use it for bits that are undefined in hw1
;
#define b_maxbright_disable     PORTA,0
#define b_medbright_disable     PORTA,0


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:42 PDT 2007