Stage 2: Design the Hardware
Following on from our first article about selecting the right FPGA, we’re now getting into the nitty-gritty of design.
The chronological progression of an electronic design is an interesting one and also not a uniform one. The process in many industries on how to make something or how to do something is usually fairly well defined.
If you take building a road for example, then the usual process is to; plan the road, design the road, conduct the earthworks needed to build the road, and then pave the road. This process is fairly linear, in that you can’t pave the road before doing the earthworks and you can’t do the earthworks before doing the planning (unless you don’t mind getting it wrong!).
In electronics design now this is not the case, and especially with FPGA designs.
Just as an example, the development of the FPGA’s constraints may have to begin before the component is connected in the schematic. This may be because the pin function is limited to certain pins. Maybe the FPGA IO has to be configured in a certain way for the part to work which is required by the firmware. Either way, this is a problem which requires swapping back and forth between developing the schematic of a board/product and developing the firmware for it.
There is an interesting nuance to this situation however. This means that you can’t finish the schematic before doing some firmware, but you can start the schematic before the firmware. Based on that, this is where we start too.
The schematic capture of a design usually comes when all of the required information about what the PCB is meant to do is available. This is key to the success of a design because, otherwise, you don’t know what you’re designing.
Just a quick note for those of you who are completely unaware of the PCB design process, a schematic is a drawing used to define the interconnect between the components that make up the design. In order to draw the schematic that we need, we also need some software to do it. We use KiCad in house at Circuithinking which is an excellent free software package used at CERN. We highly recommend that you go and have a look or even have a try at the tools they provide.
Some loose requirements were established in the first article and now we can begin to design a board to meet those requirements. If you choose to use Circuithinking as your design service, then we can use our extensive systems in order to provide you with great quality requirements and documentation so that you can maintain your product for years to come. The first step is to architect our design so we know what components we are using.
Based on the fact that we know we’re going to use a Spartan-3A in our system, we can go ahead and make this the main centre piece of our architecture. We also mentioned that we are going to program the device in passive serial mode, meaning we need an intelligent device to do so: a microcontroller.
The device we’re going to use is the PIC32MX250F128D. This device is perfect for our purposes because we need the 128KB flash it provides in order to store our FPGA’s configuration image.
It also has a couple of SPI (serial Peripheral Interface) ports for us to program the FPGA with to make things easier. We also want a few LED’s in order to debug things along the way and a possible option to program over USB too…
Those are the two big main chunks of the design already sorted and now we just need to decide on some power. The design needs both 1.8V and 3.3V as mentioned in the previous article and they aren’t exceptionally high currents either.
The AP3407 is a switching regulator that is not only cheap but easy to implement and a small footprint, making it ideal for our circumstances. There is a case to be made for linear regulators here, but the complexity added isn’t significant enough to say no to the switchers.
Other than power and logic, all we really need now is connectors and that’s it!
A breadboard uses standard 2.54mm pin headers so using those to break out the FPGA is a must. The programming interface for the PIC microcontroller is also a must and this can use the same 2.54mm pin headers. We also determined from the last article that we want to use USB to power the board and so a USB micro connector is fitted too. And that’s it! Component selection and design architecture is completed.
Some other prerequisites for the schematic…
A schematic needs a few things to be prepared in order to be drawn to completion. The biggest of these is component symbols. Component symbols are drawings which represent the individual parts which make up the design. Some of the more traditional symbols for things like passive components and logic gates are shown below.
Traditional Circuit Symbols
Along side these traditional symbols we also need to make symbols for the more complex integrated circuits that are present on the board. We need to do this exercise for the Spartan-3A, the PIC32MX250F128D and the AP3407 IC’s. The other components on the board use standard symbols to be represented and so that completes the symbols we need to start the schematic!
The schematic is now ready to pull in all the constituent symbols in order to make up our design. The process usually means implementing designs made in simulations, datasheets and from the engineers own engineering intuition.