CPLD Programming - jgparker/tipi GitHub Wiki

Programming the TIPI-32K CPLD with the Raspberry PI

It's relatively easy to program the CPLD on the TIPI using the Raspberry Pi, either for a newly built board or to load updates when needed. All you need is 5 female to female jumper wires and access to the Pi's Linux prompt. This can be done from the TI-99/4a console using telnet, but I really recommend SSH-ing into the Pi using PuTTY for Windows or the equivalent, so you can cut and paste the commands below into the terminal window. This procedure assumes the Pi is already connected to the internet to work, so that will have to be set up beforehand.

Installing xc3sprog

xc3sprog is the software package for programing the .jed file from the Raspberry Pi GPIO pins.

xc3sprog

To install on your Raspberry Pi, first log in to the Pi as user 'tipi' (default password is 'tipi').

Add repo and key

curl https://apt.matrix.one/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.matrix.one/raspbian $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/matrixlabs.list
sudo apt-get update

install package

sudo apt install matrixio-xc3sprog

Wiring

The JTAG port on the TIPI-32K board has the following pinout:

2 4 6 8 10
1 3 5 7  9

The Raspberry Pi IO port has the following pinout:

2 4 6 8 10 12 14 16 18 20 ...
1 3 5 7  9 11 13 15 17 19 ...

Connect the TIPI JTAG connector to the Raspberry Pi as follows:

JTAG pin purpose RPi GPIO Color in Pic
1 TCK 11 Red
2 GND 9 Brown
3 TDO 13 Orange
5 TMS 7 Yellow
9 TDI 15 Green

Cpld

Power

Plug your Raspberry Pi into the TIPI/32K board and power both the Pi and the TIPI on, using the Micro USB power inputs. Let your Pi boot, and become idle. Log into the Pi, either with a keyboard and monitor or by SSH-ing into the Pi’s IP address.

CPLD JEDEC file

Download the unique CPLD JEDEC file from here: tipi-32k_top.jed

wget http://www.lilyandgrace.com/ti/TIPI-32K/CPLD/tipi-32k_top.jed

You should have a file named tipi-32k_top.jed

Testing the JTAG Chain

Test that the JTAG chain recognizes the CPLD

sudo xc3sprog -c sysfsgpio_creator

You should see something like this: (you’ll need to enter the ‘tipi’ password)

[sudo] password for tipi: 
XC3SPROG (c) 2004-2011 xc3sprog project $Rev: 774 $ OS: Linux
Free software: If you contribute nothing, expect nothing!
Feedback on success/failure/enhancement requests:
	http://sourceforge.net/mail/?group_id=170565 
Check Sourceforge for updates:
	http://sourceforge.net/projects/xc3sprog/develop

JTAG loc.:   0  IDCODE: 0x59608093  Desc:                      XC95144XL Rev: E  IR length:  8

Program the CPLD

sudo xc3sprog -v -c sysfsgpio_creator -p 0 tipi-32k_top.jed:w

When it is complete you should see something like this (not exactly):

XC3SPROG (c) 2004-2011 xc3sprog project $Rev: 774 $ OS: Linux
Free software: If you contribute nothing, expect nothing!
Feedback on success/failure/enhancement requests:
	http://sourceforge.net/mail/?group_id=170565 
Check Sourceforge for updates:
	http://sourceforge.net/projects/xc3sprog/develop

Using built-in device list
Using built-in cable list
JTAG chainpos: 0 Device IDCODE = 0x59608093	Desc: XC95144XL
Device is blank
Programming Sector 107.                
Programming  time 14004.0 ms
Verify Sector 107
Success! Verify time 1293.9 ms

Cleanup

You should be able to test your TIPI now. Once you are satisfied, power down the TIPI and the Pi and remove the JTAG wires if you like (TIPI-32K will work fine with the wires left in place) and then put things back the way you had before this process.