logo elektroda
logo elektroda
X
logo elektroda

Can AI read datasheets? Will ChatPDF help an electronics engineer?

p.kaczmarek2  11 3279 Cool? (+7)
📢 Listen (AI):

TL;DR

  • ChatPDF was tested on the MCP23017/MCP23S17 datasheet to see whether AI can help electronics engineers read catalog notes.
  • It answered I2C addressing correctly, listing the eight 7-bit addresses from 0b0100000 to 0b0100111 and adding the R/W bit for writes.
  • It also suggested Arduino UNO wiring, mentioning SDA/SCL on A4/A5, A0-A2 address pins, pull-up resistors, and decoupling capacitors; it handled Arduino Mega too.
  • The model produced plausible code for MCP23017 register writes, but the PIC/mikroC translation looked unreliable, showing that it can hallucinate outside familiar platforms.
Generated by the language model.
Screenshot showing MCP23017/MCP23S17 datasheet and chat window with a question about I2C addresses.
Everyone has probably heard of ChatGPT, but have you heard of ChatPDF? ChatPDF is a tool that allows you to have a "chat" with a PDF file. In this topic, I will try to use them to search for information in the catalog note of a certain port expander, we will see what the result will be. Could an era be coming when electronics engineers will no longer read catalog notes because AI will do it for them? Let`s find out!

Experiment - catalog note MCP23017
So we upload the PDF and talk - we`ll see what this AI can do. The first port expander with an I2C interface, MCP23017, was launched.
After loading the document, AI immediately describes what the document is:
Chat wrote:

Hello and welcome to the MCP23017/MCP23S17 PDF file! This document provides detailed information about the features and specifications of these 16-bit remote bidirectional I/O ports. With high-speed I/O interfaces, configurable interrupt output pins, and low standby current, these devices offer versatile and efficient solutions for your project needs.

Example questions:

What are the different package types available for the MCP23017/MCP23S17 devices?
How can the interrupt output pins be configured on these I/O ports?
What is the operating voltage range for the MCP23017/MCP23S17 devices in different temperature conditions?

Time for the first question. Maybe we can ask about the address section:
Documentation page of MCP23017/MCP23S17 showing I2C and SPI device addressing
Can AI "understand" how these addresses are created?
p.kaczmarek2 wrote:

Which I2C addresses can have this chip?

Chat wrote:

The MCP23017/MCP23S17 devices support 7-bit slave addressing for I2C communication. The slave address consists of four fixed bits and three user-defined hardware address bits (pins A2, A1, and A0). Therefore, with these three address pins, you can configure up to eight different I2C addresses for the chip.

By setting the states of pins A2, A1, and A0, you can select one of the following I2C addresses for the MCP23017/MCP23S17 devices:

0b0100000 (A2=0, A1=0, A0=0)
0b0100001 (A2=0, A1=0, A0=1)
0b0100010 (A2=0, A1=1, A0=0)
0b0100011 (A2=0, A1=1, A0=1)
0b0100100 (A2=1, A1=0, A0=0)
0b0100101 (A2=1, A1=0, A0=1)
0b0100110 (A2=1, A1=1, A0=0)
0b0100111 (A2=1, A1=1, A0=1)
These addresses allow you to communicate with multiple MCP23017/MCP23S17 devices on the same I2C bus by assigning unique addresses to each device .

The response also included a link to page 15:
Screenshot showing 7-bit addressing for MCP23017/MCP23S17 devices.
For readability, I added spaces myself:

0b010 0000 (A2=0, A1=0, A0=0)
0b010 0001 (A2=0, A1=0, A0=1)
0b010 0010 (A2=0, A1=1, A0=0)
0b010 0011 (A2=0, A1=1, A0=1)
0b010 0100 (A2=1, A1=0, A0=0)
0b010 0101 (A2=1, A1=0, A0=1)
0b010 0110 (A2=1, A1=1, A0=0)
0b010 0111 (A2=1, A1=1, A0=1)

