I2C ST stream until master NACK's

Hi,
I'm interfacing to a device that performs a MR. It's DMA engine wants to read between 48~1024 bytes from my UNO as an ST.

Problem is, the twi_onSlaveTransmit function is only called on the first arbitration, and then expect the master to listen for an ACK if there is more data in the buffer.

Which means there's a 32 byte limit without the master starting another READ TO ADDR cycle.

The proprietary hardware I'm interfacing to does not want to interrupt every 32 bytes and wants to DMA 1024 bytes (or 48 bytes or 512, etc).

Judging by the UNO twi implementation, this looks impossible.

What I don't follow is, during a slave transmit, who drives ACK? Does the master ACK until it is satisfied, or does the slave need to know how much data to send beforehand so it can continue to fill the buffer until (which also requires tweaking the stack).

I think I'm missing something important here that isn't in the ATMega datasheet, nor is it clearly defined on the i2c-bus.org pages.

Advice?
Thanks
PT

Judging by the UNO twi implementation, this looks impossible.

This is correct but you're free to implement your own library that does fulfill your needs.

What I don't follow is, during a slave transmit, who drives ACK? Does the master ACK until it is satisfied, or does the slave need to know how much data to send beforehand so it can continue to fill the buffer until (which also requires tweaking the stack).

The acknowledgment bit is sent by the party that received the previous byte. So in your case the first byte (address plus direction bit) is acknowledged by the slave the rest of the bytes has to be acknowledged by the master. This means the master is responsible to tell the slave when the complete message was received by sending NAK after the last byte (and stop state afterwards).