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.

CCS/TM4C1294NCPDT: Read data from I2C and to show that on uart terminal

Part Number: TM4C1294NCPDT

Tool/software: Code Composer Studio

Hello,

I want to read data through I2C and want to show that data on the UART terminal. 

Is there any example related to that?

I want to communicate multiple sensors through I2C.

please also help me to include the pinmux code into examples.  

  • m_vedsharma said:
    I want to read data through I2C and want to show that data on the UART terminal.       Is there any example?

    It would prove difficult for any vendor to be able to anticipate the needs/desires of all client-users - is that not so?         Thus - to the best of my knowledge - some examples may "come close" - yet not fully answer your desire.       (others here - who employ that MCU - may add detail I lack...)        

    While an "exact" example may be lacking - it is quite straightforward for you to "Synthesize a solution" - via an orderly, systematic, multi-step process.      I'll detail that later - towards the bottom of this post.

    m_vedsharma said:
    I want to communicate multiple sensors through I2C.

    The accommodation of "multiple devices" - upon a shared, 2-wire bus - was & remains the intent of I2C.       Know that "I2C" is a short-range bus - separation should not exceed 1 meter - if the bus is heavily loaded and/or operated at "high-speed" - that distance may shorten.        Multiple I2C devices are accepted - provided that their defining addresses differ - and it falls to you to insure that rule is observed.     (Device addresses are always listed w/in the I2C device's spec/datasheet.)        Note that while vendor's datasheet may (suggest) otherwise - "external Pull-Up resistors" - rather than MCU's (too high value internal ones) most always prove superior...    (4K7-10K usually serve well)

    m_vedsharma said:
    ...help me to include the pinmux code

    This statement signals that you've done (some) reading - but not all that is required.          What then, "Do you - or other new users - require?"        

    Prime reading material includes the:

    • "MCU Manual"
    • "Peripheral Driver Library (PDL) User Guide"
    • the many "code examples" (found @ vendorWare\examples\peripherals) 

    Your setting of the pinmux code - quickly, correctly, easily - is achieved via your use of the API - and hugely detailed w/in the PDL User Guide - earlier described.      That guide is divided among MCU Peripherals - enabling you to deal w/"One Peripheral at a time" - which is fully "KISS" compliant.      (thus to (both) your great aid & the liking of many "serious" MCU users - here)

    The pinmux is configured via two API functions: "GPIOPinConfigure()" and "GPIOPinType()" - both very nicely detailed w/in the PDL guide.       You will have to find & review "pin_map.h" to choose the value most suitable for your MCU to serve as "parameter" w/in the GPIOPinConfigure() function.

    To present the i2C sensored data upon the UART driven terminal requires that you place each sensor's data w/in MCU's SRAM storage area - which has R/W access by the I2C devices - but Read Only access by the UART.     (the UART - employed only as a display here (your spec)  - should not be granted the ability to "Alter Sensor Data.")    Note too that the MCU's UART - unless routed thru vendor's "ICDI" or an external "CMOS to USB Converter" is incompatible w/most all PCs - should they be tasked w/your UART reception requirement.      

    Following the same procedures I've outlined re: "I2C" - you may "remove the mysteries of the MCU's (many) UARTs - and choose one to transport your, "I2C acquired data" for eased display.

    Believe the above well answers your post's request - and sets you (and others) effectively, "On your way."