-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nova.html
101 lines (72 loc) · 3.25 KB
/
nova.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
title: Shinra's Homepage
---
{% include_relative header.html %}
<h1>Nova - Non-volatile RAM and RTC for Amstrad CPC</h1>
<div id="generated-toc" class="generate_from_h2"></div>
<h2>Introduction</h2>
<p>Nova provides a real-time clock and non-volatile (battery backed up) RAM for the CPC.</p>
<p>There are two main uses identified for it, but it can be used to do many things.</p>
<p>The real-time clock can be used by filesystem/mass storage ROMs to set the correct file
creation or modification dates.</p>
<p>The NVRAM can be used to store settings from ROMs and other software (but in a lot of cases,
it is just as easy to store that on disk).</p>
<p>The RAM is accessed as normal RAM, in 8K pages. The scheme is intentionally not compatible with
standard memory expansions. This allow mapping the RAM in and out as needed, which can be very
useful if you use it as a debugging tool or a temporary buffer for something that should not use
the main RAM for whatever reason.</p>
<h2>Ordering information</h2>
<p>The card costs 35€ including shipping (it is a bit more expensive than other cards due to the
price of the NVRAM chip and battery)</p>
<p>Orders are open. Contact PulkoMandy by email, by IRC (#CPC-fr on libera.chat) or on the cpcwiki forum
for more information and to select a payment method.</p>
<h2>Usage documentation</h2>
<p>The interface uses port FE82 for mapping the NVRAM in and out. It is possible to map it at any
address multiple of &2000.</p>
<p>The high 4 bits determine the base address.</p>
<p>For example:</p>
<pre>
OUT &FE82,&0x ' to map at 0000-1FFF
OUT &FE82,&2x ' to map at 2000-3FFF
...
OUT &FE82,&Ex ' to map at E000-FFFF
</pre>
<p>The NVRAM, when it is enabled, masks 8K of RAM or ROM and replaces it with its own contents.</p>
<p>The low 4 bits determine what is mapped:</p>
<pre>
OUT &FE82,x8 ' map the first 8K page
OUT &FE82,x9 ' map the second 8K page
OUT &FE82,xA ' map the third 8K page
OUT &FE82,xB ' map the fourth 8K page
</pre>
<p>For the 8K version, only page 4 is available.</p>
<p>Any other value for the 4 low bits unmaps the NVRAM and restores the normal RAM or ROM behavior.</p>
<p>In the fourth page, the last 8 bytes are not normal RAM, but can be used to read and write the
time from the realtime clock. So your CPC can know which day and time it is. In the other pages
(if available) there is only RAM.</p>
<p>Access to the RTC works this way (assuming the interface is mapped at 6000-7FFF):</p>
<pre>
OUT &FE82,&6B ' Map page 4 at 6000-7FFF
POKE &7FF8,&40 ' Put the card in RTC read mode (7FF8-7FFF will stop updating)
year = PEEK(&7FFF)
month = PEEK(&7FFE)
day = PEEK(&7FFD)
weekday = PEEK(&7FFC)
hour = PEEK(&7FFB)
minute = PEEK(&7FFA)
second = PEEK(&7FF9)
POKE &7FF8,&00 ' Put the card in running mode (7FF8-7FFF start updating every second again)
OUT &FE82,&00
</pre>
<p>All values are in BCD format (4 bits for tenths, 4 bits for units)</p>
<p>To set the time:</p>
<pre>
OUT &FE82,&6B
POKE &7FF8,&80 ' Put the card in RTC write mode
POKE &7FFF,&21 ' for 2021
POKE &7FFE,&02 ' february
' ... and so on ...
POKE &7FF8,&00
OUT &FE82,&00
</pre>
{% include_relative footer.html %}