hello
I want to read sensor information through SNC in DA1469x + Sensor environment.
Reading 2 bytes through SNC was successful.
However, when reading the fifo of the sensor, it does not seem to read properly.
(When reading once, it tries to read from minimum 56 bytes to maximum 2800 bytes)
用一个示波器观察波形,它一个ppears that the sensor side is sending fifo data to the da1469x.
Can I2C burst read on the DA1469x SNC?
Are there any restrictions on i2c communication in SNC?
Are there any snc i2c burst read examples?
I use SDK_10.0.10.118
please let me know.
thank you.
Device:
嗨SEOF2000,
Thanks for your question online. Can you please check out ourDA1469x I2C Template for Sensor Node ControllerSW Example from the DA1469x support website? Did you follow this tutorial?
There a Readme file in da1469x_snc_i2c_template_sample_code\doc path.
Regarding the burst read, let me check it.
Thanks, PM_Dialog
Hi
我通过参考教程写了它。
To read the sensor's chip ID through SNC's i2c, I verified that I use SNC_i2c_write() and SNC_i2c_read() to read the chip ID.
However, when reading the fifo data from the sensor, it only reads the wrong value. When reading fifo data from the oscilloscope, it looks like the data is being transmitted from the sensor.
In addition, in the mode where SNC is not used, a valid value is read by reading the sensor's fifo data through i2c communication.
I attach the i2c format and part of the code that is currently used when communicating with the sensor.
Please let me know if there is anything wrong.
/***************************************************************************/
_snc_retated静态uint32_t cmd_arry [5] = {0};
_SNC_RETAINED static uint32_t *p_cmd_arry = &cmd_arry[0];
_SNC_RETAINED static uint32_t snc_rxbuf[10] = {0};
_SNC_RETAINED static uint32_t *snc_p_rxbuf = &snc_rxbuf[0];
_SNC_RETAINED static uint32_t snc_fifo[2048] = {0};
_SNC_RETAINED static uint32_t *snc_p_fifo = &snc_fifo[0];
......
void init_snc(void)
{
......
cfg.pdc_evt_pr = AD_SNC_PDC_EVT_PR_0;
cfg.ucode_pr = AD_SNC_UCODE_PR_1;
cfg.cb = _snc_read_cb;
cfg.pdc_entry = HW_PDC_LUT_ENTRY_VAL(HW_PDC_TRIG_SELECT_MASTER, HW_PDC_PERIPH_TRIG_ID_MASTERONLY,
HW_PDC_MASTER_SNC,
HW_PDC_LUT_ENTRY_EN_XTAL | HW_PDC_LUT_ENTRY_EN_COM |
hw_pdc_lut_entry_en_per |hw_pdc_lut_entry_en_tmr);
UCode_CTX = SNC_UCODE_CTX(UCODE_SNC_COLLECT_SAMPLES);
ucode_snc_init();
ucode_id = ad_snc_ucode_register(&cfg, ucode_ctx);
ad_snc_ucode_enable(ucode_id);
ad_snc_pdc_set_pending(snc_ucode_id);
}
SNC_UCODE_BLOCK_DEF(ucode_snc_collect_samples){
......
/* read chip id from sensor */
/ * write addr,idexs * /
SENIS_assign(da(&p_cmd_arry), &cmd_arry[0]);
SNC_i2c_open(I2C_DEV);
SENIS_assign(da(&cmd_arry[0]), 0x41);
SENIS_assign(da(&cmd_arry[1]), 0x00);
senis_assign(da(&cmd_arry [2]),0xff);
snc_mutex_lock(&snc_mutex);
SNC_i2c_write(I2C_DEV, ia(&p_cmd_arry), 3, SNC_HW_I2C_FLAG_ADD_STOP);
SNC_MUTEX_UNLOCK(&snc_mutex);
snc_i2c_close(i2c_dev);
SENIS_del_ms(wait_delay);
/* read chip id */
SENIS_assign(da(&snc_p_rxbuf), &snc_rxbuf[0]);
SNC_i2c_open(I2C_DEV);
snc_mutex_lock(&snc_mutex);
SNC_i2c_read(I2C_DEV, ia(&snc_p_rxbuf), 2, SNC_HW_I2C_FLAG_ADD_STOP);
SNC_MUTEX_UNLOCK(&snc_mutex);
snc_i2c_close(i2c_dev);
......
/ *从传感器读取FIFO数据* /
/ * write addr,idexs * /
SENIS_assign(da(&p_cmd_arry), &cmd_arry[0]);
SNC_i2c_open(I2C_DEV);
SENIS_assign(da(&cmd_arry[0]), 0x12);
SENIS_assign(da(&cmd_arry[1]), 0x01);
snc_mutex_lock(&snc_mutex);
SNC_i2c_write(I2C_DEV, ia(&p_cmd_arry), 2, SNC_HW_I2C_FLAG_ADD_STOP);
SNC_MUTEX_UNLOCK(&snc_mutex);
snc_i2c_close(i2c_dev);
SENIS_del_ms(wait_delay);
/* read chip id */
SENIS_assign(da(&snc_p_fifo), &snc_fifo[0]);
SNC_i2c_open(I2C_DEV);
snc_mutex_lock(&snc_mutex);
snc_i2c_read(i2c_dev,ia(&snc_p_fifo),da(&len),snc_hw_i2c_flag_add_stop);// len == 56〜2700
SNC_MUTEX_UNLOCK(&snc_mutex);
snc_i2c_close(i2c_dev);
......
}
/* get rx, fifo data from SNC */
void get_snc_data(uint32_t * rxbuf,uint32_t * fifo)
{
snc_mutex_SNC_lock(&snc_mutex);
memcpy(rxbuf, snc_rxbuf, sizeof(snc_rxbuf));
memcpy(fifo, snc_fifo, sizeof(uint32_t) * len); // len == 56~2700
snc_mutex_SNC_unlock(&snc_mutex);
}
/***************************************************************************/
Thank you.
hi
In addition, Can I2C burst write on the DA1469x SNC?
please let me know.
thank you.
嗨SEOF2000,
Let me check it and I'll get back to you.
Thanks, PM_Dialog
嗨SEOF2000,
感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程//www.wsdof.com/support
We’ll be fixing bugs / optimizing the searching and tagging over the coming days.
This ticket has been ported on ://www.wsdof.com/products/bluetooth-low-energy?post_id=11443#tab-support_tab_content
Apologies for the delay – I’ll escalate your question internally and respond to you as soon as possible on the NEW forum thread.
Thanks, PM_Dialog