13个帖子/ 0新
最后一篇
HRG.
离线
最后一次露面:2年2个月前
Guru
加入:2014-08-05 13:37
I2C interface

Hi dialog team

我对通过I2C接口RTC,我需要使用GPIO端口2引脚4,5。所以问题是我应该在哪里配置GPIO引脚?截至目前正在使用Proximity Reporter_FH程序,用于添加我的接口并检查其工作!所以在pheriph_setup.c中我保留和配置我的GPIO引脚。这种方式是否正确?或者是否有任何其他标准方法来定义那些GPIO引脚?

2)如何将这些引脚配置为INPUTE_OUTPUT引脚,因为在I2C通信期间,PIN应作为输入和输出工作。
我正在使用EEPROM接口示例,以便进入我的RTC .SO需要您在这些中的支持并等待您的回复。

谢谢

gl_dialog.
离线
最后一次露面:3 years 3 months ago
员工
加入:2014-02-07 13:35
嗨,

嗨,

您可以从路径中检查Peripheral_examples:da1458x_sdk_3.0.6 \ peripheral _examples。
It shows how to handle I2C communication.

1)确实,您必须宣布GPIOS引脚:
set_pad_functions(void)

2)对于I2C,它应该是:
GPIO_ConfigurePin(I2C_GPIO_PORT, I2C_SCL_PIN, INPUT, PID_I2C_SCL, false);
gpio_configurepin(i2c_gpio_port,i2c_sda_pin,输入,pid_i2c_sda,false);

regards,
dialog_team。

HRG.
离线
最后一次露面:2年2个月前
Guru
加入:2014-08-05 13:37
嗨,我尝试过pheriperal

嗨,我尝试使用Pheriperal示例与我的RTC接口I2C。截至目前正在使用Abracon RTC 1804,它是7位寻址模式。但是当我呼叫读或写时,inbuilt函数i2c_wait_until_eeprom_ready()被调用,这个函数得到挂断!!我尝试禁用此功能,但仍然没有来自我的RTC的响应。(用I2C调试器测试RTC,RTC工作正常)
如图所示,我已在端口0 2和3引脚上连接了RTC!我可以看到数据信号和时钟信号使用范围,试着写入我的RTC,它只是被挂断了!
DA子板是升压模式。
am awaiting for your response !!

HRG.
离线
最后一次露面:2年2个月前
Guru
加入:2014-08-05 13:37
我完全被困在这一点

完全陷入了这个接口部分。硬件连接似乎很好!如果你尽快回复!因为我没时间了..!

gl_dialog.
离线
最后一次露面:3 years 3 months ago
员工
加入:2014-02-07 13:35
嗨,

嗨,

目前,我们为EEPROM存储器创建了特定的I2C API。

所有API函数都可以找到:i2c_eeprom.c文件,您需要更改一些API,例如:

UINT8_T I2C_EEPROM_READ_BYTE(UINT32_T地址)
{
i2c_wait_until_eeprom_ready();
i2c_send_address(地址);

// wait_whille_i2c_fifo_is_full();//必须删除
SEND_I2C_COMMAND(0x0100); // Set R/W bit to 1 (read access)
// wait_until_i2c_fifo_is_empty();//必须删除
WAIT_FOR_RECEIVED_BYTE(); // Wait for received data
返回(0xff&getword16(i2c_data_cmd_reg));//获得收到的字节
}

我们的计划是为每个传感器创建通用I2C API,但尚未获得这一点,我担心。

Sorry for this convenience.

regards,

dialog_team。

亚历克斯罗
离线
最后一次露面:3周前1年
专家
加入:2014-02-28 19:16
hi dialog_team,

hi dialog_team,

I can't find the i2c_eeprom.c file. Is it in the SDK? Please let me know how can i find it and which SDK.

Thanks,
亚历克斯

HRG.
离线
最后一次露面:2年2个月前
Guru
加入:2014-08-05 13:37
它更好地创造一个

它更好地创造一个generic API for I2C communication !

