Changes
PAL16L8
,Programmable Array Logic (PAL). Not to be confused with PAL, the colour encoding system for analog televisions.
The CPC6128 second page of 64KB RAM is controlled by a PAL 16L8 chip. It has the Amstrad part number 40031.
On the CPC 6128 schematic, it is top centre: [http://www.cpcwiki.eu/imgs/4/4a/CPC6128_Schematic.png CPC6128 Schematic] however the X inputs aren't distinguished.
<br>
== PAL I/O port ==
Note that no settings are stored in the Gate Array itself regarding the MMR register. But the PAL and Gate Array share an I/O port address so that it appears to be the same chip to the programmer.
Bit14 of the PAL selection address can be at 0 or 1 on CPCs equipped with CRTCs 3/4.
It must be at 1 on CRTCs 0/1/2 (The result is not guaranteed).
For compatibility reasons, it is strongly advised to always set bit14 to 1 to select PAL. Furthermore, if bit14=0 then CRTC will be selected too.
The recommended I/O port address is &7Fxx.
Moreover, the PAL only respond to I/O Write requests while the Gate Array will respond no matter what the Read/Write I/O signal is. [https://www.grimware.org/doku.php/documentations/devices/gatearraydo=export_xhtml Source]
<br>
== PAL MMR register ==
This register controls how the extended RAM is banked into the CPU address space. It doesn't affect the video display at all as the (even in C3 mode). The [[Gate Array]] can only access the unmapped Base 64k page of RAM.
{| class="wikitable"
<br>
== PAL I/O port = Page order ===
<br>
</pre>
<br>
== Initial replacement equation (Porchy) ==
The following equations were worked out by Porchy (member on CPCWiki Forum). These can be used to program replacements:
A15OUT = (!X2 & !X1 & A14
== Fixed version (Gerald) ==
Original version from Porchy suffer suffers from a bad handling of the RAMDIS signal. This cause It caused screen artefact when accessing an external extension RAM like XMEMexpansion.
A14OUT = !( !A14
[[File:Amstrad.cpc6128.pal.ga.jpg]]
=== IC Models used in CPC ===
These are the ones known to be used in the CPC by looking at pictures of CPC mainboards:
* HAL16L8ACN [https://www.cpcwiki.eu/imgs/6/67/CPC6128_PCB_Top_%28Z70290_MC0020F%29.jpg Source]
* PAL16L8ACN [https://www.cpcwiki.eu/imgs/4/4e/CPC6128_PCB_Top_%28Z70290_MC0020G%29.jpg Source]
They both wear the same Amstrad part number 40031. On the Amstrad chassis schematic diagram, this part is numbered 40030. [https://www.cpcwiki.eu/imgs/4/4a/CPC6128_Schematic.png Source]
<br>
== 576KB vs 640KB total ==
Bits 3, 4, 5 allow to define up to 8 pages of 64K for RAM expansion at a given address range in addition to the 64K base RAM. The internal second 64K RAM bank of the CPC 6128 is usually disabled when a RAM expansion is used, as the 64K enhanced RAM in the 6128 would use the same address range (&7Fxx) as the first 64K of the RAM expansion. This gives you 576K of total RAM on a CPC.
However, if the RAM expansion decodes the [[Standard_Memory_Expansions#Extended_1M-4M_Expansions_.28RAM7.2FYarek-style.29|A8 address line]], you can access the internal second RAM bank of the 6128 from another range (&7Exx). The [[X-MEM]] and [[CPC_iRAM#CPC_iRAM.2F640|iRAM/640]] expansions implement this and therefore can provide 640K of total RAM. [https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/extram-512kb-to-640kb-for-cpc6128-on-one-dip20-chip-slg46533v-dip/msg247763/#msg247763 Source]
<br>
== 4MB RAM expansions ==
Beware about 4MB RAM expansions. The upper 2MB (Port 7Bxxh, 7Axxh, 79xxh, 78xxh) of a 4MB RAM expansion can conflict with other hardware as setting A10 to 0 is also used for many hardware expansions.
See the [[Default I/O Port Summary|I/O Port Allocation Rules]] to understand why.
The practical safe maximum on Amstrad CPC with [[Standard Memory Expansions]] is 2MB.
<br>
== Related pages ==
*[[media:Programmable Array Logic PAL16L8ACN.pdf|PAL16L8 datasheet]]
*[[Gate Array and ASIC Pin-Outs]]
*[[Standard Memory Expansions]]
[[Category:Hardware]] [[Category:CPC Internal Components]] [[Category:Electronic Component]] [[Category: Memory expansions]][[Category:Programming]] [[Category:Datasheet]]