The answer is pretty good. The AI provided 7-bit addresses correctly, I wonder if it also remembers the Read/Write bit?
p.kaczmarek2 wrote:

Assume that I want to write data to this chip via I2C with A2, A1 and A0 high. Which byte would I need to send first?

I expect a reply with a list of bits, and what will I receive?
Chat wrote:

If you want to write data to the MCP23017/MCP23S17 chip via I2C with A2, A1, and A0 set to high, you would need to send the control byte first. The control byte consists of the 7-bit slave address (including the R/W bit) followed by the register address you want to write to.

For the MCP23017/MCP23S17 devices with A2, A1, and A0 set to high, the slave address in binary form would be 0b0100111 (A2=1, A1=1, A0=1). Since this is a write operation, the R/W bit would be 0.

Therefore, the control byte you would need to send first for writing data to the MCP23017/MCP23S17 chip with A2, A1, and A0 high would be:

Slave Address: 0b01001110 (R/W = 0)
After sending this control byte, you can proceed with sending the data bytes to write to the desired registers on the MCP23017/MCP23S17 chip

Pretty good! Let`s separate:

0b010 0111 (A2=1, A1=1, A0=1).

Here the AI correctly added the R/W bit, in this case zero:

Slave Address: 0b0100 1110 (R/W = 0)

Now let`s ask about connections. Let`s see if AI knows about pull-up resistors, for example:
p.kaczmarek2 wrote:

Ok, can you specify how can I connect MCP23017 via I2C to Arduino UNO? Which signals do I need to connect, do I need to connect anything else?

Answer (in the form of an image due to formatting):
Instructions for connecting MCP23017 to Arduino Uno via I2C
So the AI remembered about:
- power supply and ground
- SDA and SCL (correctly specified Arduino pins A4 and A5)
Table showing Arduino form factors and their I2C pins.
- about address pins A0, A1, A2
- and even about pull-up resistors
- additionally repeated about the power supply
Maybe let`s ask about the power supply:
p.kaczmarek2 wrote:

How to power this circuit, do I need any extra components?

Answer:
Instructions for connecting MCP23017 to Arduino Uno via I2C.
The AI remembers that we are talking about Arduino and implicitly assumed that it was Arduino UNO, which is a rather correct assumption. AI also remembers about decoupling capacitors.
I wonder what the AI will do if I change my mind.
p.kaczmarek2 wrote:

I changed my mind. I want to use Arduino Mega instead. How can I connect MCP23017 to Arduino Mega?

I expect a response along these lines:
I2C pins table for various Arduino board form factors.
And this is what I got:
MCP23017 connection diagram with Arduino Mega
This proves that this language model simply knows the pinouts of Arduino Mega .

p.kaczmarek2 wrote:

Ok, on Arduino Mega, can you show a sample code that will set MCP23017 GPA1 to high state and all other port A pins to low state?

Answer:
Arduino C code snippet for controlling the MCP23017 chip.
Excerpt of code description for MCP23017 using I2C on Arduino Mega
Code as text:
Code: C / C++
Log in, to see the code

I don`t have the hardware configuration to run it, but what do we have here... it hasn`t entered anything into IOCON AI, but it sets the registers responsible for PORT A. It doesn`t set the pull up resistors (third register), but the addresses match, I`m also looking at MCP support libraries from Github:
Code extract showing source code defining MCP23017 register addresses.
Looks ok...

Let`s check if the AI knows how to set the pull up resistor:
A C++ code snippet showing MCP23017 register configuration with pull-up activation.
Looks ok.

Maybe it`s something more difficult - let`s try to transfer the code to the mikroC platform for PIC. Here is the documentation for the I2C library there:
https://download.mikroe.com/documents/compilers/mikroc/pic/help/i2c_library.htm
Let`s see what the AI generated:
Screenshot of code snippet in mikroC for controlling MCP23017.
Well, here`s the problem. I don`t think it`s possible to do it all in one I2C transaction. Even if subsequent bytes were to be placed in subsequent registers in memory (via pointer auto-increment), this would work, but here we want to write to separate registers. Anyway, even this mode would have to be turned on:
Section of documentation discussing Byte and Sequential modes and I2C write operation for MCP23017.
Diagram of byte and sequential write operations to MCP23017.
Well, I`m not convinced by this code. I`m afraid it won`t work like that, what do you think?

