Skip to the content
2 layers66.3 × 57.7 mm6847PiVGA, the printed circuit board in 3D

A recreation of the Motorola 6847P using a modern microcontroller

Size
66.3 × 57.7 mm
Copper layers
2
Thickness
1.6 mm
Parts
51
Nets
112
Pads
277
Tracks, vias
772, 66
Pours
1
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
12 Feb 2022
Updated
28 Jul 2024

Overview

6847PiVGA is an open-source printed circuit board by jimbro1000, from the jimbro1000/6847Pi repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 66.3 × 57.7 mm with 51 parts on 112 nets, routed with 772 tracks and 66 vias.

It is built around the AD724JRZ and TXS0108EPW. Its parts include 23 resistors, 17 capacitors, 7 ICs, 2 connectors and 1 diode. It belongs with the RP2040 boards of this library.

Main components

2

README

README.md

Motorola 6847P Replacement

Background

The 6847P is fairly ubiquitous in the history of 70s/80s home computers and while it provides a simple solution to video signal generation although with fairly basic capabilities in comparison with the custom video solutions of other 80s home computers.

In terms of availability, the chip is easily obtained and due to reliability, rarely needs replacing. Compared with the Sinclair ULA or Commodore VIC chips this is a bulletproof system but reliability does not equate to desirability.

The PAL version of the output generated has a very limited palette when in higher resolution modes, the NTSC version of the output utilises video artifacts to provide a wider capability but is still well behind its competitors.

Building a better 6847

There are a number of things that can be done to improve on the design and the availability of high performance, cheap microcontrollers means it is fairly simple to build a custom VDG that exhibits the same external behaviour while operating in a completely custom manner internally.

Custom fonts are a basic starting point, custom palettes are equally simple but there is scope in the system to incorporate custom modes of operation provided the same addressing and timing is retained.

The essential requirement is to replace the 6847P in the Dragon range of home computers - this significantly narrows the functional requirements of the substitute. In this scenario all addressing is performed by the accompanying SAM (MC6883) address multiplexing chip. The system also binds pins to further simplify implementation - INV and DD6 are combined, as are ~A/S and DD7, and ~INT/EXT with GM0. Without this there are simply not enough GPIO pins available on the pre-built RP Pico board (as opposed to the RP2040 chip itself).

Objectives

  1. MVP is to reproduce the existing 6847 as per the original Motorola datasheet using the RP2040 microcontroller
  2. Add custom font definition
  3. Modify palette definitions per mode
  4. Create custom video modes following original timing
  5. Create custom video modes with novel screen construction and timing

Signal Output

The 6847 provides 13 lanes of address bus to reference memory - this maps to the first 8k of the regular 16bit address space. If used in conjunction with the MC6883 SAM chip only the first bit is used to provided a clock signal to an internal address counter. This allows the use of paged video memory - all on 512 byte boundaries, potentially anywhere in the full 64k address space.

In addition, the chip provides a horizontal sync signal (consumed by the SAM)

Fully implemented the data output requires 14 gpio pins. Simplifying the implementation in conjunction with a SAM reduces the pin count to just 2.

Signal Input

The 6847 requires a clock input (CLK), 8 bits of data bus (DD0-DD7) and 8 bits of mode control:

  • ~A/G = Alpha or Graphics
  • ~A/S = Alpha or Semigraphics
  • ~INT/EXT = Internal or External alphanumerics
  • GM0 = Graphic Mode LSB
  • GM1 = Graphic Mode Bit 1
  • GM2 = Graphic Mode Bit 2 (MSB)
  • CSS
  • INV = Inverted Alphanumerics

~A/G, ~A/S, CSS and INV can be controlled on a character by character basis.

CSS selects between two possible alphanumeric colours - the effect will vary depending on the graphic mode selected

~A/G~A/S~INT/EXTINVGM2GM1GM0ModeColoursPage Size
0000XXXInternal Alphanumeric2512
0001XXXInternal Alphanumeric Inverted2512
0010XXXExternal Alphanumeric2512
0011XXXExternal Alphanumeric Inverted2512
010XXXXSemigraphics 481024
011XXXXSemigraphics 682048
1XXX00064x64 Graphics41024
1XXX001128x64 Graphics21024
1XXX010128x64 Graphics42048
1XXX011128x96 Graphics21536
1XXX100128x96 Graphics43072
1XXX101128x192 Graphics23072
1XXX110128x192 Graphics46144
1XXX111256x192 Graphics26144

