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.

How to read analog value (Potentiometer value) and display it on 16x2 LCD with TM4C123G ?

Hi,
I'm new with the launchpad TM4C123G6HPM. I want to read an analog input (potentiometer resistance value) and display it on 16x2 LCD.. Can someone help me with the connection and code please ? 

  • Hello Islam

    The forum is a place to discuss issues and not a free code repository. Having said, if you are looking for guidance, then let's discuss

    1. You can read the Potentiometer resistance value indirectly, by connecting a fixed voltage across the pot and, then reading the voltage of the wiper terminal. Knowing the range of the pot, the min, max and wiper voltage, the resistance can be derived.
    2. There are numerous panels. Which panel are you referring to?

    Regards
    Amit
  • May I agree w/vendor's Amit - poster needs to narrow focus - demonstrate (some) time/effort investment in his/her project.   (none currently reveals)

    As to the Lcd panel - may I note that 99% of such "Character Lcds" employ the "Grandfather of all Char. Lcd Controllers" (HD44780) or one of the many clones!   Only exceptions are the very newest character modules - which may have moved to I2C or an "SPI-like" interface - reducing the GPIO demands upon the MCU.

    HD44780 style LCDs require a parallel interface - either 4 or 8 bits - along w/2 control signals.   (8 bit is highly recommended - even experts are initially challenged by the 4 bit initialization & extended timing)   A contrast pot is usually required - incorrect voltage level renders the Lcd unviewable...

    One further suggestion - poster presents a highly specific "project need" (homework, anyone) and his, "newness w/LPad" - yet (any) reported familiarity w/the MCU/peripherals & coding sits silent.    One crawls before walking - and reads the fine manuals (both MCU & LCD) & runs many code examples - prior to attempting homework projects!

  • Hi Amit,
    I just need some guidelines concerning with port initialization , the methodology and equations to calculate the analog value, and not the ready-made code..
    I'm using KL SN 102 94v-0 lcd ..
  • Hello Islam,

    I think the method and equation has been described in the first post.

    The real method

    1. For the display what is the protocol and does the voltage on the IO's correspond to the IO voltage of TM4C devices
    2. Is the protocol SPI, I2C or some custom protocol
    3. If it is one of the standard peripherals, look at example codes to see how to initialize them
    4. If it is a custom protocol, use GPIO to bit bang the protocol: And do search the web....

    Regards
    Amit