Skip to content
Jose Marcelino edited this page Jun 27, 2017 · 70 revisions

Building a Guzunty is very straightforward. These notes will ensure that you have success first time.

#Tools To build a Guzunty, you will need:

  • A soldering iron for electronics, 15 to 30 watts should be great. Don't try to use one which is designed for plumbing. If you have a temperature controlled one so much the better, but its not essential.
  • Solder, we recommend using 60/40 lead tin multi core solder. Its not ROHS, but you're only building one and you'll be reusing it a lot. Lead free solder has a higher melting point and can be much more difficult to work with, especially if you need to correct anything.
  • Tip cleaning sponge. A clean iron tip makes the job so much easier.
  • A multimeter. Not absolutely essential, but highly recommended for testing before you connect the Guzunty to your Raspberry Pi.
  • A solder sucker and or soldering braid for correcting mistakes. If you don't make any, you won't need 'em.
  • A pair of small side wire cutters.

#Assembly

  • Before you start, study this soldering guide. It's easy to read and has some great tips.
  • Familiarise yourself with the printed circuit board here.
  • Ensure you have all the parts you will need:

Assembly photographs courtesy Alex Eames at raspi.tv

Left to right:- Jumpers (x5), GPIO header, CPLD socket, CPLD device, 17x1 male header pins (x2), 47 kilo-ohm resistor (x3), 3x1 male header (x4), 5 x 1 male header, Guzunty PCB, 100 nano Farad ceramic capacitor (x3), 3.3 micro Farad tantalum capacitor (x2).

Kit purchasers, please note that the 100 nF capacitors supplied are different than the disc capacitors shown above. The kits use dipped ceramic that are similar in colour to the tantalums above. They are easily distinguished however as the 100 nF caps are much smaller.

  • Next, look at the PCB. One side of the board has a lot of square solder pads on it. This is the solder side of the board. The other side has printing all over it showing the location and orientation of each component. This is the component side. Hold the board so that the component side is towards you and the header pin position labeled 'P1' is at the top of the board. Unless stated otherwise, all references in this guide to the left, top etc. of the board will be with reference to this position.
  • Start with the three resistors. They are all the same value and can go in either way. Bend the leads so that the leads enter the board at a right angle. The resistors go at the right hand side of the board at the positions labeled R1, R2 and R3. As recommended in the soldering guide, insert the components and bend the legs out slightly on the solder side, before turning the board over and soldering the six places where the leads pass through. Check twice and solder once. Avoid putting solder on unoccupied pads, since doing this will block the through board holes that will be occupied by another component later. Once soldering is complete, trim the excess leads.
  • Next identify the three ceramic capacitors. They look like flat orange disks or small brown rectangles and on either kind you can usually find a '104' mark on them. Like the resistors, these capacitors can go in either way round. Use the same insertion and soldering procedure for these. They go into the positions marked C4, C5 and C6.
  • Next up, the tantalum capacitors. These are more brown than orange and look more lumpy than the flat ceramic capacitors. Unlike the ceramic capacitors, tantalum caps have polarity. Look for a '+' mark on the capacitor body and ensure that the lead next to this mark goes into the correct hole in the PCB (the PCB also bears a '+' mark). Once inserted, bend, turn over, solder and trim. These go into positions C2 and C3. For kit builders, we mark the '+' side of the tantalum caps with a black or red spot so it is easier to see (this spot also distinguishes them from the 100 nF caps).
  • Now let's add the CPLD socket. This will fit into the board four different ways. ONLY ONE WAY IS CORRECT. The socket has a chamfer (diagonal bit chopped off) at one corner. This goes to the top left as you look at the PCB. Sometimes the pins on the socket get bent out of position during shipping. For our kits, we inspect our sockets and insert them into foam to avoid this, but its worth checking for this if the socket is not keen to drop into the board. Check orientation twice, turn the board over and solder. Solder just one pin and check that the socket is sitting down nicely on the PCB. If not, reheat the pin while pushing down on the socket. Now solder the other 43 pins. Do not insert the CPLD device at this time.

Resistors and capacitors in place, note socket orientation.

  • Now lets add the 17 way single in line header pins. There are two of them which go into positions P1 and P2 along the top and bottom of the board. Do them one at a time and don't solder all 17 pins at once. Instead insert the strip of pins into the component side of the board and solder just one pin towards the centre of the header. Now turn the board over and check that the connector is sitting right down on the PCB and that the pins are at right angles to the board. If not use a finger at one end of the strip to adjust the header angle while you briefly reheat the single pin. Don't put your finger on the pin you are reheating, you will burn it. Once you're happy, solder the other pins. Repeat for the other header.

Input output headers added.

  • Insert the 2 x 13 Raspberry Pi socket into the solder side of the PCB (this is the only component that goes into the solder side). Again, solder just one pin on the component side. Turn the board over, check for alignment and seating and adjust as necessary. Then solder all the other pins.

GPIO header on underside.

  • Now we have just jumper pin arrays to go. Start with the 1 x 5 pins first. Use the same 'solder one pin, align, solder the rest' strategy. Repeat for the four 1 x 3 jumpers.
  • Congratulations! You're done soldering. That wasn't so hard, was it?