The control input consumes 15 GPIO pins.

Video Output

The 6847 has three output lines - Luminance (Y), ∅ A and ∅ B.

The three signals combine to provide 9 colours - black, green, yellow, blue, red, buff (white), cyan, magenta and orange.

Y is a 6 level analogue signal, A is a 3 level analogue signal, B is a 4 level analogue signal. Not all signal combinations are valid for the primary display area. For the main display only 4 levels are needed, the other two levels are used for signal blanking and sync.

ColourYAB
Black50/12
Green100
Yellow010
Blue213
Red222
Buff012
Cyan102
Magenta123
Orange120

Using the original datasheet for reference the default output is for NTSC and requires a timing phase difference between the Y, A and B signals. Y leads the trio, B follows, then A. The Y-B delay is half the rise/fall time of Y, while the B-A delay is fully the sum of Y-B and the rise/fall time of B.

To achieve an analogue signal output from the microcontroller the signal must be synthesized from a group of digital GPIO pins.

For the 6 level Y output 3 pins are needed (actually achieves 8 levels). For A and B where 3 or 4 levels are required then just 2 gpio pins each is needed. This consumes a total of 7 GPIO pins.

Total GPIO Pin Requirements

Data input needs 14 or 2 GPIO pins - for the purposes of the MVP this will use the simple 2 pin version. Control input requires 15 GPIO pins. Video output requires 7 pins. The grand total of 24 pins.

The initial choice of the RP2040 provides 30 GPIO pins - this is adequate for the simple implementation but is inadequate for the full pin requirement of 36 pins.

6847 to GPIO pin mapping

6847 pinRP2040 pinRP Pico Pin
VSS 1VSS 57Gnd 38
DD6 2GPIO6 8GP6 9
DD0 3GPIO0 2GP0 1
DD1 4GPIO1 3GP1 2
DD2 5GPIO2 4GP2 4
DD3 6GPIO3 5GP3 5
DD4 7GPIO4 6GP4 6
DD5 8GPIO5 7GP5 7
CHB 9GPIO11GP11 15
B 10GPIO18-19 29-30GP18-19 24-25
A 11GPIO20-21 31-32GP20-21 26-27
~MS 12GPIO13 16GP13 17
DA5 13--
DA6 14--
DA7 15--
DA8 16--
VCC 17?Vbus 40
DA9 18--
DA10 19--
DA11 20--
DA12 21--
DA0 22GPIO17 28GP17 22
DA1 23--
DA2 24--
DA3 25--
DA4 26--
GM2 27GPIO10 13GP10 14
Y 28GPIO26-28 38-40GP26-28 31,32,34
GM1 29GPIO9 12GP9 12
GM0 30GPIO8 11GP8 11
~INT/EXT 31GPIO8 11GP8 11
INV 32GPIO6 8GP6 9
CLK 33GPIO15 18GP15 20
~A/S 34GPIO7 9GP7 10
~A/G 35GPIO14 17GP14 19
~RP 36--
~FS 37GPIO13 16GP13 17
~HS 38GPIO16 27GP16 21
CSS 39GPIO17 28GP17 22
DD7 40GPIO7 9GP7 10

Unused GPIO pins: 12 22 (23 24)

6847 video output levels

ColorYphi Aphi B
Green0.541.01.0
Yellow0.421.01.5
Blue0.722.01.5
Red0.721.52.0
Buff0.421.51.5
Cyan0.541.51.5
Magenta0.542.02.0
Orange0.541.02.0
Black0.721.51.5
Dark Green0.721.01.0
Dark Orange0.721.02.0

Values for Y, phi A and phi B are in volts

Y DAC

The 3 GPIO outputs can be converted to an analogue output using a resistor ladder array

GPIO 26 - 2kohm

GPIO 27 - 1kohm

GPIO 28 - 499ohm

Result is 8 levels from 0 to 7 - only the values 0 to 5 are needed. The output at level 5 needs to be peak output, to achieve this some level mapping is needed.

levelpin 2pin 1pin 0targetoutput
00000%0%
100120%14.2%
201140%42.8%
310060%57.1%
411080%85.7%
5111100%100%

