Skip to the content
2 layers74.9 × 48.3 mmTms5220-atmega, the printed circuit board in 3D

TMS5220 exploration unit

Size
74.9 × 48.3 mm
Copper layers
2
Thickness
1.6 mm
Parts
32
Nets
37
Pads
151
Tracks, vias
306, 0
Pours
2
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
7 Apr 2020
Updated
24 Apr 2020

Overview

Tms5220-atmega is an open-source printed circuit board by madworx, from the madworx/tms5220-atmega repository on GitHub. It is a 2-layer board of 74.9 × 48.3 mm with 32 parts on 37 nets, routed with 306 tracks and 0 vias.

It is built around the ATMEGA328P-PU, UB232R and TPS6735D. Its parts include 8 capacitors, 8 connectors, 6 ICs, 5 resistors and 3 diodes. It belongs with the AVR (ATmega, ATtiny) and NXP (LPC, Kinetis, i.MX RT) boards of this library.

Main components

3

README

README.md

TMS5220 Exploration unit

This project was created to try out the Texas Instruments TMS5220 Voice synthesis processor (of TI99/4A, Apple II Echo 2, and various pinball/arcade games fame).

First off, a word of warning: The PCB being powered by potentially three sources (PSU, Communication USB, AVR ISP), I've observed some weird behavior with power unexpectedly flowing in the wrong direction, causing intermittent system interruptions, host USB-port lock-up requiring system restart and one burnt MCU.

Preferably disconnect the PSU before connecting the ISP and move the J3 jumper to programming mode.

The project as it currently is is rather "build your own" but since the project was created to let me toy with the TMS5220 chip, it's not likely to see any major improvements in the forseeable future.

PCB rendering

Software environment

  • avrdude
  • avr-gcc

Peripherials setup

Programmer (AVR ISP)

I used a cheap usbasp clone.

UB232R

The UB232R interface needs to be configured using the FT_Prog tool:

  • High Current I/O's to be disabled.

  • Under the IO Controls section, output on pin C0 should be set to CLK12, providing the Atmega 328P with a system clock of 12MHz.

The baud rate is the USB interface is configured by the host operating system driver. The MCU UART baud rate need to be matched to this.

Atmega 328P

  • lfuse should be programmed to external clock without /8DIV (0xE0):
text
avrdude -p m328p -c usbasp -U lfuse:w:0xE0:m

TMS5220 details

D/A

10-bit twos-complement.

text
|           |  PC latice outputs                                      |            |             |
|-----------|---------------------------------------------------------|------------|-------------|
| Value     |  YD  YC  YB  YA  Y9  Y8  Y7  Y6  Y5  Y4  Y3  Y2  Y1  Y0 | D/A input  | Analog (uA) |
|-----------|---------------------------------------------------------|------------|-------------|
| > +127    |  0   1   1   x   x   x   x   x   x   x   x   x   x   x  |  11111111  |      0      |
| > +127    |  0   1   0   x   x   x   x   x   x   x   x   x   x   x  |  11111111  |      0      |
| > +127    |  0   0   1   x   x   x   x   x   x   x   x   x   x   x  |  11111111  |      0      |
| +127      |  0   0   0   1   1   1   1   1   1   1   1   x   x   x  |  11111111  |      0      |
| +126      |  0   0   0   1   1   1   1   1   1   1   0   x   x   x  |  11111110  |      5.86   |
| etc.      |  0   0   0   .   .   .   .   .   .   .   .   x   x   x  |  ........  |     .....   |
| +1        |  0   0   0   0   0   0   0   0   0   0   1   x   x   x  |  10000001  |    738.00   |
| 0         |  0   0   0   0   0   0   0   0   0   0   0   x   x   x  |  10000000  |    744.00   |
| -1 (off)  |  1   1   1   1   1   1   1   1   1   1   1   x   x   x  |  01111111  |    750.00   |
| -2        |  1   1   1   1   1   1   1   1   1   1   0   x   x   x  |  01111110  |    755.80   |
| etc.      |  1   1   1   .   .   .   .   .   .   .   .   x   x   x  |  ........  |   .......   |
| -128      |  1   1   1   0   0   0   0   0   0   0   0   x   x   x  |  00000000  |   1500.00   |
| < -128    |  1   1   0   x   x   x   x   x   x   x   x   x   x   x  |  00000000  |   1500.00   |
| < -128    |  1   0   1   x   x   x   x   x   x   x   x   x   x   x  |  00000000  |   1500.00   |
| < -128    |  1   0   0   x   x   x   x   x   x   x   x   x   x   x  |  00000000  |   1500.00   |