Summary
Basically, I have two conclusions:
- this language model is actually able to find information in PDF
- this language model also has quite a large set of knowledge beyond the given PDF, it knows, for example, which Arduino pins are I2C, etc., it knows more or less the Arduino libraries
However, the model is not perfect and, as is usually the case, it "hallucinates" or "makes things up", in the case of less known languages or problems, it may create answers that look correct but do not actually work.
Nevertheless, I wonder what it will look like in a year or 10 years, I invite you to comment. Do you see potential in such an "AI helper" for reading catalog notes?

About Author
p.kaczmarek2
p.kaczmarek2 wrote 14612 posts with rating 12630 , helped 655 times. Been with us since 2014 year.

Comments

czareqpl 01 Mar 2024 13:54

You did not write exactly how you sent the PDF file for contextual analysis. [Read more]

p.kaczmarek2 01 Mar 2024 14:03

You go to the ChatPDF.com website, you don`t even have to log in, you just transfer the PDF file to the following field: https://obrazki.elektroda.pl/2345657200_1709297924_thumb.jpg The free version,... [Read more]

speedy9 01 Mar 2024 16:26

I would like to point out that PDFs can also be read by Microsoft Copilot in the EDGE browser. Even though the PDF is in English, you can ask questions in Polish and the answers will also be in Polish.... [Read more]

silvvester 01 Mar 2024 17:46

No, I can`t see. Perhaps one day AI will be useful to support processes, e.g. routing. Perhaps if the base of semiconductors expands to 99% of those available on the market, AI will be useful for searching... [Read more]

gulson 01 Mar 2024 19:42

This is probably where it will go, but some water will pass. For now, generating kittens, memes and videos is more important. This is the economy. [Read more]

pixel7 02 Mar 2024 08:34

The students won`t read the books either, uncle GPT will tell everything. And with this knowledge he sets out in life. [Read more]

andrzejlisek 03 Mar 2024 14:52

You could say that this will be lossy compression of the literary text. Relevant information will be preserved, but the original text and non-essential information will be irretrievably lost. Exactly the... [Read more]

pixel7 05 Mar 2024 06:53

Will you decide about this essence yourself, together with me, or will we leave the interpretation to others? Who will be the Grand Censor and Overseer of AI Learning? Will we choose him in the elections... [Read more]

andrzejlisek 05 Mar 2024 12:20

The problem is that no one has any influence on this, and it is not possible to objectively state what the right decision is, even probably not the ChatGPT programmers themselves, because it may depend... [Read more]

czareqpl 05 Mar 2024 13:05

So, basically, like an intelligent person who is not a cow with unchanging views. [Read more]

pixel7 05 Mar 2024 16:22

I`m asking about the "helper". He will have almost unlimited competences. [Read more]

FAQ