A and B DAC

The outputs both use the same arrangement with just 2 pins each

GPIO 18, 20 - 1kohm

GPIO 19, 21 - 499ohm

Result on each pair is 4 levels from 0 to 3

The output for B can be direct but A only needs 3 levels which needs mapping again.

levelpin 21pin 20targetoutput
0000%0%
11050%66.6%
211100%100%

Phase 2

The next objective of development is to replace the LM889 composite modulator with the more modern AD724JR, the important detail here is that the AD724JR requires an RGB input instead of the YAB signals normally produced by the original 6847P. This in turn means we have a proper RGB signal to consume externally, not just by the AD724JR which gives us two bonuses for the price of one.

RGB output from the RP2040 is an established capability so in many ways this is actually simplifying the necessary work.

The complicating point here is that an 8 colour output is nice and simple and needs just 2 bits per component channel but the Dragon needs 9 colours (actually it is more than this as we have three shades of black generated in normal output and two different shades of orange - even if the normal green and bright orange are not generated on the same screen mode). Nonetheless, if the original output is to be retained there must be scope in the output signal to do this.

Approximation of output levels per channel for each colour:

ColourRedGreenBlue
Black0%0%0%
Red75%0%12%
Green0%100%0%
Blue12%0%75%
Yellow100%100%25%
Buff100%100%100%
Orange100%25%0%
Cyan0%87%50%
Magenta100%0%100%
Green/Black0%25%0%
Orange/Black37%0%0%
Bright Orange100%75%25%

The tricky part comes from the orange and off-black colours. All the others can be treated as simple, single bit output. All three channels require 3 bits for output, two more than the YAB output in phase 1. Fortunately we have two unused GPIO pins, and better still the desired output levels match up with the bit step values (close enough to look genuine).

Again the signal pins are building a signal through a resistor ladder:

Pin 0 -> 2k ohm
Pin 1 -> 1k ohm
Pin 2 -> 499 ohm

The ladder (assuming a 75 ohm terminator) allows for a peak voltage of 0.69V

The outputs are just combined in the same way as before to create a linear DAC.

The input to the AD724JR need to be grounded via a 75ohm pull-down resistor on each signal line, and through a 0.1uF capacitor. The concern is that the raw RGB signal is then attenuated for a parallel VGA output and may require amplifying (to be tested). Without the AD724JR the output from the ladder DAC is sufficient to drive a VGA port directly.

The VGA output still needs a hsync and vsync signal as well, these too can be driven directly (with a 47ohm resistor each), the input to the AD724JR shouldn't need the resistors in line.

AD724JR Input

Beyond the RGB, Hsync and Vsync, the AD724JR video encoder doesn't need much extra. Two 5V inputs, two grounds, a timing signal (4.43362MHz for PAL) and some fixed values for "Encode" (high for run, low for standby), "select" (low), and "standard" (low for PAL).

AD724JR Output

The encoder provides three signals for two independent outputs. The only one of these needed is "COMP" - a combined composite output. The other two are isolated chrominance and luminance outputs used in s-video.

Using the composite output on the AD724JR means the carefully controlled, phase matched Y/A/B output can be removed from the Pico's responsibility. The composite output can be fed directly to the monitor port instead, although this then would require removing or disabling the onboard signal encoder (LM1889). The new output line can be supplied directly to the video half of the power board (pin 6). If the modulator is to be retained it would need to be fed to the base pin of TR4, this then allows the AD724JR to drive composite and rf output. The simplest point to inject the signal would be pin 10 (todo: verify pin 10 or 11) of the vacated LM1889 position but this then feeds through a maze of crude amplifying transistors (TR2 and TR3) likely to destroy the quality of the signal given this task has already been performed by the AD724JR. Given the likelihood of needing a modulated RF output it is pretty much a moot point unless a need for nostalgic completeness is present.

Note: the output levels are double the normal strength to accommodate 75ohm remote termination

Parts

