logo elektroda
logo elektroda
X
logo elektroda

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

p.kaczmarek2 2868 11
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • 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?

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    Do you have a problem with Arduino? Ask question. Visit our forum Arduino.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 11928 posts with rating 9987, helped 572 times. Been with us since 2014 year.
  • ADVERTISEMENT
  • #2 20985602
    czareqpl
    Level 33  
    You did not write exactly how you sent the PDF file for contextual analysis.
  • #3 20985610
    p.kaczmarek2
    Moderator Smart Home
    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:
    ChatPDF.com user interface with a PDF file drop area
    The free version, like the GPT version, has its limitations, but I have also seen that there are free, locally run models available on the Internet, and I will try to discuss this soon.

    I recommend everyone to experiment and let me know if this tool works for you or not.

    Added after 3 [minutes]:

    EDIT: By the way, I also posted the catalog note for the little-known SM15115E system and asked for sample code - unfortunately, it turned out to be heresy, ChatPDF made up his mind that he would use the Wire library from Arduino for this... well, it`s difficult, but it was already known with ChatGPT - these models language learners make meaningful answers only to topics that have been extensively described in the training data.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 20985801
    speedy9
    Helpful for users
    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. The answer to the first question is different and you can see hallucinations (where did he suddenly get D0, D1 and D2?)
    Screenshot showing a user question and Copilot's response about I2C addresses of the MCP23017 chip.
    Still worth testing.
  • #5 20985906
    silvvester
    Level 25  
    p.kaczmarek2 wrote:
    Do you see potential in such an "AI helper" for reading catalog notes?


    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 for components with specific parameters or functions.
  • #6 20986108
    gulson
    System Administrator
    silvvester wrote:
    Perhaps if the base of semiconductors expands to 99% of those available on the market, AI will be useful for searching for components with specific parameters or functions.

    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.
  • ADVERTISEMENT
  • #7 20986569
    pixel7
    Level 24  
    p.kaczmarek2 wrote:
    Do you see potential in such an "AI helper" for reading catalog notes?

    The students won`t read the books either, uncle GPT will tell everything. And with this knowledge he sets out in life.
  • #8 20988346
    andrzejlisek
    Level 31  
    pixel7 wrote:
    p.kaczmarek2 wrote:
    Do you see potential in such an "AI helper" for reading catalog notes?

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

    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 same as lossy image compression.

    Added after 3 [minutes]:

    silvvester wrote:
    p.kaczmarek2 wrote:
    Do you see potential in such an "AI helper" for reading catalog notes?


    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 for components with specific parameters or functions.

    However, if the database includes basic semiconductors, such as transistors, thyristors, triacs, such AI will allow you to easily obtain the answer to one simple question important for amateur construction: Which terminal of the element is which part of the element? To make it clear which terminal is the base, which is the emitter, which is the collector (in the case of an NPN transistor).
  • #9 20990830
    pixel7
    Level 24  
    andrzejlisek wrote:
    Relevant information will be preserved, but the original text and non-essential information will be irretrievably lost.

    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 or leave him to fate?
  • ADVERTISEMENT
  • #10 20991159
    andrzejlisek
    Level 31  
    pixel7 wrote:
    andrzejlisek wrote:
    Relevant information will be retained, but the original text and non-essential information will be irretrievably lost.

    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 or leave him to fate?


    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 on the previously provided content that GPT analyzes.

    Moreover, the algorithm will be variable, because new materials will be added to the "knowledge base" every now and then, and today GPT will issue one answer, and tomorrow a different one to the same question.
  • #11 20991208
    czareqpl
    Level 33  
    andrzejlisek wrote:
    Moreover, the algorithm will be variable, because new materials will be added to the "knowledge base" every now and then, and today GPT will issue one answer, and tomorrow a different one to the same question.


    So, basically, like an intelligent person who is not a cow with unchanging views.
  • #12 20991448
    pixel7
    Level 24  
    andrzejlisek wrote:
    because new materials will be added to the "knowledge base" every now and then

    I`m asking about the "helper". He will have almost unlimited competences.

Topic summary

The discussion revolves around the capabilities of AI tools like ChatPDF in assisting electronics engineers with datasheet analysis. The user experiments with ChatPDF by uploading the MCP23017 port expander datasheet to evaluate its ability to interpret technical information. Responses highlight the limitations of AI in understanding complex queries and generating accurate code, as well as the potential for AI to support engineers in component identification and parameter searches. Other tools, such as Microsoft Copilot, are mentioned as alternatives for reading PDFs. Concerns are raised about the reliability of AI-generated information and the implications for traditional learning methods in engineering.
Summary generated by the language model.
ADVERTISEMENT