The I2C protocol does not allow to send data merged to different slaves. Each transmit has to be started with Sendstart() and will be ended by a SendStop(). In between no other slave can be addressed.
I am aware that the I2c protocol does not allow to merge slave slaves. What i want in fact is to issue multiple transmits sequentially to different slaves, but with minimal CPU intervention. I could make multiple calls to the I2c API, but this requires the CPU intervention during the whole transmit procedure.
I've read discussion about using a DMA module to transfert data from SRAM to I2c, but i believe the I2c interface requires too much intervention for this.
I checked the I2C sources but there is no chance for the original code to perform what you want.
You may always copy the original component including code, modify to your needs and use it instead of the original, but that's some work that's not done within 5 minutes.
This is a stretch but makes me wonder if DFB engine + Assembler could
be used coupled with register writes to implement a parallel process to do
what you want. Torturous way to accomplish this but maybe possible ? I
am not sure the documentation is there to get this understood and done.
But food for thought as DFB runs independently from CPU and can handle
both DMA and general memory/register writes.
Thank you for your answers!
The DFB module sound interesting, but since I am not really familiar with it, I won't try for now (I might try eventually in an attempt to speed up the code). I am thinking of modifying the I2c module code.
In the interrupt function, I believe I found where the stop condition is handle. I will add a call to a function where I feed new data (if any) using the API function (I2C1_MasterWriteBuf and I2C1_MasterReadBuf). In the interrupt function, something like this :
I2C1_mstrStatus |= I2C1_GET_MSTAT_CMPLT;
I2C1_state = I2C1_SM_IDLE;
I will use in my code and the function mentioned above a linked list made of request, containing the slave address, a pointer to the data (read or write), the length and a flag whether I want to read or write to the slave.
Couldn't we start with 24 UDB programmed ALUs connected to a DMA-machine life-calculating a trajectory to phobos using quaternions while the ARM M3 scans the TV-program for educational broadcasts ;-)
I succeeded to implement the I2c module using a queue as planned. The problem I encountered is when I try to use more than one I2c module at the same time (using UDB bloc implementation in creator), one of them will crash soon enough (related interrupts stop happening). Since I use interrupt, both mudole work in parallel. I can't find figure out what resource could be shared between different I2c module, although everything tend to show there is. Any idea?
Two scenarios possible: Issue in I2C module or issue in programming. To check the later, upload your project and we will have a look at. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
Yes, I did notice. Since the IDE does not (yet) support C++ there is no chance for helping you from my side. Maybe somebody else jumps in and checks your code.
Actually, It does support C++ with a stretch (not officially though), I even found an article on the subject!
(But that is out of the subject)
Thank you Bob for your time.
I am considering merging all I2c requests in a single queue so that no communication happens in parallel, but I won't know why it doesn't work in parralel...
You appear to be working in an older version of Creator, 3.0 SP2 is
current version, and each new version fixes bugs, adds capability,
so recommended you update Creator.
I attempted build, you have quite a few simple warnings, errors you