DISCLAIMER |
---|
This information is provided strictly "as-is", and the author accepts no liability of any kind for events which may result from its use. No warranty of any kind is made regarding perfomance, freedom from faults, etc. |
Note: The drawings comprising this design can be downloaded in the following formats:
Other downloads available:
List of figures:
From a viewpoint strictly of initialising the ROM, the CPU merely adds complexity, requiring to be isolated from the bus. With the Zilog CPU used in the example, a Reset will 3-state the address and data lines. However the Read and Write strobes, and the ROM chip enable must still be isolated by extra circuitry. In the example, this circuitry was embodied in the FPGA, however external buffers or multiplexers could be used, with a low level on the FPGA INIT line serving to indicate that external loading is in progress.
The programming circuitry is at the bottom of the drawing, and comprises the latch U8 and buffer U9. If desired, these could be put on a separate "loader" board, to reduce cost in the main PCB. The signals required at the connector would be
Pin | Name | Function | Notes |
---|---|---|---|
2 | D0 | TCK LOW\ | Pulse low to set TCK low |
3 | D1 | TCK HIGH\ | Pulse low to set TCK high |
4 | D2 | INIT\ | Used to reset the FPGA |
5 | D3 | PGM (ie Reset) | Used to reset the FPGA |
6 | D4 | TMS | TAP line: mode control |
7 | D5 | TDI | TAP line: data to FPGA |
10 | ACK | TDO | TAP line: data from FPGA |
11 | BUSY | DONE | Signal from FPGA |
When no PC is attached, the lines are pulled up by U10, which leaves PGM\ high and INIT 3-stated. Given an external pulse at PORST\ (from the power supply), the FPGA executes a normal start-up. Since the M0..M2 pins are wired to start the FPGA in Master Parallel mode, it self-loads from the ROM. During this time the HDC output is high, which holds the CPU in reset. This (in Zilog CPUs) 3-states the address and data pins. The RD\ and WR\ strobes however are not 3-stated, and are therefore buffered through the FPGA (an external 3-state buffer could have been used). This ensures that all memory lines may be driven by the FPGA without contention issues arising.
The FPGA issues ROM addresses, and drives RD/BS\ low to read the ROM.
For this reason, RD/BS\ was chosen to output the CPU's read-strobe,
since it exhibits the proper behaviour during configuration.
The ROM chip-select is fed from LDC for a similar reason.
Since Zilog CPUs boot from low memory, the FPGA code is stored downward from
the top.
Once configuration is complete, HDC falls, so causing the CPU reset line to go high. At this point the CPU commences running code, with the FPGA fully configured. The configuration should include paths from the CPU's RD\ and WR\ strobes to the RS\ and WS\ outputs (since these lines were intercepted by the FPGA).
Since both ROM and RAM chip-selects are buffered through the FPGA (so they can be controlled during configuration), means are included to access both devices via the TAP port, to aid testing.
The program now releases PGM\, while holding INIT low to prevent the FPGA from starting its configuration sequence. The TAP port is now accessible, by clocking TCK. Note the latch U8 to generate TCK: some PC parallel ports are rather noisy (especially at the end of a long cable), and this latch prevents problems due to TCK double-clocking.
C1 | C2 | Function |
---|---|---|
0 | 0 | Shift TAP data to address counter |
0 | 1 | Increment address counter |
1 | 0 | Read ROM to data register, & shift to TAP port |
1 | 1 | Shift TAP data to data register, & write to ROM |
The software is designed to allow new ROM devices (which require different programming algorithms) to be readily included, by adding new part classes, derived from the flash-ROM base class. The code supplied includes a well-used module for Intel 12V parts, and an experimental Atmel module.
Execute
LOADER 'MY_CONFIGURATION_FILE'
citing the
file holding your target FPGA configuration. The program will ask what
parallel port is used, and will then check that a FPGA is
connected.
Next the program will ask what board hardware you are
using, "reader" or "tag". This question is of historical significance
only: the correct response (for the schematic shown here) is
"Tag".
The FPGA will be configured, and you will be asked to
supply an address offset which will be added to the addresses in your
configuration-data file, to obtain the ROM addresses. This is
necessary to load at addresses above 65kB, as the Xilinx software only
handles 16-bit addresses.
A check is made that the area to be
programmed is blank: if not, you will be asked to authorize erasing
the ROM. Programming will then commence. Be aware that the Intel
erasure algorithm permits up to 1000 re-tries: do not be alarmed to
see the retry count rising to large numbers.
When programming is complete, you will be asked whether to shut down the system, or if the programmer should issue a local reset to your target board. If you select this, the TAP interface will fake a power-on reset to your board, and the configuration you have just downloaded will receive control.
![]() |
|