Monitoring and managing power supplies on an FPGA board

When developing custom boards with FPGAs, the power supplies are always a huge challenge. The board is almost always designed before the firmware ( VHDL / Verilog etc.) has been developed. This firmware might be developed by the customer, or Dotstar engineers, but it is easiest to develop it using the hardware that has been designed for the task.

One of the main reasons to use an FPGA is that their I/O banks can be programmed to use different signalling standards, so can be used to connect devices and interfaces that are not directly compatible. These I/O banks use power supplies whose voltage is used to drive the correct signal levels for that interface standard. This can result in the need for several different supplies to feed the different I/O banks. In addition to this the FPGA core will run at a supply voltage that is probably lower than most of the I/Os, but will almost certainly require a much higher current than the others.

Monitoring power supply with microcontroller

A major difficulty with the design of such a board is that the current requirements for each of these supplies is almost impossible to predict. FPGA device manufacturers offer various tools to try and predict the needs, but to be anywhere close, they need to know your design details, and even if you have that, they need to know the toggle rate of the signals. Even with our extensive experience we have never been able to predict these things.

In addition to the FPGA, most custom designs also have memories, ADCs or DACs , processors or other devices. These will also have requirements for power supply voltages, but the current requirements are simpler to predict because the data sheets will give you maximum figures. Some of these components specify that different power supplies must be applied in certain sequences, e.g. the core voltage must be stable before the I/O voltage is applied.

While we couldn't think of a solution to be certain that we were designing supplies with enough current capability (other than hugely over-engineering and wasting board space and costs), we wanted to be able to control, measure and monitor the power supplies on the boards that we designed.

We investigated various Analogue to Digital converters ( ADC ) that could be use to measure the voltage of the power supply rail. We often have an external bus connection to the boards that we design – USB, PCI Express etc. So we could allow these interfaces to interrogate the ADCs and pass the information back to a monitoring program. Some of our designs don't have one of these host buses, but we could add a specific connection to the board to use for this monitoring.

The monitoring of the supply currents of the various supplies is somewhat more complex.

The first idea that came to mind was to have a series resistor in the power supply. As the current is fed through this resistor, the voltage across it will be directly proportional to the supply current. But to measure that you need to have a differential measurement across the resistor. For best accuracy of measurement the difference needs to be sizeable, but the voltage across the resistor is a voltage drop in the supply as seen by the load. This volt drop is a problem for the circuitry so it needs to be minimised. Large currents also mean that even with low value resistors, the necessary power rating becomes large.

The series resistor idea begins to look a difficult choice. From our detailed study of Switch Mode Power Supply design we understand the control loop of the LTC3835 controller that we have selected as our preferred device. The error amplifier of the control loop puts out a voltage between 0.4v and 2.0v depending on the load presented to the PSU. This voltage is proportional to the load current of the power supply. This node of the error amplifier is filtered as part of the compensation network of the control loop, so is sensitive to the capacitive and sometimes varying impedance load that can be presented by an ADC input. The solution is to use an op-amp configured for unity gain. The AD8515AKSZ-R2 from Analog Devices will operate from 1.8v to 5.5v, the output can swing to the power rails, no output phase reversal beyond input rails and comes in a small 5 pin package. The input capacitance is a mere 4.5pF, and that is a fixed capacitance that could be calculated into the PSU design if need be.

For monitoring the current into the Switch Mode circuits, we are less concerned about a small volt drop caused by a series Resistor and we don't have a convenient point to monitor the current. So we selected an LTC4151 which has a differential ADC to monitor the voltage across a 0.02R series resistor and monitors the voltage too. This device is connected via an I2C serial connection. Normally there is only one of these circuits, so the extra space taken up is less critial.

So at this stage we have a need for several ADCs to monitor voltages, more ADCs to monitor the voltages that represent our supply currents, and also a way to connect to an I2C connection from the input supply monitor.

At this stage one of our engineers had a flash of inspiration – Microchip Technology make a range of microcontrollers, known as PIC, some of them have multiple channels of ADC built into them. We selected the PIC16F690 which is a perfect microcontroller for this application.

These power supply monitoring functions are features that we are adding because they are “nice to have”, so we do not want to use a large board area, or incur large costs. The features of the PIC microcontroller really help us with this :-

  • It has a built in oscillator to generate its own clock signal with no external components required.
  • It has on chip memory, to run the microcontroller code in.
  • It has on chip Flash memory which can be programmed with its program when the board is built, and can be upgraded later if necessary.
  • The Flash memory can be used to log events into.
  • It has a built in ADC with up to 12 analogue inputs for us to use.
  • It has up to 8 digital I/Os for us to use.
  • It has a dedicated I2C controller.
  • It is all in a small footprint 20 pin surface mount chip.

Once we had decided to use this device, it gave us more ideas. We decided to use the I2C controller to connect back to our host connection (USB / PCI Express etc. or a dedicated cable). Then we can connect the 12C from the LTC4151 to some digital I/Os.

Connecting the monitoring to the Analogue channels, we can do more than read an instantaneous value, but by writing our program so that it continuously loops around reading the values, it can constantly check each input against some limits , logging peaks and errors into the FLASH memory for reading out at a later stage.

We normally have an LED driven from each power supply voltage to indicate that the supply is operational. Having the PIC microcontroller allows us to take our LEDs to another level of usefulness. The PIC is already monitoring the actual voltage level of each power supply, so we can use a Digital I/O to switch on an LED for each supply – but only when the voltage is within the correct limits. We can also draw attention to a power supply that is out of limits by flashing the LED – at one rate for over-voltage and another flash rate for under voltage.

A further feature that the PIC can enable us to do is Power supply sequencing. The analogue inputs can already determine the voltage levels, so the digital I/Os could be used to hold off and enable other supplies in sequence.

The use of a PIC microcontroller in this application is an example of the innovative problem solving that Dotstar can bring to your project. Using our design tools to design your circuit and to lay out and route your Printed Circuit Board, we can assemble your boards using our production equipment.

In addition to the hardware we can develop your firmware – like the code for the PIC microcontroller in this example or for your FPGA, and also your system software for your host computer, or embedded processors.

Please contact us to discuss your needs.

Contact Details