51
QtyValueFootprintReferences
775RResistor_SMD:R_0805_2012MetricR10, R11, R12, R13, R14, R15, R16
60.1uFCapacitor_SMD:C_0805_2012MetricC1, C2, C3, C5, C7, C10
6100nFCapacitor_SMD:C_0805_2012MetricC12, C13, C14, C15, C16, C17
6649RResistor_SMD:R_0805_2012MetricR17, R18, R19, R20, R21, R22
31K 1%Resistor_SMD:R_0805_2012MetricR2, R5, R8
32K 1%Resistor_SMD:R_0805_2012MetricR1, R4, R7
3499R 1%Resistor_SMD:R_0805_2012MetricR3, R6, R9
3TXS0108EPWPackage_SO:TSSOP-20_4.4x6.5mm_P0.65mmU5, U6, U7
210uFCapacitor_SMD:C_0805_2012MetricC9, C11
210uFCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC4, C6
11N5817Diode_SMD:D_0805_2012Metric_Pad1.15x1.40mm_HandSolderD1
14.433620MHzCrystal:Crystal_SMD_0603-2Pin_6.0x3.5mmY1
14K7Resistor_SMD:R_0805_2012MetricR23
152pFCapacitor_SMD:C_0805_2012MetricC8
1AD724JRZAD724JRZ:SOIC127P1032X265-16NU2
1AD813Package_SO:SOIC-14_3.9x8.7mm_P1.27mmU4
1Conn_01x06_MaleConnector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_VerticalJ2
1DB15_Female_HighDensityConnector_Dsub:DSUB-15-HD_Female_Horizontal_P2.29x1.98mm_EdgePinOffset3.03mm_Housed_MountingHolesOffset4.94mmJ1
1MC6847Package_DIP:DIP-40_W15.24mmU1
1PicoPackage_DIP:DIP-40_W15.24mmU3

Similar boards

  • 4 layers180 × 125 mmOther m68k, the printed circuit board in 3D

    Other m68k

    bradgrantham/other-m68k

    Generated by make -C kicad board route fab release from the commit that last touched this directory.

    171 parts
  • 4 layers120 × 46.3 mmDragonYUV, the printed circuit board in 3D

    DragonYUV

    jimbro1000/DragonPalAD724

    Translation is performed per channel to calculate the relative R-Y and B-Y values that can be combined with an inverted Y signal to produce RGB. Each output channel can then be fine tuned for strength independently.

    68 parts
  • 2 layers213 × 84.8 mmZX Max 128 Issue 3 PCB, the printed circuit board in 3D

    ZX Max 128 Issue 3 PCB

    liveboxandy/ZX-Max-128-Issue-3

    KiCAD created files for the ZX Max 128 Issue 3 designed by DonSuperfo

    170 parts
  • 2 layers119 × 63.1 mmMZ80AD724, the printed circuit board in 3D

    MZ80AD724

    Board-Folk/Sharp-MZ-80K

    Sharp MZ-80K Replica Public

    34 parts6
  • 4 layers100 × 75 mmRgb composite, the printed circuit board in 3D

    Rgb composite

    irudoy/openmfd

    That's the case. STM32 LTDC can't output INTERLACED video signal.

    68 partsMIT
  • 4 layers68.6 × 53.3 mmIcezum, the printed circuit board in 3D

    Icezum

    FPGAwars/icezum

    :star2: IceZUM Alhambra: an Arduino-like Open FPGA electronic board

    218 parts357GPL-3.0
  • 2 layers94.5 × 74.4 mmAx58100-stm32-ethercat, the printed circuit board in 3D

    Ax58100-stm32-ethercat

    MetalMusings/MyOwnEtherCATDevice

    Documentation accompanying the "Make My Own EtherCAT device" video serie on Youtube.

    184 parts93
  • 4 layers80 × 100 mmBaseboard, the printed circuit board in 3D

    Baseboard

    NVIDIA-AI-IOT/my-jetson-nano-baseboard

    An open source Jetson Nano baseboard and tools to design your own.

    240 parts91

Questions

How big is the 6847PiVGA PCB?

It measures 66.3 × 57.7 mm and has 2 copper layers, 1.6 mm thick.

What parts does the 6847PiVGA use?

51 parts, built around the AD724JRZ and TXS0108EPW. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the 6847PiVGA KiCad files?

From the jimbro1000/6847Pi repository on GitHub, at the commit this page was made from: the board is 6847PiVGA/6847PiVGA.kicad_pcb and its schematic 6847PiVGA/6847PiVGA.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the 6847PiVGA design in my own project?

Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).