但从现在在移植到自定义I2C文件时,我没有从RTC(Abracon 1804)的确认.i通过读取i2c_tx_abrt_source_reg寄存器来检查!
could you explain in detail which registers to be used in order to acess the RTC via I2C in detail !!

谢谢

HRG.
离线
最后一次露面:2年2个月前
Guru
加入:2014-08-05 13:37
它更好地创造一个

它更好地创造一个generic API for I2C communication !

但从现在在移植到自定义I2C文件时,我没有从RTC(Abracon 1804)的确认.i通过读取i2c_tx_abrt_source_reg寄存器来检查!
could you explain in detail which registers to be used in order to acess the RTC via I2C in detail !!

谢谢

HRG.
离线
最后一次露面:2年2个月前
Guru
加入:2014-08-05 13:37
它更好地创造一个

它更好地创造一个generic API for I2C communication !

但从现在在移植到自定义I2C文件时,我没有从RTC(Abracon 1804)的确认.i通过读取i2c_tx_abrt_source_reg寄存器来检查!
could you explain in detail which registers to be used in order to acess the RTC via I2C in detail !!

谢谢

gl_dialog.
离线
最后一次露面:3 years 3 months ago
员工
加入:2014-02-07 13:35
嗨,

嗨,

请从第112页看http://support.dialog-seminile.com/system/files/resources/da14580_d ...拥有所有细节。

regards,

对话团队。

gl_dialog.
离线
最后一次露面:3 years 3 months ago
员工
加入:2014-02-07 13:35
您好,

您好,

可以从外设模板中找到I2C_EEPROM.c。

regards,

对话团队。

亚历克斯罗
离线
最后一次露面:3周前1年
专家
加入:2014-02-28 19:16
Hi GL,

Hi GL,

我找到了它,但由于没有DOC,一些参数不明确。请在I2C_EEPROM_INIT()中给出一些内容:
设备地址,uint16_t dev_address,但井斜ce address is 7 bit. I just put this number into dev_address such as 0x00A0, and R/W bit set 0? Is it correc
Thanks,
亚历克斯

dialog_hm.
离线
最后一次露面:3个月1周前
加入:2014-04-01 16:07
嗨,

嗨,

可以使用I2C EEPROM驱动程序来控制其他I2C应用程序 - 芯片,非EEPROM。亚博国际官网平台网址温度传感器(SE95)示例如下所示。

步骤1.打开SDK软件:
sdk ... \ peripheral_examples ... da14580_peripheral_setup.uvproj

步骤2.查看:periph_setup.h:
change the HARDWARE_CONFIGURATION_INDEX (.) to ‘1’.

/ *测试定义 - 选择与H / W设置匹配的配置
* ---------------------------------------------------
*(0) SPI FLASH MEMORY WITH UART
*(1) I2C EEPROM WITH UART
*(2)具有蜂鸣器和UART的正交编码器
* ---------------------------------------------------
* /
// Hardware Configuration <0=> SPI Flash with UART <1=> I2C EEPROM with UART <2=> Quadrature Encoder, Timers & Buzzer with UART
#define硬件_configuration_index(1)// 1 => I2C

第3步。
添加新软件:EEPROM_TEST.C(在文件的开头)

挥发性int16_t温度;
挥发性㈡

//测试外围设备SE95温度传感器
//地址= 1001 a2 a1 a0 r / w => 7bitaddress = 0x48 ... 0x48 + 7 = 0x4f

i2c_eeprom_init(0x48,i2c_standard,i2c_7bit_addr,i2c_1byte_addr);

//读取内部ID号:
II = I2C_EEPROM_READ_BYTE(0x05);//测试读数ID值= 0xA1

//读取温度
btrd = i2c_eeprom_read_data(rd_data,0,2);

温度= 256 * RD_DATA [0] + RD_DATA [1];
温度=温度/ 8;//向右移动3位

I hope this example make it easier to understand.
Althought the suggestion is given that the i2c-drivers work only for EEPROM, but that is not true.

{HM}

主题锁定