Skip to content
Matt Andrew edited this page Jun 23, 2021 · 1 revision

hardware

The barebones althea assembly consists of: fpga, rpi connector, regulators, osc, flash, caps, leds.

There are a few additional components that might be used depending on need. These include:

50 Ohm 0805 resistors in case one of the coax connectors needs to be a terminated input.

The big 1206 caps are for extra supply decoupling but are not strictly necessary (again, depending on use).

Molex connectors (right angle/vertical 3 pin mini-fit jr) or 16 AWG soldered wires can be used to power the board and the rpi, or rpi can provide power to this board. There is no 5V regulator to this board (for space reasons), so be careful powering it from the molex/bare wires option, since it is wired directly to the rpi's 5V net.

4 coax connectors on the North edge of board can be LEMO-00 or SMA.

If you want to see signals come out of the LEMO/SMA connectors, be sure to install a 0 Ohm resistor (or 100pF cap as you see fit) for the "X[]" component corresponding to the output lemo/sma you've installed.

MMCX connectors are for COAX[4] and COAX[5]. They have no corresponding X[] component, so are DC-coupled.

24 pin male+female connectors are for the toupee (expansion) board.

JTAG connector is just in case there's some problem programming directly from the rpi pins (via openocd). Or it can be used with a cable to turn this into a jtag programmer to program some other target device.

rotary switch for indicating a choice to the FPGA.

JST/SH connector is for qwiic/stemma use (i2c boards).

Schematic is posted here.

Hookup diagram is posted here

development environment

The following assumes that you have raspbian/raspios installed on the rpi.

There's a script to download, configure and install openocd here (grabs a fork of the official repo which includes a patch for the flash on althea):

wget https://github.com/mzandrew/bin/blob/master/setup/as_you_like_it.openocd.sh

In my experience, the packages for openocd in most distributions' package managers are too out-of-date to work.

There are openocd scripts in the repo for each project alongside the .xise file for each project:

openocd scripts and xise files

After a checkout of the repo:

git clone https://github.com/mzandrew/hdl.git

I issue from the ise-projects subdir:

openocd -f mza-test047.simple-parallel-interface-and-pollable-memory.althea.revBL.bcm2835.openocd-cfg

to program the fpga and I issue:

openocd -f mza-test047.simple-parallel-interface-and-pollable-memory.althea.revBL.bcm2835.spiflash.openocd-cfg

to program the flash.

To build the fastgpio python module, you will need to issue:

sudo apt install -y python3-spidev python3-distutils python3-dev

Once you program the FPGA with the bit/bin, from the python subdir, you need to issue "make" to actually build the fastgpio module. No need to install it.

If you then run the program:

mza-test046_simple_parallel_interface_and_pollable_memory_althea.py

it will read in a csv file (bcm.csv), convert that to a python list, then normalize it and write it into the sequencer bram in the fpga. You either have to be part of the "gpio" group or run the above via sudo. After the bram is filled in this way, 3 of the 4 coax outputs [1], [2], [3] on the North edge of the board will all output the same "bunch current monitor" pattern repeatedly. The other coax output [0] will output a sync signal that's just a single pulse at the approximate start of the pattern.

Note that ISE needs to be configured (for each new project) to output both bit and bin files to be able to program the fpga directly (bit) or spi flash (bin). Compiles take at most 5 minutes in my experience. lx9 is a webpack part, so AFAIK you don't need to pay for the xilinx license to do compiles.

Clone this wiki locally