;**************************************************************** ; 68705-P3 Device Equates for DASM, * ; Including notes on microcontroller layout. * ;**************************************************************** ; The P3 version of the 68705 is distributed in a small, 28 pin ; package, and thus lacks many of the features of the larger ; siblings of this particular micontrontroller. ; Memory is limited with 112 usable bytes of RAM and 1804 bytes ; of EPROM. Note that addresses $000-$0FF may be accessed with a ; single byte "Page Zero" addressing mode (ala 6502). ; ; An abbreviated memory map is given below: ; *$000-$00F I/O and Timer Hardware ; *$010-$07F RAM (112 Bytes) ; *$080-$0FF Page Zero EPROM ; *$100-$783 EPROM ; *$784 Mask Option Register ; *$785-$7F7 Bootstrap ROM ; *$7F8-$7F9 Timer IRQ Vector ; *$7FA-$7FB External IRQ Vector ; *$7FC-$7FD SWI Vector (Think 'BRK') ; *$7FE-$7FF Reset Vector ;**************************************************************** ; Memory Layout * ;**************************************************************** HARDWARE_BASE EQU $000 RAM_START EQU $010 RAM_END EQU $07F EPROM_ZEROPAGE EQU $080 EPROM_USER EQU $100 EPROM_MASKREG EQU $784 MASKROM_BOOT EQU $785 EPROM_IRQVecs EQU $7F8 EPROM_TimerIRQV EQU (EPROM_IRQVecs + 0) EPROM_ExtIRQV EQU (EPROM_IRQVecs + 2) EPROM_SWIV EQU (EPROM_IRQVecs + 4) EPROM_ResetV EQU (EPROM_IRQVecs + 6) ;**************************************************************** ; I/O and Timer Hardware Equates * ;**************************************************************** ;************** ; General I/O * ;************** ; All data registers are R/W, ; Data direction registers are write only, (reads return 1) ; 0->input, 1->output ; Port A is an 8-Bit I/O port, ; Bits 7->0 map to pins 27->20 respectively. PortA_Data EQU $000 PortA_DataDirection EQU $004 ; Port B is an 8-Bit I/O port, ; Bits 7->0 map to pins 19->12 respectively. PortB_Data EQU $001 PortB_DataDirection EQU $005 ; Port B is a 4-Bit I/O port, ; Bits 3->0 map to pins 11->8 respectively. ; Bits 7->4 always read as "1" PortC_Data EQU $002 PortC_DataDirection EQU $006 ;***************** ; Timer Hardware * ;***************** ; The structure of this register depends upon the ; setting of the "TOPT" bit in the Mask Option Register ; ; 7 6 5 4 3 2 1 0 ; TOPT=1 : TIR TIM 1 1 1 1 1 1 ; TOPT=0 : TIR TIM TIN TIE PSC PS2 PS1 PS0 ; ; TIR- Timer Interrupt Request ; A '1' indicates a timer IRQ has occured, ; write a zero here to clear it. ; TIM- Timer Interrupt Mask ; 1=Masked,0=Unmasked ; TIN- Timer Input Select ; 1=External clock (pin 7) ; 0=Internal clock (CPU freq/4) ; TIE- External Timer Enable ; 1=Enable external timer pin 7 ; 0=Disable ; PSC- Prescale Clear ; Write 1 to reset prescaler, ; reads return 0. ; PSx- Prescale Settings ; PS2 PS1 PS0 Div ; 0 0 0 1 ; 0 0 1 2 ; 0 1 0 4 ; 0 1 1 8 ; 1 0 0 16 ; 1 0 1 32 ; 1 1 0 64 ; 1 1 1 128 Timer_Control EQU $009 ; 8-Bit Down-Counter ; IRQ Fires when timer transitions to $00 ; The timer continues to count after the IRQ has fired, ; (and the counter value rolled over to $FF), so if ; you need auto reload, it has to be done by hand. Timer_Data EQU $008 ;**************************************************************** ; "Special" Hardware Equates * ;**************************************************************** ; This thing is only important when ; copying data into the EPROM. ; Don't worry about it. Programming_Control EQU $00B ; This thing defines some post-reset states and ; general hardware configuration. It's located ; at the end of the EPROM so these values are "safe." ; ; 7 6 5 4 3 2 1 0 ; CLK TOPT CLS TIE PS2 PS1 PS0 ; ; CLK- Oscillator Type ; 1=Resistor Capacitor ; 0=Crystal ; TOPT- Timer Option ; Controls the layout of the Timer Control ; Register (see above description). ; CLS- Timer/Prescale Clock Source ; 1=External TIMER Pin ; 0=Internal Clock ; TIE- Timer External Enable ; Sets the initial value of TIE ; PS2,PS1,PS0- ; Initial values of the prescale regs. Mask_Option EQU $784