Timing diagram

  • ROMCLK = 160kHz (= 6,26uS = 75x 12MHz cycles -> 37.5 cycles per level):
  • T11 is pulled high before the start of each 10-bit word. (Note: The T11/IO cycle will run as long as the TMS chip is powered, regardless if any SPEAK or SPEAK EXTERNAL commands are currently running or not.)
text
 | 36| 36| 36| Clock cycles @ 12MHz

                             |
  ___     ___     ___     ___v    ___     ___     ___     ___     ___     ___     ___     ___     ___     
_|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   *ROMCLK*
          _______            :
_________|       |___________:____________________________________________________________________________   *T11*
                          ___:___________________________________________________________________________
_________________________|  lsb  |       |       |       |       |       |       |       |       |  msb  |   *I/O*
                             ^
                             |
                             +-- This is where we sample & store the value of I/O.

Code structure

  • TMS5220 flag us that it's ready to receive data with the use of the ~READY signal.

  • On negative edge trigger: Sample I/O pin, shift storage byte and add bit. (This should be in the range of ~15 instructions)

  • On positive edge trigger: Perform state-based logic (max ~35 clock cycles to complete each operation).

  • A full write of DBUS on the TMS requires us to write to three different ports on the Atmega. (~15 instructions each)

Accessing the USB UART under linux with 250000 baud rate

text
 $ setserial -a /dev/ttyUSB0 spd_cust
 $ setserial -a /dev/ttyUSB0 divisor 64 # for 375000
 $ setserial -a /dev/ttyUSB0 divisor 96 # for 250000
 $ stty -F /dev/ttyUSB0 38400
 $ socat TCP-L:1147 FILE:/dev/ttyUSB0,b38400,raw,echo=0

Afterthoughts on PCB design

  • Atmega reset button on PCB would be nice.
  • Proximity to other components makes the jumpers hard to access.
  • Should have used a trimmer with lower resistance and a base resistor of higher value to enable more accurate tuning of ROMCLK.
  • Possibly some form of "mode switch" to select different functions in the MCU.
  • Could likely have been powered by USB directly, eliminating the external PSU. (However, need to take into account that +5 and -5V needs to be applied more or less simultaneous)
  • Hard to dislodge the TMS chip due to resistor in the way.
  • Bottom mounting of TMS resistor on PCB due to placement near socket edge -- has been fixed in current PCB layout, but not in manufactured ones.
  • Hard to dislodge Atmega328P due to resistor in the way -- has been fixed in current PCB layout, but not in manufactured ones.
  • A status LED or two would be nice.
  • Reading more about the TMS chip, I could have driven the "TESTING USE ONLY" PROMOUT pin to -5 to enable external clocking, removing timing constraints for the MCU.
  • The "programming mode" jumper in the end turned out quite useless -- a proper RESET of the TMS-chip usually cleared up any inconsistencies.
  • Multiple pins connected to TMS5220 that in the end weren't needed.
  • Power drainage is much higher than expected; Around 500mA and LM7805 reaches 51 degrees C.

Oscillator caps

TMS5220 T11, ROMCLK, IO

TMS5220 T11, ROMCLK, IO

TMS5220 ROMCLK output

TMS5220 ROMCLK output

UB232R-CLK12

ub232r-clk12

Connected to Atmega328P:

ub232r-clk12-connected

References

Parts

