This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28388D: 应用CM的I2C对EEPROM进行存储

Part Number: TMS320F28388D

应用I2C怎么进行读写,发送帧应包括 :从机地址-内存地址高-内存地址低-数据

从机地址:  I2C_setSlaveAddress(I2C0_BASE,SLAVE_ADDRESS_Write>>1,I2C_MASTER_WRITE);这样发送对不?

内存地址高:

内存地址低:我不知道怎么配置,

发送数据:I2C_putMasterData(I2C0_BASE, 0x0F); I2C_setMasterConfig(I2C0_BASE, I2C_MASTER_CMD_SINGLE_SEND);不知道对不对,每次发送都要写I2C_setMasterConfig(I2C0_BASE, I2C_MASTER_CMD_SINGLE_SEND);吗;

0049CPU的I2C写操作:

p->pI2cRegs->I2CCNT = 2 + p->Txd_num; //Txd_num < 8;   在CM中怎么体现,如何实现多数据发送
p->pI2cRegs->I2CFFTX.bit.TXFFRST = 1; 
p->pI2cRegs->I2CDXR.all= p->Addr >> 8;
p->pI2cRegs->I2CDXR.all = p->Addr & 0x00FF;
for (i = 0; i < p->Txd_num; i++) p->pI2cRegs->I2CDXR.all = p->Msg_Buff[i];
p->pI2cRegs->I2CMDR.all = 0x6E20;

  • I2C_setMasterBurstLength(I2C0_BASE,8);
    ui32DataRx = I2C_getMasterBurstCount(I2C0_BASE);

    设置长度后为什么都读不回来??

  • 已经将您的问题转给了对应的FAE了,请等待其回复

  • I2CMCS_WRITE 和  2CMCS是什么关系?为什么offset是一样的,功能不同,两者offset都是相对于谁的?

  • 我会在确认后给您回复

  • 你好,有没有消息啊

  • 目前还没有,我在E2E上发帖了,您可以跟踪一下

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1028768/tms320f28388d-i2c-registers 

  • 请看一下私信

  • 有没有回复,地址为什么重复的(offset),FAE太水了,写了两天都没搞定

  • 目前还没有回复,我又追问了一下

  • FAE说  寄存器可以设置为读和写的内容不同   我就想不通,同一个地址1就是1 就是0,而且write寄存器为啥就不让看呢

  • Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    //#############################################################################
    //
    // FILE: cm_common_config_c28x.c
    //
    // TITLE: C28x Common Configurations to be used for the CM Side.
    //
    //! \addtogroup driver_example_list
    //! <h1>C28x Common Configurations</h1>
    //!
    //! This example configures the GPIOs and Allocates the shared peripherals
    //! according to the defines selected by the users.
    //!
    //
    //#############################################################################
    // $TI Release: F2838x Support Library v3.04.00.00 $
    // $Release Date: Fri Feb 12 19:08:49 IST 2021 $
    // $Copyright:
    // Copyright (C) 2021 Texas Instruments Incorporated - http://www.ti.com/
    //
    // Redistribution and use in source and binary forms, with or without
    // modification, are permitted provided that the following conditions
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I2C的例程,cpu里面都没有设置GPIO,是不是I2C本身就有问题,当时测试都没过

  • 我会在收到国外工程师回复后给您来回复该贴。

x 出现错误。请重试或与管理员联系。