This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

bq2014H, HDQ Communication With PC Serial Port

Other Parts Discussed in Thread: BQ2014H, MAX3232

I have been trying to interface a bq2014H gas gauge with the RS232 port on a pc. I have the level converter working OK ( based on a MAX3232 chip) but I cannot quite workout how to send the appropriate bit stream to the gas gauge. Sending the address/command as bytes via a normal RS232 DLL doesn't work and I asume that is because the bit stream is not correctly formed for the hdq engine to recognise. Everything is OK when using the EV2200 interface but I don't want that in the final setup. Anyone already solved this or have any ideas what to do? The EV2200 uses a micro controller but I don't know if the code is freely available.

Any help really appreciated.

  • Hello MWH,

    The RS-232 port on the PC is a UART interface.  The baud rate and other setup can be controlled by the PC.  If you have developed an interface that converts the logic levels and ties the TX and RX together to interface to the single-wire HDQ interface, you can use the strategy described in the "HDQ Communication Basics" application note (SLUA408) that can be found in the bq2014H product folder on the TI web site.  This is not the technique used by the EV2200.  The EV2200 contains a micro that is programmed to "bit-bang" an HDQ interface on one of it's I/O pins and the micro is interfaced to the PC RS-232 port and has a defined set of commands that will instruct the micro for the various desired actions.

    Bill

  • Thanks for the reply, Bill. What you describe is what I have tried and it does not work for some reason. I am not using the EV2200 which has a 5 byte command sequence, I am simply sending (for a read) a one byte address and then looking for the one byte response from the gas gauge. My level shifter does seem to work OK as the pc sees the one byte address returned immediately after the send but there is no following response from the gauge. i have tried all available baud rates, number of stop bits etc and I have things set up so that I can send a SetBreak/ClearBreak. I see this happening when monitored with a 'scope but that's it unfortunately. If I return to the EV2200 setup, the gauge can be seen to work normally. I am assuming that the serial protocols are getting in the way which is why I wondered if anyone had a way around them without resorting to more hardware (i.e. some form of pic of my own). If more hardware is the answer, then do you know if the pic code for the EV2200 is available for 'open' use and if so where I could obtain it?

    Thanks and regards

    Mark.

  • Hello Mark,

    You need to read the application note more carefully.  The only way to use the UART is to set up the baud rate, parity, etc., as described in the application note and then use each UART communication to form the required timing for each bit of the communication.  In other words, to read a single byte from the gauge, you will need to send 8 bytes of data to the UART (1 for each of the 8 bits in the address), and then the UART should receive the response from the gauge.  You will have 16 data bytes in the UART buffer.  The first 8 are the same data you sent.  The next 8 can be used to construct the single byte of data received from the gauge.  You may also need to send a "BREAK" prior to starting the sequence to reset the HDQ communication engine.  An examination of the scope waveform while attempting the communication should clarify any issues you may be having.  If you want to get the command sequence for the EV2200, you will need to contact your TI representative and have them contact the factory applications group for the gas gauges.

    Bill

  • Hello Bill,

    Well I'll be.......! The byte/bit part passed me by completely! Just looked at the app note again and I can't think how I missed it but miss it I did! So, first thing tomorrow I shall try this out. Really appreciate you taking the time, and I'll let you know how I get on.

    Thanks and regards

    Mark.

  • All works perfectly now. Thanks for your help.

    Regards

    Mark.