32
QtyValueFootprintReferences
2220Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P1.90mm_VerticalR1, R2
2LEDLED_THT:LED_D3.0mmD2, D3
1+5VConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalJ6
1-5VConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalJ7
10.1uCapacitor_THT:CP_Radial_D4.0mm_P1.50mmC9
10.33uCapacitor_THT:CP_Radial_D4.0mm_P1.50mmC8
1100uCapacitor_THT:CP_Radial_D4.0mm_P1.50mmC6
110kResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P1.90mm_VerticalR5
110pCapacitor_THT:C_Disc_D4.7mm_W2.5mm_P5.00mmC2
110uCapacitor_THT:CP_Radial_D4.0mm_P1.50mmC4
110uHInductor_THT:L_Axial_L11.0mm_D4.5mm_P15.24mm_Horizontal_Fastron_MECCL1
11uCapacitor_THT:C_Disc_D4.7mm_W2.5mm_P5.00mmC3
1200kPotentiometer_THT:Potentiometer_Bourns_3296W_VerticalRV1
13k3Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR4
147kResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P1.90mm_VerticalR3
147uCapacitor_THT:C_Disc_D4.7mm_W2.5mm_P5.00mmC7
147uCapacitor_THT:CP_Radial_D4.0mm_P1.50mmC5
174LS138Package_DIP:DIP-16_W7.62mmU5
1ATmega328P-PUPackage_DIP:DIP-28_W7.62mm_SocketU1
1AVR-ISP-6Connector_IDC:IDC-Header_2x03_P2.54mm_VerticalJ1
1Barrel_Jack_MountingPinConnector_BarrelJack:BarrelJack_CUI_PJ-063AH_HorizontalJ2
1Conn_01x02Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ5
1Conn_01x03Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ3
1D_SchottkyDiode_THT:D_DO-41_SOD81_P2.54mm_Vertical_AnodeUpD1
1GNDConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ8
1LM7805_TO220Package_TO_SOT_THT:TO-220-3_Horizontal_TabDownU4
1ROMCLKConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalJ4
1TMS5220Package_DIP:DIP-28_W15.24mm_SocketU2
1TPS6735Package_DIP:DIP-8_W7.62mmU3
1UB232RUB232R:UB232RIC1

Similar boards

  • 2 layersBedheater, the printed circuit board in 3D

    Bedheater

    baverbud/m3dheatedbed

    DIY M3D heated printer bed

    21 partsGPL-3.0
  • 2 layers68.8 × 53.6 mmZArduino, the printed circuit board in 3D

    ZArduino

    zmaker/arduino_cookbook

    gli sketch del nuovo progetto Arduino Cookbook e dei video di YouTube

    46 parts269
  • 2 layers76.3 × 122.8 mmDiscipad pcb, the printed circuit board in 3D

    Discipad pcb

    coseyfannitutti/discipad

    17-key numpad assembled with only through hole components, including usb type-c

    63 parts221GPL-3.0
  • 2 layers111.3 × 106.4 mmSuper Sixteen v1, the printed circuit board in 3D

    Super Sixteen v1

    matthewcieplak/super-sixteen

    Code and schematics for the Super Sixteen Eurorack sequencer

    141 parts171
  • 2 layers247.6 × 99.2 mmRomeo pcb, the printed circuit board in 3D

    Romeo pcb

    coseyfannitutti/romeo

    Staggered 40% keyboard pcb that can be assembled with only through hole components, including USB Type-C

    138 parts148GPL-3.0
  • 2 layers90 × 140 mmDrumkid, the printed circuit board in 3D

    Drumkid

    mattybrad/drumkid

    Version 4 was the first successful working design, with full code, schematics, Gerbers, etc available on GitHub.

    70 parts137
  • 2 layers238.1 × 375.5 mmFramework, the printed circuit board in 3D

    Framework

    stevennguyen/framework

    Ortholinear keyboard with a knob

    197 parts131
  • 2 layersLM80C R6, the printed circuit board in 3D

    LM80C R6

    leomil72/LM80C

    A Z80-based homebrew computer withTMS9918, AY-3-8910, Z80 CTC, Z80 PIO, and Z80 SIO

    153 parts123GPL-3.0

Questions

How big is the Tms5220-atmega PCB?

It measures 74.9 × 48.3 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Tms5220-atmega use?

32 parts, built around the ATMEGA328P-PU, UB232R and TPS6735D. 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 Tms5220-atmega KiCad files?

From the madworx/tms5220-atmega repository on GitHub, at the commit this page was made from: the board is hardware/TMS5220-Atmega.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Tms5220-atmega design in my own project?

Its repository states no licence, so its author keeps all rights: ask madworx before reusing the design.