#Check your work

  • Examine all solder joints for signs that you might have created a bridge between pads that were not meant to be connected. If you find one, use some solder braid to wick away the excess solder. Be sure to check the soldering on both sides of the PCB.
  • Use a multimeter on connector P3 to check the resistance between 3.3v and 5v. It should be open circuit (i.e. infinite resistance). A digital multimeter will likely show a single '1' digit or say something like 'open' if its a fancy one. An analog multimeter needle should not even twitch.
  • Check between Ground and 5v. This should also be open circuit.
  • Check between Ground and 3.3v. This should not be open circuit, but should show a very large value, upwards of 5 MegaOhm. If you hold the measurement for a while, you may see the reading increase.
  • The 5v trace passes close to pins 3 and 4 of J1, so check those too (pins 3 and 4 are one pair up from the bottom of J1). There should be open circuit between both of them and the 5v pin.
  • If all the measurements look good, insert the CPLD into its socket. Like the socket, the CPLD has a chamfer at the top left corner and a dimple in the centre of the top edge. It won't go into the socket the wrong way. If it is resisting, check the orientation before using more force.

Note that this photograph and the one below show a Guzunty built to work with a ribbon cable. If you're building the standard compact Guzunty, yours will not have the male pins sticking out above the board at the left side.

  • Add the five jumpers. Four go on the upper two pins of jumpers 1 through 4. The last one goes on the lower two pins of P3. Never, ever place jumpers on the upper pins of P3. Doing this will short the power supply, probably damaging your Raspberry Pi in the process.

  • Repeat the resistance readings and if they still all look good, continue to the next step.
  • If any of the readings differ from the above, do not connect it to your Raspberry Pi. It might damage it. Instead, repeat your visual inspection of both sides of the PCB with even more care. There is a troubleshooting page here.

#Plug in and continue the checks

  • Plug the Guzunty onto the GPIO connector on your Raspberry Pi.
  • Switch on and watch for signs of activity on the RPi LEDs. The Power and SD card access lights should come on immediately followed by the other lights after a few seconds.
  • If the other lights do not come on within ten seconds, power down the Pi, remove the Guzunty and re-examine your soldering. Do not retry unless you find and correct a solder bridge. If you can't find anything, take a low resolution (800x600 or so) photo of both sides of the PCB and attach it to a github issue.

#Download the programming and test utilities First, set up your Pi.

You'll be using the following files and utilities:

  • gz_load
  • gz_test.xsvf
  • gz_test

Make the test program

  • cd to Pi/src/gz_test
  • make

#Program and test

  • The CPLD is blank, so you must first program it.
  • sudo gz_load gz_test.xsvf
  • Wait for the loader to complete (about 45 seconds). If you see a message like 'TDO mismatch and retries exceeded', you probably forgot to install the programming jumpers. Otherwise the loader should report 'SUCCESS'. If the loader reported a failure and the jumpers are correct, try disabling Device Tree support (sudo raspi-config > Advanced Options > Device Tree Support). Now reboot the Pi and try again.
  • Now run the tester which simply turns on the hardware clock on GPIO4.
  • sudo ./gz_test
  • Check the outputs on the header pins. The pins will alternate between 0v and 3.3v. If you are using a multimeter to do this, please look at the third to last bullet point below.
  • The pins oscillate in four groups of 8 (but see next bullet below), with the lowest bit having a frequency of about 9Hz and each successive bit oscillating half as quickly as its neighbour. The groups are: FB1_2 through FB2_5, FB2_6 through FB3_9 and FB3_11 through FB4_8. Group 4 comprises FB4_11 through FB4_17 plus GTS1, GTS2, GSR, GCK2. Finally, GCK3 is not part of a group. It oscillates at the slowest rate, cycling about every 12 seconds.
  • To maximise protection to your Pi, there is no output expected on some P2 pins (FB4_8 through FB4_17), nor on GTS1, GTS2, GSR or GCK1. These pins are oscillating at the CPLD itself, but they are not brought out to the header because they have Raspberry Pi GPIO pins connected to them. You can change this to bring more pins out to P2 by bridging some of the solder pads on the underside of the PCB. However, we recommend you wait until you have gained some experience using the Guzunty in its standard configuration before doing this.
  • If this is what you find, well done. The outputs are oscillating and your Guzunty is working as it should.
  • Continue to check that all header pins are oscillating using the multimeter. If you have an oscilloscope you can look at the waveforms to ensure that they are nice and clean.
  • If you are using an oscilloscope and wish to speed up the rate at which the pins change, you can change the call to gz_clock_ena() so that it passes a smaller divisor (the second parameter).
  • Conversely, a multimeter can't show a signal changing at 9Hz. It will instead show an averaged value, something around 1.6v. To see the signals changing, you may wish to slow the clock by passing a larger divisor to gz_clock_ena(). Be aware if you do this, that the top bit may take a minute or two to toggle. Oh and don't forget to run make again or your change won't make it into the executable.
  • Press any key to exit the test program.
  • You are now ready to try out some of the other cores on this site.

#Finding a core

  • When you performed the git clone during Pi setup, you transferred all the available cores into your Guzunty folder.
  • Look under 'src' and you will find a folder for each of the cores found on the cores page.
  • Under each folder is the source hardware definition files in case you wish to build the cores yourself, or use them as a starting point for your own design.
  • Also under the same folder, you will find an xsvf file bearing the same name as parent folder.
  • To load it, you use the same procedure as for the test core above, e.g.

sudo gz_load gz_8i8o.xsvf

  • That's it! You're ready to use your new hardware functionality. Don't forget to build and run the example code in the same folder. This code exercises the new hardware and provides a starting point for code to use the hardware in your own project.

#Finishing touch

  • We recommend you stick a thick self adhesive felt pad to the underside of the PCB directly underneath JP3.
  • This contacts the upper surface of the main power supply capacitor and provides mechanical support.
  • Kit builders can use a piece of the foam used to protect the CPLD socket during shipping.