This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf52840 twim: how to write multiple buffers without repeated start condition?

The TWIM peripheral allows you to tx multiple buffers back-to-back like this:

- Set buffer 1 in TXD.PTR, TXD.AMOUNT
- Trigger TASKS_STARTTX
- Wait for EVENTS_TXSTARTED
- Set buffer 2 in TXD.PTR, TXD.AMOUNT
- Wait for EVENTS_LASTTX
- Trigger TASKS_STARTTX
- Wait for EVENTS_LASTTX
- Trigger TASKS_STOP

(This is what nrfx NRFX_TWIM_XFER_TXTX does, for instance)

However, this will send this on the bus:

- Start condition
- Address + write bit
- Data from buffer 1
- REPEATED start condition <-- I don't want this
- Address + write bit <-- I don't want this
- Data from buffer 2
- Stop condition

Is it possible to NOT send the repeated start condition, sending the data from the 2 buffers back-to-back instead? like this:

- Start condition
- Address + write bit
- Data from buffer 1
- Data from buffer 2
- Stop condition

To be clear, I'm not asking if the Nordic's C software (nrf5 SDK, nrfx) supports it (I already know it doesn't).

I'm asking if the actual hardware supports it. I'm writing my own driver, directly touching the TWIM registers, events and tasks.

Parents Reply
  • Hi,

    The twim peripheral doesn't support it no, it may be possible by using the legacy twi peripheral that is also present in hardware. However the legacy twi require you to write one byte at a time (e.g. there will be a twi interrupt for each byte written/read), so in terms of resources and speed I don't think it is worth looking into this option.

    Best regards,
    Kenneth

Children
No Data
Related