X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp.git/blobdiff_plain/bad2d92d98f9990ee5ccf509c0eafe5b3af9f4dc..cdc4625b124f725fbc9462d5592d1d3be2aa613a:/z180/config.inc diff --git a/z180/config.inc b/z180/config.inc index 652b5ae..dfb41cd 100644 --- a/z180/config.inc +++ b/z180/config.inc @@ -1,7 +1,25 @@ +FALSE equ 0 +TRUE equ NOT FALSE -FOSC equ 9216 ;Oscillator frequency [KHz] -PHI equ FOSC*2 ;CPU frequency +banked equ true + +;----------------------------------------------------- +; CPU and BANKING types + + +CPU_Z180 equ TRUE +CPU_Z80 equ FALSE + +ROMSYS equ FALSE + +AVRCLK equ 18432 ;[KHz] + + if CPU_Z180 + +;----------------------------------------------------- +FOSC equ AVRCLK/2 ;Oscillator frequency [KHz] +PHI equ FOSC*2 ;CPU frequency (clock doubler enabled) ;----------------------------------------------------- ; Programmable Reload Timer (PRT) @@ -16,8 +34,21 @@ PRT_TC10MS equ PHI / (PRT_PRE/10) ;----------------------------------------------------- ; MMU -SYS$CBAR equ 0C8h -USR$CBAR equ 0F0h +COMMON_SIZE equ 16*1024 ;Common Area size in bytes + ;must be multiple of 4K + +if (COMMON_SIZE mod 1000h) + .printx COMMON_SIZE not multiple of 4K! + end ;stop assembly +endif + +CSK equ COMMON_SIZE/1000h ; +CA equ 10h - CSK ;common area start +BA equ 0 ;banked area start + +SYS$CBR equ 0 +SYS$CBAR equ CA*16 + CA ;CBAR in system mode +USR$CBAR equ CA*16 + BA ;CBAR in user mode (CP/M) BANKS equ 18 ;max nr. of banks @@ -26,34 +57,81 @@ BANKS equ 18 ;max nr. of banks CREFSH equ 0 ;Refresh rate register (disable refresh) CWAITIO equ 3 shl IWI0 ;Max I/O Wait States, 0 Memory Wait States - - -ROMSYS equ 0 - - if ROMSYS +PHI_X2 equ 0 ;set to M_X2CM to enable the clock doubler + + endif ;CPU_Z180 + if CPU_Z80 + +PHI equ AVRCLK/5 ;CPU frequency [KHz] +BAUDCLCK equ AVRCLK/10 ;Baudrate clock [KHz] +;BDCLK16 equ + +SIOAD EQU 0bch +SIOAC EQU 0bdh +SIOBD EQU 0beh +SIOBC EQU 0bfh + +CTC0 EQU 0f4h +CTC1 EQU 0f5h +CTC2 EQU 0f6h +CTC3 EQU 0f7h + +; +; Init Serial I/O for console input and output (SIO-A) +; +; Baudrate clock: 1843200 Hz (Bus connector pin A17) +; +; Baudrate Divider SIO CTC +; --------------------------------- +; 115200 16 16 1 +; 57600 32 16 2 +; 38400 48 16 3 +; 19200 96 16 6 +; 9600 192 16 12 +; 4800 384 16 24 +; 2400 768 16 48 +; 1200 1536 16 96 +; 600 3072 16 192 +; 300 6144 64 92 + + endif ; CPU_Z80 + + if ROMSYS c$rom equ 0a5h ROM_EN equ 0C0h ROM_DIS equ ROMEN+1 + if CPU_Z180 CWAITROM equ 2 shl MWI0 - endif + endif + endif -DRSTNUM equ 30h ;DDTZ Restart vector (breakpoints) +DDTZRSTVEC equ 030h ;DDTZ Restart vector (breakpoints) +INIDONE equ 03Fh ;CP/M skip hw init, if this address +INIDONEVAL equ 080h ; is set to this value. -msg_rx_fifo_len equ 256 -msg_tx_fifo_len equ 256 +mtx.fifo_len equ 32 ;Message transfer fifos +mtx.fifo_id equ 0 ; This *must* have #0 +mrx.fifo_len equ 32 +mrx.fifo_id equ 1 +ci.fifo_len equ 32 ;AVRCON Character I/O via AVR +ci.fifo_id equ 2 +co.fifo_len equ 32 +co.fifo_id equ 3 -s1.rx_len equ 256 ;Serial 1 (ASCI1) buffers -s1.tx_len equ 256 ; +s1.rx_len equ 128 ;Serial 1 (ASCI1) buffers +s1.rx_id equ 4 ; +s1.tx_len equ 128 ; +s1.tx_id equ 5 ; -AVRINT5 equ 40h -AVRINT6 equ 50h +AVRINT5 equ 4Fh +AVRINT6 equ 5Fh ;PMSG equ 80h ;----------------------------------------------------- -; Definition of (locical) top 2 memory pages +; Definition of (logical) top 2 memory pages sysram_start equ 0FE00h stacksize equ 80 @@ -67,24 +145,26 @@ iv2tab equ ivtab + 2*9 ;----------------------------------------------------- - +o.id equ -4 o.mask equ -3 o.in_idx equ -2 o.out_idx equ -1 .lall -mkbuf macro name,size - if ((size & (size-1)) ne 0) or (size gt 256) +mkbuf macro id,name,size + if ((size AND (size-1)) NE 0) OR (size GT 256) .printx Error: buffer ^size must be power of 2 and in range 0..256! name&.mask equ ;wrong size error else + db id ds 3 name:: ds size name&.mask equ low (size-1) if size ne 0 name&.end equ $-1 name&.len equ size + name&.id equ id endif endif endm @@ -101,4 +181,3 @@ inidate macro dseg ds ??ps.len endm -