This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello , I'm trying to interface TM4C1294NCPDT with MPU9-150 through I2C , I'm using FIFO, cause i want to write 2 bytes at one time
is that possible here to just send a start condition with burst and still waiting on one condition till the bytes are sent and then generate a stop condition ?
or do i have to generate a burst continue after each byte?
//1. Enable and provide clock to choosen I2C.
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C0);
//2. Enable clock to the selected GPIO module.
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
//3. Enable I2C pins for their alternate function.
GPIOPinConfigure(GPIO_PB2_I2C0SCL);
GPIOPinConfigure(GPIO_PB3_I2C0SDA);
GPIOPinTypeI2CSCL(GPIO_PORTB_BASE, GPIO_PIN_2);
GPIOPinTypeI2C(GPIO_PORTB_BASE, GPIO_PIN_3);
GPIOPadConfigSet(GPIO_PORTB_BASE, GPIO_PIN_2|GPIO_PIN_3, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU); //PULLUPS
//initialize as master
I2CMasterEnable(IIC0_BASE);
//initialize the clock
I2CMasterInitExpClk(I2C0_BASE, SYSTEM_CLOCK1, false);
//initialize the transmitter FIFO to the master
I2CTxFIFOConfigSet(IIC0_BASE, I2C_FIFO_CFG_TX_MASTER );
//specify the slave address of the master and configure to write.
I2CMasterSlaveAddrSet(IIC0_BASE ,slave_address, false);
//specify the data count
I2CMasterBurstLengthSet(IIC0_BASE, 2);
//putting the 2 bytes in FIFO
counter = I2CFIFODataPutNonBlocking(IIC0_BASE,0x07);
counter = I2CFIFODataPutNonBlocking(IIC0_BASE,10);
//Sending start with burst
I2CMasterControl(IIC0_BASE, I2C_MASTER_CMD_FIFO_BURST_SEND_START);
So what should i do here : Waiting on the count register till reaches to zero and then generate a stop condition or i have got to wait till one by one byte and every time generate a burst continue command ?
thanks.
Hello Mohamed,
To use BURST mode you'd do I2C_MASTER_CMD_FIFO_BURST_SEND_START for the first byte and I2C_MASTER_CMD_FIFO_BURST_SEND_FINISH for the second byte. I2C_MASTER_CMD_FIFO_BURST_SEND_FINISH will generate the STOP condition for you.
So if i want to send N bytes ,what should i do with bytes between the first and the last byte ?
Greetings,
If I may (to save wear/tear upon vendor staff) you may use, "I2C_MASTER_CMD_BURST_SEND_CONT" for those 'intermediate' bytes. (i.e. neither first or last)
You may not yet have discovered the powerful MCU resource: "TivaWare™ Peripheral Driver Library User's Guide." Within this manual's 752 pages appear clear & exacting descriptions of this vendor's API - and this source plus (other) Peripheral 'Coding Examples' - will quickly build your confidence & capability. The questions you asked were all resolved w/in Section "16.1.1 Master Operations" of that manual.
Hello Cb1_mobile,
I'm asking about burst transmission with FIFO , not just burst transmission. so if i have to take control at each byte, then the whole benefits from the FIFO is just to hold data ?
i'm wanting to send a number of data without getting evolve in each transmission or reception.
I hope you got what i want.
Thanks.
Hello,
Mohamed Elahmady said:I'm asking about burst transmission with FIFO , not just burst transmission
Whoops - I totally MISSED that (Dummkopf) - sorry! Pardon - I'm unclear as to what you mean by, "Take control at each byte." My understanding is that the 'Burst Transmissions' well enable 'multi-byte' I2C data transfers. I'm unsure (if & how) the FIFO proves able to 'improve upon this process.' (Unless it speeds & simplifies - as you appear to suggest - yet that's beyond my understanding...)
Unless you can 'tease out' an answer thru 'A vs. B (burst vs. burst/FIFO) experimentation/comparison' - this may be best left for vendor agent comment...
Hi again,
The PDL reference I noted earlier reveals, "I2C_MASTER_CMD_FIFO_BURST_SEND_CONT" which should answer your earlier question. (i.e. used w/'intermediate' bytes)
However - digging a bit deeper (via a 2014 post from forum's 'famed' Amit) - further detail is provided.TM4C129x I2C FIFO Operation - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E...
Hello cb1,
Thank you for digging up that information over the weekend!
Mohamed,
Now that you are aware of the uDMA requirement to really leverage the FIFO, is that something you want to pursue?
By the way, the MPU9150 is already supported in our provided SensorLib, can you elaborate what is not sufficient with that implementation for your system?
Hello Ralph,
Thank you - w/out young staff to 'Catch & Repair my screw-up' - I believed it necessary to (somehow/maybe) redeem my (missed FIFO) parameter error.
And indeed - first Amit, then cb1 & now you - all sense that the I2C FIFO (may) 'Demand more that it Delivers!' (and it is sized so small - as well)
To the MPU9150 (staff answered another similar post on that) - it is 'EOL.' And as always - poster's (somewhat) "Detailing that which they find limiting" - goes far in enabling their AID!