TL;DR: For engineers checking a 16-bit MCP23017 datasheet, ChatPDF handled several basics correctly, but the author warned it "hallucinates" on less common code. This FAQ helps electronics engineers use AI to extract I2C facts quickly while still verifying register maps, transactions, and platform-specific examples by hand. [#20985277]

Why it matters: AI can speed up datasheet reading for common parts, but one wrong register write or invented library call can break a real hardware design.

Tool What the thread tested Strong result Reported failure mode
ChatPDF MCP23017 datasheet Q&A and code prompts Correct 7-bit I2C addresses and plausible Arduino wiring/code Wrong or doubtful code on less common parts and mikroC examples
Microsoft Copilot in Edge Reading an English PDF with Polish questions Can answer in Polish from an English PDF Hallucinated unexpected pin names like D0, D1, D2

Key insight: AI already works as a fast datasheet navigator for well-known parts like MCP23017. It still needs manual verification whenever code, register sequencing, or niche components are involved.

Quick Facts

  • The main test used the MCP23017/MCP23S17 datasheet, which ChatPDF described as a 16-bit remote bidirectional I/O document with configurable interrupts and low standby current. [#20985277]
  • In the thread example, MCP23017 I2C addressing used 3 hardware pins: A2, A1, A0, giving 8 selectable 7-bit addresses from 0b0100000 to 0b0100111. [#20985277]
  • The author noted that ChatPDF linked its address answer to page 15 of the uploaded PDF, which made the reply easier to verify against the source. [#20985277]
  • For Arduino Uno, the AI named A4 as SDA and A5 as SCL, and it also mentioned supply, ground, address pins, and external pull-up resistors. [#20985277]
  • One follow-up report said the free ChatPDF workflow required 0 logins: the user opened the site and dragged the PDF into the upload field. [#20985610]

What is ChatPDF, and how does it work when you upload an electronics datasheet PDF?

ChatPDF is a PDF-chat tool that lets you upload a datasheet and ask natural-language questions about its contents, while also using model knowledge beyond the file. In the MCP23017 test, it immediately summarized the document, suggested example questions, answered address questions, and even pointed to page 15 for support. The same thread also shows its limit: it can produce convincing but wrong code on less common tasks. [#20985277]

How do you upload a datasheet to ChatPDF for contextual analysis without creating an account?

You can upload the PDF directly on ChatPDF.com without logging in. The thread describes this simple flow:
  1. Open the ChatPDF website.
  2. Drag or transfer the PDF into the upload field.
  3. Start asking questions about the document.
The author added that the free version has limitations, just like GPT-style tools, but the basic no-account upload worked for this contextual analysis test. [#20985610]

Which 7-bit I2C addresses can the MCP23017 use, and how are they set with the A2, A1, and A0 pins?

The MCP23017 can use 8 different 7-bit I2C addresses, selected by the A2, A1, and A0 hardware pins. The thread lists them as 0b0100000, 0b0100001, 0b0100010, 0b0100011, 0b0100100, 0b0100101, 0b0100110, and 0b0100111. Each address comes from the fixed 0100 prefix plus the three pin states, so changing A2, A1, or A0 changes the final 7-bit address. [#20985277]

How do you calculate the first I2C control byte for writing to an MCP23017 when A2, A1, and A0 are all high?

Use the 7-bit address 0b0100111 and append a write bit of 0. The thread shows that when A2, A1, and A0 are all high, the first byte sent for a write becomes 0b01001110. In other words, the address bits stay the same, and the least significant bit becomes the R/W bit for the write operation. [#20985277]

What is the difference between a 7-bit I2C address and the full address byte with the R/W bit for the MCP23017?

The 7-bit address identifies the device, while the full address byte adds the final Read/Write bit. In the thread, 0b0100111 is the MCP23017 7-bit address when A2, A1, and A0 are high, and 0b01001110 is the first transmitted byte for a write because the R/W bit is 0. That distinction matters because many datasheets and code examples mix both notations. [#20985277]

How should I connect an MCP23017 to an Arduino Uno over I2C, including SDA, SCL, power, address pins, and pull-up resistors?

Connect power, ground, SDA, SCL, the address pins, and I2C pull-ups. In the thread, the AI correctly named Arduino Uno pins A4 for SDA and A5 for SCL, reminded the user to wire VCC and GND, mentioned A0, A1, and A2 for address selection, and also mentioned pull-up resistors on the I2C lines. The author considered that reply one of the stronger parts of the test. [#20985277]

What extra power supply parts does an MCP23017 need, such as decoupling capacitors or pull-up resistors, in a typical Arduino setup?

The thread says you should include decoupling capacitors and remember the I2C pull-up resistors. After the author asked how to power the circuit, the AI kept the Arduino context, repeated the supply guidance, and explicitly remembered decoupling capacitors. Earlier in the same discussion, it had also remembered the pull-up resistors needed on SDA and SCL. [#20985277]

How do the MCP23017 I2C connections change when moving from Arduino Uno to Arduino Mega?

The core wiring stays the same, but the Arduino board pinout changes. In the thread, the author switched from Arduino Uno to Arduino Mega, and the AI answered with Mega-specific I2C connections, which the author took as proof that the model already knew the Arduino Mega pinout. Power, ground, SDA, SCL, and address-pin wiring still remain part of the connection plan. [#20985277]

What sample Arduino code sets MCP23017 GPA1 high while keeping all other Port A pins low?

The posted example writes two MCP23017 registers over Wire: IODIRA_REG at 0x00 and GPIOA_REG at 0x12. It uses writeRegister(MCP23017_ADDR, IODIRA_REG, 0b00000010); and then writeRegister(MCP23017_ADDR, GPIOA_REG, 0b00000010);, with MCP23017_ADDR defined as 0x20. The author checked those register addresses against MCP support libraries on GitHub and said they looked correct. [#20985277]

How do you enable or configure the MCP23017 internal pull-up resistor for a pin from code?

The thread says AI could generate code for the MCP23017 pull-up resistor, and the author’s verdict was simply, "Looks ok." It does not paste the exact register write as text, so the only safe conclusion is that the tool appeared able to target the pull-up configuration in code for this well-known part. The thread gives no verified mikroC-style or full register-level snippet for this specific pull-up step. [#20985277]

Why might AI-generated mikroC for PIC code for the MCP23017 fail if it tries to write multiple separate registers in one I2C transaction?

It can fail because the generated code appears to assume several separate MCP23017 registers can be written in one transaction. The author objected that this would only work if subsequent bytes landed in subsequent registers through pointer auto-increment, and even that mode would first need to be enabled. He concluded, "I’m not convinced by this code," and feared it would not work as written. [#20985277]

What is the IOCON register in the MCP23017, and how does sequential register addressing affect multi-byte I2C writes?

In this thread, IOCON is the MCP23017 control register the author says must be configured if you want sequential register addressing to support multi-byte writes across consecutive addresses. He points out that auto-increment would have to be turned on first; otherwise, a single transaction aimed at separate registers can fail. That makes IOCON important whenever AI-generated code tries to compress several register writes into one transfer. [#20985277]

ChatPDF vs Microsoft Copilot in Edge for reading datasheets: which one gives more reliable answers for electronics questions?

In this thread, ChatPDF looked more reliable on the MCP23017 test, but neither tool was fully trustworthy. ChatPDF gave correct-looking 7-bit addresses, board pin guidance, and plausible Arduino examples for a common chip. Microsoft Copilot in Edge could read an English PDF and answer in Polish, yet one user immediately noticed hallucinated pin names such as D0, D1, and D2 in its first answer. [#20985801]

Why do AI tools like ChatPDF or Copilot hallucinate pin names, libraries, or code details when reading less common electronics PDFs?

They fail when the topic is weakly represented in their prior knowledge, so they fill gaps with plausible-looking guesses. The author tested a little-known SM15115E document and said ChatPDF incorrectly decided to use the Arduino Wire library, calling the result "heresy." He concluded that these language models give meaningful answers mainly for topics already described extensively in their training data. [#20985610]

How useful is AI for electronics engineers reading datasheets today, and where does it still need manual verification?

AI is useful today as a fast datasheet assistant, but it still needs manual verification for code, register behavior, and uncommon devices. The thread’s main conclusion is twofold: the model can search information inside a PDF, and it also brings extra knowledge such as Arduino I2C pins and libraries. The same author also says it is not perfect and "hallucinates," especially for less known languages, platforms, or problems that only look correct on the surface. [#20985277]
Generated by the language model.
%}