• AVR Freaks

Hot![HarmonyV3] [Pic32mx530F128H]: Facing issues to do I2C interface with ATECC608 Crypto chip

Author
nsd
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2020/01/20 23:32:52
  • Location: 0
  • Status: offline
2020/01/23 04:24:52 (permalink)
0

[HarmonyV3] [Pic32mx530F128H]: Facing issues to do I2C interface with ATECC608 Crypto chip

Hello All,
 
I am facing issues while interfacing ATECC608 Crypto with Pic32mx over the I2C using HarmonyV3.
 
Ground work: I have interfaced EEPROM [at24c32] with Pic32mx using Harmony V3 successfully [wrote and read data are same]. For this I used the reference example code provided in the path "../Harmony/csp/apps/i2c/master/i2c_eeprom/firmware/src/main.c from i2c_eeprom_pic32mx470_curiosity project. I thank & appreciate  the team for providing such a supporting project for reference.
 
 Issue statement: I have used the same above developed code to achieve my goal of interfacing ATECC608 Crypto chip with pic32mx530f128h micro by doing slight modifications[updated with Atecc608a address = 0x60] using Harmony V3 drivers.
I could observe that the write and read is happening successfully (as understood/concluded by the return value of the I2c_write and i2c_WriteRead functions). But when I try to check for the size received or read , unfortunately wrote size and read size are not matching. 
 
Output:
Copy pasting the transferred data and received data below for better understanding,
 
#define APP_AT24MAC_DEVICE_ADDR 0x0060
#define APP_AT24MAC_MEMORY_ADDR 0x00
#define APP_AT24MAC_MEMORY_ADDR1 0x00
 
static uint8_t testTxData[APP_TRANSMIT_DATA_LENGTH] =
{
APP_AT24MAC_MEMORY_ADDR,APP_AT24MAC_MEMORY_ADDR1,
'M','C','H','P',
};
//testTxData[0] =
//testTxData[1] =
//testTxData[2] = M
//testTxData[3] = C
//testTxData[4] = H
//testTxData[5] = P
 
static uint8_t  testRxData[APP_RECEIVE_DATA_LENGTH];
//testRxData[0] =
//testRxData[1] =
//testRxData[2] = 3
//testRxData[3] = C
//testRxData[4] =
 
 
I am not understanding that even after read and write is successful why i am not receiving exact array as I transferred!?
Please make me understand whats my mistake and where am I going wrong...
 
Expecting for the quick response.
 
Thanks in advance.
 
#1

4 Replies Related Threads

    vgandhi
    Junior Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2016/10/24 21:28:35
    • Location: 0
    • Status: offline
    Re: [HarmonyV3] [Pic32mx530F128H]: Facing issues to do I2C interface with ATECC608 Crypto 2020/01/26 20:34:15 (permalink)
    0
    The demo example writes a known string to a specific address in EEPROM and then reads it back. Hence, it expects the written data and read data to be same. In your case - using ATECC608 - do you expect to read same data as written?
    #2
    nsd
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2020/01/20 23:32:52
    • Location: 0
    • Status: offline
    Re: [HarmonyV3] [Pic32mx530F128H]: Facing issues to do I2C interface with ATECC608 Crypto 2020/01/27 03:02:59 (permalink)
    0
    Thanks for the response.
    Yes as a first step I am expecting the known data to write into ATECC608 and the same data to be read back into some buffer.
    If this is successful I can proceed to do cryptography using any of the algorithm.
     
     
    Also Can you please let me know what should be the serial number and revision of ATECC608-SSHDA-T chip?
    Currently I am getting "revision as a0003fa4" and "serial number as a8".
    #3
    nsd
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2020/01/20 23:32:52
    • Location: 0
    • Status: offline
    Re: [HarmonyV3] [Pic32mx530F128H]: Facing issues to do I2C interface with ATECC608 Crypto 2020/02/03 23:46:06 (permalink)
    0
    Hello,
     
    Can somebody please help here with the basic(with harmony or without harmony) atecc608 sample code or basic proper ATECC608 initialization (so that I can try my i2c driver with the initialized sample code).
     
    It seems, I am reading junk values for revision and serial number from atecc608 chip when used Harmony I2C driver.
    And without Harmony I2C driver I see control is waiting to get the ack when I try to write any byte.
     
    Expecting the response ASAP.
     
    Thanks in advance.
    #4
    ric
    Super Member
    • Total Posts : 26973
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: [HarmonyV3] [Pic32mx530F128H]: Facing issues to do I2C interface with ATECC608 Crypto 2020/02/04 05:33:54 (permalink)
    5 (1)
    nsd
    without Harmony I2C driver I see control is waiting to get the ack

    What does this mean?
    Correctly written I2C code does not WAIT for an ACK. You read it once at the correct time, so you either get an ACK or a NAK.
    If you get a NAK, you have a hardware problem, or are using the wrong slave address, or trying to access the chip when it is busy.

     Expecting the response ASAP.

    This is a user forum. Demanding quick answers is just going to put people off attempting to help.

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #5
    Jump to:
    © 2020 APG vNext Commercial Version 4.5