Can I2C burst read on the DA1469x SNC?

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at https://www.dialog-semiconductor.com/support . We’ll be fixing bugs / optimising the searching and tagging over the coming days.
6 posts / 0 new
Last post
seof2000
Offline
Last seen: 1 year 5 months ago
Joined: 2019-11-06 06:41
Can I2C burst read on the DA1469x SNC?

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)

Looking at the waveform with an oscilloscope, it appears 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: 
PM_Dialog
Offline
Last seen: 5 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi seof2000,

Hi seof2000,

Thanks for your question online. Can you please check out our DA1469x I2C Template for Sensor Node Controller SW 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

seof2000
Offline
Last seen: 1 year 5 months ago
Joined: 2019-11-06 06:41
Hi 

 

Hi 

I wrote it by referring to the tutorial.

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_RETAINED static 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);

......

/* read fifo data 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]), 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.

Attachment: 
seof2000
Offline
Last seen: 1 year 5 months ago
Joined: 2019-11-06 06:41
 

 

hi

In addition, Can I2C burst write on the DA1469x SNC?

please let me know.

thank you.

PM_Dialog
Offline
Last seen: 5 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi seof2000,

Hi seof2000,

Let me check it and I'll get back to you.

Thanks, PM_Dialog

PM_Dialog
Offline
Last seen: 5 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi apdobaj

Hi seof2000,

Thanks for coming to the forums. Exciting news! We’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the NEW forum only - please POST any new threads at  https://www.dialog-semiconductor.com/support

We’ll be fixing bugs / optimizing the searching and tagging over the coming days.

This ticket has been ported on : https://www.dialog-semiconductor.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