Regular Visitor
Posts: 8
Registered: ‎02-24-2013

How to measure the remaining battery using FPGA

Hi, Is there any demo code of monitoring the remaining capacity of the battery on board ? and as I want to incorporate 8 channels low sampling rate ADC (FS=1KHz), I google around and found that FMC interface might be a better choice, is there any suggestions ? Thanks! Liu Benyuan
Avnet Employee (Star Contributor)
Posts: 113
Registered: ‎06-09-2009

Re: How to measure the remaining battery using FPGA

[ Edited ]

Hi liubenyuan,


I am not for certain, but this post appears to contain two different and unrelated questions.  When posting in the future, please try to seperate those questions into different posts.  This makes it easier for other forum users to search through the different topics.


We do not have any demo code that monitors the remaining capacity of the battery on board.  The Spartan-6 LX16 Evaluation Board does have a TI BQ27500 Fuel Gauge IC connected to the Li-Ion battery so it is possible to develop code to perform this function.  By default, the I2C management interface for the Fuel Gauge IC is connected to the PSoC3 since it is capable of running in a much lower power states than the FPGA.  However, there are two un-populated resistors at R46 and R47 that you could bridge with a solder connection to give the FPGA access to the Fuel Gauge IC.  If you went this route, you could use the MicroBlaze and an I2C master to communicate with the BQ27500.


If you look through the datasheet for this device you will find that accurately measuring the remaining battery capacity is not a trivial task.  It would involve profiling the characteristics of the Li-Ion cell and programming these parameters into the fuel gauge non-volatile memory.  This is not something that was completed since a portable Spartan-6 LX16 design probably use a different battery cell in the end user application.  For that matter, can you tell us more about your end application?  Are you designing a battery and charger IC into your product?  How accurate do you need the gauge to be?


As for the 8 channels of low sampling rate ADC, you could use a low cost Pmod device to achieve your performance.  For the Spartan-6 LX-9 MicroBoard, we have a reference design which shows how to connect a two channel ADC Pmod up to MicroBlaze.


There's also Spartan-6 LX9 MicroBoard reference design material for the Maxim Analog Essentials Collection:


This collection includes a Pmod with the MAX11205 which is a single channel 16-bit ADC device.  You can get the Analog Essentials Pmod collection which contains 15 different modules directly from Maxim currently for 89.95USD.  I actually found this kit listed on Avnet Express for a slightly lower price:


I would recommend going down the experiment route with the Pmods becuase it gives you a low cost path to add ADC functionality to your LX16 board.  Once you find a solution that works well for you, then you could scale that hardware up to the full 8 channels that you require.