element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs I2C with Fuel Tank BoosterPack - part 2: Capture Test Communication with a Papilio
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 17 Aug 2015 7:47 AM Date Created
  • Views 939 views
  • Likes 3 likes
  • Comments 5 comments
  • i2c
  • papilio_pro
  • papilio
  • bq27510
  • fuel_gauge
  • bus_pirate
  • fuel_tank_boosterpack
  • texas_instruments
  • logic_analyzer
  • fueltank_boosterpack
Related
Recommended

I2C with Fuel Tank BoosterPack - part 2: Capture Test Communication with a Papilio

Jan Cumps
Jan Cumps
17 Aug 2015

We know that it's tough to talk to the fuel gauge chip on the Fuel Tank BoosterPack. Its I2C interface is sensitive to right timings.

The Dangerous Prototypes Bus Pirate is famous for its sturdy communication prototyping capabilities. Before I test the Fuel Gauge IC in my own design, I want to test out the communication, and capture some question-reply sequences with a logic analyzer.

 

image

 

In this first post I tried out the I2C communication with a Bus Pirate.

This time I will capture some communications and store them for later use. I'm abusing the blog for my own documentation purposes image.


Capture Time



image


Capture 1: Simple Query with Constant Reply


First I'm going to capture a conversation that's predictable and repeatable.

Design Capacity is a value that's always returning the same reply. That's an ideal candidate to capture for later comparisons.


I2C>[0xaa 0x2e [0xab rr ]
I2C START BIT
WRITE: 0xAA ACK
WRITE: 0x2E ACK
I2C START BIT
WRITE: 0xAB ACK
READ: 0xB0
READ:  ACK 0x04
NACK
I2C STOP BIT
I2C>

 

image


Capture 2: More Complex Control Query

 

Number two is a conversation that requires a second start. We're firing a control question.

That's a two-step communication. First put the bq27510 in control state, then restart the communication with a control query.

We're asking the firmware version. That's again an example that's easy to verify later when we're replacing the Bus Pirate with a microcontroller.

 

I2C>[0xaa 0x00 0x02 0x00] [ 0xaa 0x00 [0xab rr ]
I2C START BIT
WRITE: 0xAA ACK
WRITE: 0x00 ACK
WRITE: 0x02 ACK
WRITE: 0x00 ACK
I2C STOP BIT
I2C START BIT
WRITE: 0xAA ACK
WRITE: 0x00 ACK
I2C START BIT
WRITE: 0xAB ACK
READ: 0x00
READ:  ACK 0x04
NACK
I2C STOP BIT
I2C>

 

 

image

 

Capture 3: Query with a Variable Reply


The last communication is one where the reply is dependent on the condition of the battery.
We ask the state of charge. We'll get the charge level back as a %.


I2C>[0xaa 0x20 [0xab rr ]
I2C START BIT
WRITE: 0xAA ACK
WRITE: 0x20 ACK
I2C START BIT
WRITE: 0xAB ACK
READ: 0x63
READ:  ACK 0x00
NACK
I2C STOP BIT
I2C>

 

image

image

image

 

The 3 OpenLogic projects and exports of the captured data are attached to this blog.

 

Related Posts
part 1: Communication Test with a Bus Pirate
part 2: Capture Test Communication with a Papilio
part 3: First Attempt with Hercules LaunchPad
Attachments:
i2c_captures.zip
  • Sign in to reply
  • Jan Cumps
    Jan Cumps over 9 years ago

    Running first (unsuccessful - but at least I get some I2C traffic image) test with a Herules LaunchPad:

     

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • kas.lewis
    kas.lewis over 9 years ago in reply to Jan Cumps

    Thanks, thats a pretty cool project. I would be intrested in getting into FPGAs one day but at the moment it just seems like a hurdle to hard to climb with my other things going on.

     

    Kas

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 9 years ago in reply to kas.lewis

    kas.lewis, it's a Papilio Pro FPGA dev board.

    I've posted a blog / video about its use as logic analyzer here on e14:

     

    Make a Logic Analyzer from your Dev Kit Part 2: Papilio FPGA

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 9 years ago

    Nice update Jan.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • kas.lewis
    kas.lewis over 9 years ago

    Hello,

     

    What logic analyzer are you using in this project ?

     

    Kas

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube