]> cloudbase.mooo.com Git - z180-stamp.git/blob - z180/config.inc
9cef0511f8f72a144c7c351dec2e91c02cd27a75
[z180-stamp.git] / z180 / config.inc
1
2
3 FOSC equ 9216 ;Oscillator frequency [KHz]
4 PHI equ FOSC*2 ;CPU frequency
5
6 ;-----------------------------------------------------
7 ; Programmable Reload Timer (PRT)
8
9 PRT_PRE equ 20 ;PRT prescaler
10
11 ; Reload value for 10 ms Int. (0.1KHz):
12 ; tc10ms = phi/prescale/0.1KHz = phi / (prescale/10)
13
14 PRT_TC10MS equ PHI / (PRT_PRE/10)
15
16 ;-----------------------------------------------------
17 ; MMU
18
19 SYS$CBAR equ 0C8h
20 USR$CBAR equ 0F0h
21
22
23 BANKS equ 18 ;max nr. of banks
24
25 ;-----------------------------------------------------
26
27 CREFSH equ 0 ;Refresh rate register (disable refresh)
28 CWAITIO equ 3 shl IWI0 ;Max I/O Wait States, 0 Memory Wait States
29
30
31 ROMSYS equ 0
32
33 if ROMSYS
34 c$rom equ 0a5h
35 ROM_EN equ 0C0h
36 ROM_DIS equ ROMEN+1
37 CWAITROM equ 2 shl MWI0
38 endif
39
40
41 DRSTNUM equ 30h ;DDTZ Restart vector (breakpoints)
42
43
44 mrx.fifo_len equ 256
45 mtx.fifo_len equ 256
46
47 ci.fifo_len equ 128
48 co.fifo_len equ 256
49
50 s1.rx_len equ 256 ;Serial 1 (ASCI1) buffers
51 s1.tx_len equ 256 ;
52
53 AVRINT5 equ 40h
54 AVRINT6 equ 50h
55 ;PMSG equ 80h
56
57 ;-----------------------------------------------------
58 ; Definition of (locical) top 2 memory pages
59
60 sysram_start equ 0FE00h
61 stacksize equ 80
62
63 isvsw_loc equ 0FEE0h
64
65 ivtab equ 0ffc0h ;int vector table
66 iv2tab equ ivtab + 2*9
67
68
69
70 ;-----------------------------------------------------
71
72
73 o.mask equ -3
74 o.in_idx equ -2
75 o.out_idx equ -1
76
77 .lall
78
79 mkbuf macro name,size
80 if ((size & (size-1)) ne 0) or (size gt 256)
81 .printx Error: buffer ^size must be power of 2 and in range 0..256!
82 name&.mask equ ;wrong size error
83 else
84 ds 3
85 name:: ds size
86 name&.mask equ low (size-1)
87 if size ne 0
88 name&.end equ $-1
89 name&.len equ size
90 endif
91 endif
92 endm
93
94 ;-----------------------------------------------------
95
96 inidat macro
97 cseg
98 ??ps.a defl $
99 endm
100
101 inidate macro
102 ??ps.len defl $ - ??ps.a
103 dseg
104 ds ??ps.len
105 endm
106