Post Go back to editing

Communicating with the CN0428 with ESP32

Hello, im doing the same and I dont understand how to start. I want to use an esp32 and wire.h Arduino library to communicate with cn0428 or Arduino interposer board. 

Do you solved this? Do you have any information about the i2c communication in cn0428? 



updated the title after splitting
[edited by: Brandon at 1:14 PM (GMT -4) on 30 Aug 2021]
Parents
  • Hi GabrielCL,

    Would you have a block diagram or a picture of what you are trying to do?

    The CN0428 uses the ADuCM355 microcontroller, but that micro is dedicated to doing the impedance calculations and other functions dedicated to that chip itself.  That's why we are using the EVAL-ADICUP3029 board to be able to do multiple channels as well as aggregate the data into a higher level embedded application capable of representing the data and interfacing the data depending on what you are doing.

    Look forward to better understanding some of your setup specifics.

    Cheers,

    Brandon

  • Hello Brandon, sorry for the delay, im working on this very slowly because it's only for educational purposes and not for work or money...

    This is my block diagram of the connections.
    I want to design a way to communicate with cn0428 using i2c protocol.
    I read that you can consult register 0x61 to know the number of bytes to read and i recieve a uint8_t answer with value "255".
    But when I ask register 0x63 to obtain the character buffer says that its empty. it's register 0x63 and the next correlative registers that contains the char output buffer? works like a char input buffer too? Do i need to write my ASCII characters in the same 0x63 register after?

    I still not send ascii characters to the cn0428, so make sense an empty output char buffer.



    this its my code:

    #include <Arduino.h>
    #include <Wire.h>
    
    void bytes2read(uint8_t i2cAddress);
    uint8_t bytes_2_read = 0;
    char buffer[34];
    
    void setup() {
    
    
      Wire.begin();
      Serial.begin(9600);
    
    
    }
    
    void loop() {
    
      bytes2read(0x4C);
    
        //////////////Third try from https://github.com/analogdevicesinc/arduino/blob/9fd4174eb86e0df8f909e2ebed25b35d76ffc6e9/Arduino%20Uno%20R3/examples/CN0428_example/CN0428_example.ino#L377
        uint8_t i = 0;
        Wire.beginTransmission(0x4c);
        Wire.write(0x63);
        Wire.endTransmission(); 
    
        Wire.requestFrom(0x4c, 10); //must be bytes_2_read but i tried using 10
        while(Wire.available())
        {
          buffer[i++] = Wire.read();
    
        }
    
        buffer[33] = '\0';
        Serial.print("Buffer: ");
        Serial.println(buffer);
    
    
      delay(2000);
    
    }
    
    
    void bytes2read(uint8_t i2cAddress){
    
      Wire.beginTransmission(i2cAddress); //Iniciamos comunicacion con direccion i2c 0x4c
      Wire.write(0x61); //Apuntamos al registro 0x61 (el bytes to read del aducm355 firmware)
      Wire.requestFrom(i2cAddress, 1); //pedimos 1 byte de la direccion i2c 0x4c
      bytes_2_read = Wire.read(); //Leemos y asignamos la lectura a bytes_x_leer
      
      Wire.endTransmission();
      Serial.print("There is ");
      Serial.print(bytes_2_read);
      Serial.println(" bytes to read");
    
    }



    I read this answer but i cant to understand why he recieves the welcome message but i dont recieve it.
    ez.analog.com/.../439341

Reply
  • Hello Brandon, sorry for the delay, im working on this very slowly because it's only for educational purposes and not for work or money...

    This is my block diagram of the connections.
    I want to design a way to communicate with cn0428 using i2c protocol.
    I read that you can consult register 0x61 to know the number of bytes to read and i recieve a uint8_t answer with value "255".
    But when I ask register 0x63 to obtain the character buffer says that its empty. it's register 0x63 and the next correlative registers that contains the char output buffer? works like a char input buffer too? Do i need to write my ASCII characters in the same 0x63 register after?

    I still not send ascii characters to the cn0428, so make sense an empty output char buffer.



    this its my code:

    #include <Arduino.h>
    #include <Wire.h>
    
    void bytes2read(uint8_t i2cAddress);
    uint8_t bytes_2_read = 0;
    char buffer[34];
    
    void setup() {
    
    
      Wire.begin();
      Serial.begin(9600);
    
    
    }
    
    void loop() {
    
      bytes2read(0x4C);
    
        //////////////Third try from https://github.com/analogdevicesinc/arduino/blob/9fd4174eb86e0df8f909e2ebed25b35d76ffc6e9/Arduino%20Uno%20R3/examples/CN0428_example/CN0428_example.ino#L377
        uint8_t i = 0;
        Wire.beginTransmission(0x4c);
        Wire.write(0x63);
        Wire.endTransmission(); 
    
        Wire.requestFrom(0x4c, 10); //must be bytes_2_read but i tried using 10
        while(Wire.available())
        {
          buffer[i++] = Wire.read();
    
        }
    
        buffer[33] = '\0';
        Serial.print("Buffer: ");
        Serial.println(buffer);
    
    
      delay(2000);
    
    }
    
    
    void bytes2read(uint8_t i2cAddress){
    
      Wire.beginTransmission(i2cAddress); //Iniciamos comunicacion con direccion i2c 0x4c
      Wire.write(0x61); //Apuntamos al registro 0x61 (el bytes to read del aducm355 firmware)
      Wire.requestFrom(i2cAddress, 1); //pedimos 1 byte de la direccion i2c 0x4c
      bytes_2_read = Wire.read(); //Leemos y asignamos la lectura a bytes_x_leer
      
      Wire.endTransmission();
      Serial.print("There is ");
      Serial.print(bytes_2_read);
      Serial.println(" bytes to read");
    
    }



    I read this answer but i cant to understand why he recieves the welcome message but i dont recieve it.
    ez.analog.com/.../439341

Children
No Data