asic/fpga code to a programmable bench supply..

Discussion in 'The Projects Forum' started by toffee_pie, Dec 24, 2009.

  1. toffee_pie

    Thread Starter Senior Member

    Oct 31, 2009
    hi guys

    I am trying to implement a routine, basic code on a fpga with verilog.

    this will simply perform some calculations, adc operands etc to alter the supply voltage.

    I am doing this to simply have control over the power usage of the fpga.

    also I would like to have an additional bus for monitoring the power usage, and for example to shut down the system or reduce voltages to a trickle if there is no operations being performed for say... 20 mins etc.

    I can write this code in verilog (i hope..!) without much difficulty, if will have a lot of always blocks and synchronous logic and plenty of tenrary/case statements also I would image.

    I am trying to figure how or what is the best way to use this idea with a bench supply, are programmable supply's easy to get? would these be gpib?

    I have done code on labview already, perhaps I could use a labview routine to monitor these?

    hooking up a dmm such as a hameg via a rs232 is not going to be too difficult to actually see power levels changing, but its the commands I am worrying about from the fpga --------> bench supply and vice versa.

    I am sorry if this is long winded, but would like to see what is the best way to approach this I guess.

    happy holidays.!
  2. toffee_pie

    Thread Starter Senior Member

    Oct 31, 2009
    anyone with ideas on this?
  3. SgtWookie


    Jul 17, 2007
    Many supplies have proprietary internal protocols.

    If you want to control a supply by GPIB, be prepared to pay extra for a supply with a GPIB port.

    One way around this is to build a complete supply yourself. That way you can control everything, and decide on what communications protocol(s) to implement in your design.

    You'll learn a lot about switching supplies that way.

    But right now, we really don't have an idea of what kind of a supply you're looking to find or build.

    It's easy to go overboard with requirements. Try starting out fairly small and low power. Keeping it simple will make the design, construction and troubleshooting processes relatively easy.
  4. toffee_pie

    Thread Starter Senior Member

    Oct 31, 2009
    Hi Sgt,

    I will need to have a supply that can read commands from my fpga.

    I am going to use most likely Xilinx ISE, but have no idea what family of cpld to use.. coolrunner, ? virtex 4/5. ? , spartan ?

    I'm not sure if it will make much of a difference as my work will not be too complex.

    I just need to have some 'smart' power management at use.

    also I would be interested in hooking up a radio/cd player etc to see the voltages adjusted accordingly, to say 6v etc.

    and then drop back to nominal levels.

    all this will be done from the hdl code.

    a problem could be the (low) input voltage of the cpld.. {spartan 3 seems to be min/max -0.5/3.5v(Vin) or -0.5/1.32(Vcc Int)}

    whats the best method to have control over a bench supply (signal wise) ? also I would need an dac/adc to convert power from the cpld -> bench supply

    and bench supply -> cpld.
  5. kubeek


    Sep 20, 2005
    Is that some kind of school project? First I think you should have someone to guide you through that, and also the one who assigned that to you should be able to help you.

    Anyway, right now this all looks pretty vague. You are supposed to control some PSU through VHDL programming, but you don´t seem to have any idea how is the PSU controlled. Is the design of the PSU a part of your work, or is it ready and you just control it?

    Please post as many details as you can about everything, otherwise this will be a LOONG conversation.

    And also your picture says FPGA or microcontroller, I think that microcontrollers like Atmel AVR, which have integrated A/D converters, are a lot more suitable for this than a purely digital FPGA chip.
  6. toffee_pie

    Thread Starter Senior Member

    Oct 31, 2009

    thanks for the help, I appreciated it.

    The idea I am with here is vague I agree absolutely.

    My project is to investigate power management protocols for integrated systems; these would be at a system level (embedded- low power...).

    The goal is to eventually incorporate a block on an ASIC that does its own power management, rather than have it external, for space saving and so on.

    Before I can get to this, I was told to show power protocol in operation, I was toying with the idea of getting a development kit (pmbus), but was of the opinion this would not lead to much actual work being done.

    Eventually it was decided to control some voltages with say a hdl code communicating with a configurable power supply.

    I could have math operations performing, and adjust voltages accordingly to run say a device such as an mp3 player etc and have a bus monitoring voltages all the time.

    An hdl code could do this I believe, and I could shut the system down if there was no activity within a set time.

    I am talking hdl here as I have studied verilog, I understand it would be easier to implement on an atmel.

    however my c skills are not up to scratch for this :(

    what’s the consensus on this, as what I have said here is pretty much exactly as my supervisor said.

    It’s a pretty open ended project so it’s up for negotiation, but the overall topic is power management.
  7. kubeek


    Sep 20, 2005
    Ok, so power management shall it be.
    I see two main parts in that:
    1) Voltage regulation + V and I monitoring
    2) Turning parts of (ASIC) circuit on and off based on the needs to use it

    For the first part, voltage regulation is usually simply left for a linear or switching regulator which regulates the voltage without being controlled by the chip. Off course a different case are more advanced chips like a CPU, which vary the supply voltage based on the usage of the processor. Monitoring is done by A/D converters.

    The second is more interesting, because as far as my knowledge of VHDL goes, I didn´t see there tools to describe switching power for parts of the chip. My idea is that FPGA and CPLD do power management based on the chip´s decision and are not user-controllable.
    Another thing are the "real" ASICs, which you design and get them etched on the wafers. Then you need to think about the methodology of what circuits need to be on, and how soon before their actual use they have to be switched on. You also need to consider the power consumption of the management circuitry itself.
  8. toffee_pie

    Thread Starter Senior Member

    Oct 31, 2009
    using rs232, I could comm with a supply like one of these ...

    using commands like these

    "u=X set the voltage (e.g u=105 set voltage to 10.5V)
    i=Xmax set the max current (e.g i=500 sets the current limit to 500mA)
    s=1 or s=0 set to standby
    u=? or i=? or s=? print the current settings. This will produce a printout that looks e.g like this:
    u: 50 s:0 i: 100 l:0
    u: means voltage=50 =5V, s:0 means standby off, i: 100 is 100mA, and l:0 means current limit is not reached."

    I could implement some more sophisticated management with verilog?


    case (control)

    001: x = sel? a:b
    010: x = sel? a:b
    011: x= sel? a:b
    100: x = sel? a:b

    i would need about 5 control lines between the psu > cpld


    001 etc could be defined voltage levels

    a and b could be signals, x could be an output
  9. kubeek


    Sep 20, 2005
    You were talking about low power embedded devices, those should not use huge bench power supplies.
    You need to decide what is this all about. If it is about controlling the voltage of the PSU, I don´t really see any benefit in that, because most devices won´t really like the sudden changes of voltage when you set a new value.

    What kind of device needs to set the voltage and current limit all the time throughout the working cycle? Almost any device (again except for CPUs) is made to work with one voltage or a certain range, and has no difference in performance while it is in the range. And changing the current protection? What is that good for, when low power devices consume the same current almost all the time?

    And lastly, I think a microcontroller is well more suitable for this task, as it has the serial port built-in, and A/D and PWM controllers too. Why hassle with VHDL which is like designing it all at gates level, when you can very easily program the control routines.
  10. toffee_pie

    Thread Starter Senior Member

    Oct 31, 2009
    I understand your point alright.

    I am supposed to implement some power management protocols, or more to the point have them up and running to demonstrate.

    smart power management, like switching off devices when they are not needed and so on.

    I will get back to my tutor about the fpga bit, using an mcu does seem to make sense.

    perhaps a better scheme would be something like a mcu communicating with a i2c device [ie AD7414], and I can add a load onto that and control it with the mcu directly? and use a programmable psu to drive the load

    im sure it would be possible to hook labview up to this as well for monitoring?

    [i2c controller] -----------------> [mcu]
  11. toffee_pie

    Thread Starter Senior Member

    Oct 31, 2009
    Hi Guys

    In the attached diagram

    would this configuration allow me to control a load device, adc/dac with a programmable psu via the pmbus controller (and an mpu)?

    is the 'load' in the picture a mpu?

    I think this approach makes a bit more sense as I dont think my supervisor was really on the ball with his idea and im really stressed with this...

    * I have edited my pic to include a second diagram with a MAX8688 power monitor controller,

    would my diagram be feasible,? I could replace the POL with a programmable psu, and use it to control a load?

    an atmel mpu could be used for interfacing with the maxim
    • diag.JPG
      File size:
      169.3 KB
    Last edited: Jan 4, 2010
  12. toffee_pie

    Thread Starter Senior Member

    Oct 31, 2009
    Hello Again,

    Actually, I have spoke with my tutor and it was decided to scrap my last ideas and proceed with the initial development.

    that is connect a (minimally programmable) supply to a FPGA and let them talk to each other. (ie tell the psu what power it needs on an interval by interval basis).

    this power would also power up the FPGA, the next step is to perform some (large) math calculations on the FPGA (this could be implemented on an ALU- well, thats what they are used for eh..)

    and now, ramp up the voltage to the FPGA as these are being calculated, once they are done we can ramp down to a trickle voltage.

    all the time it would be good to have a bus to continually monitor voltage, and to put the FPGA into active sleep/stanby if its not being used for xxxx amount of time.

    well, im sorry for getting this mixed up but this is what I would like to actually do.

    is going to be easy to get a FPGA to communicate with a programmable supply, ? also its possible to have the supply power the FPGA as well as sending and receiving these commands?

    sorry for all the questions.