MCXA153 i2c timeout

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCXA153 i2c timeout

473 Views
_Ferrari_
Contributor V

Dear all,

I am currently developing a project based on the MCXA153VLH microprocessor, that use the I2C peripheral.

Using your 'lpi2c_interrupt_b2b_transfer_master' example as a reference, I have successfully managed to read from and write to a 24C02 EEPROM.

I would now like to implement a timeout mechanism to prevent the process from stalling or hanging if a communication line issues occurs. Could you provide a guideline or best practices for implementing this type of control within the LPI2C driver framework?

Thank you very much for your help and cooperation.

Best regards,

Labels (1)
Tags (2)
0 Kudos
Reply
1 Reply

350 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @_Ferrari_ 

You can insert the MSR->PLTF checking logic into the LPI2C_MasterTransferNonBlocking() function of the I2C driver to detect the pin-low timeout condition.

Alice_Yang_1-1769423981030.png

 

Thank you.

 

BR

Alice

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2299410%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMCXA153%20i2c%20timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2299410%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EDear%20all%2C%3C%2FP%3E%3CP%3EI%20am%20currently%20developing%20a%20project%20based%20on%20the%20MCXA153VLH%20microprocessor%2C%20that%20use%20the%20I2C%20peripheral.%3C%2FP%3E%3CP%3EUsing%20your%20'lpi2c_interrupt_b2b_transfer_master'%20example%20as%20a%20reference%2C%20I%20have%20successfully%20managed%20to%20read%20from%20and%20write%20to%20a%2024C02%20EEPROM.%3C%2FP%3E%3CP%3EI%20would%20now%20like%20to%20implement%20a%20timeout%20mechanism%20to%20prevent%20the%20process%20from%20stalling%20or%20hanging%20if%20a%20communication%20line%20issues%20occurs.%20Could%20you%20provide%20a%20guideline%20or%20best%20practices%20for%20implementing%20this%20type%20of%20control%20within%20the%20LPI2C%20driver%20framework%3F%3C%2FP%3E%3CP%3EThank%20you%20very%20much%20for%20your%20help%20and%20cooperation.%3C%2FP%3E%3CP%3EBest%20regards%2C%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2299410%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EEmbedded%20Components%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2300474%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MCXA153%20i2c%20timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2300474%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F202847%22%20target%3D%22_blank%22%3E%40_Ferrari_%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%3E%0A%3CP%3EYou%20can%20insert%20the%20%3CCODE%3EMSR-%26gt%3BPLTF%3C%2FCODE%3E%20checking%20logic%20into%20the%20%3CCODE%3ELPI2C_MasterTransferNonBlocking()%3C%2FCODE%3E%20function%20of%20the%20I2C%20driver%20to%20detect%20the%20pin-low%20timeout%20condition.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Alice_Yang_1-1769423981030.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Alice_Yang_1-1769423981030.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F374237i4DF6AC9E9B81CC18%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Alice_Yang_1-1769423981030.png%22%20alt%3D%22Alice_Yang_1-1769423981030.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThank%20you.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EAlice%3C%2FP%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E