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.

TMS570LS2124: ADC pins used as GPIO pins

Part Number: TMS570LS2124

Tool/software:

Hi i am working on TMS570LS2124 micro controller on this i want to use ADC pins as GPIO pins. 

how can i make direction of that ADC pins, Reading of that pin status and seting the pins.?

with regards 

D. Srikanth

  • Hi Srikanth,

    You cannot change the ADC pins direction; the ADC pins will always act as input pins.

    So, it is not possible to make ADC pins as GIO output pins.

    And GIO input on ADC pins also not possible directly, i can suggest you one indirect method. I mean you should need to read the pin voltage on the corresponding pin using ADC module, now compare this voltage with I/O levels and assume the corresponding level.

    If you verify low level input voltage and output voltage for GIO inputs in this device:

    If the input voltage less than 0.8v then the controller assumes it as logic-0 and gives the 0 in the input register for corresponding GIO input and similarly if input voltage greater than 2v then it assumes the input as logic-1 and gives the 1 in the input register for corresponding GIO input. And 0.8v to 2v range is called forbidden range and we don't know what the GIO value for this range will be.

    You can implement same behavior with ADC, so you will read the ADC value on the corresponding ADC pin and you will compare it with the above limits i mentioned and based on that you can assume the corresponding logic level on the pin.

    --
    Thanks & regards,
    Jagadish.

  • thank you jagadish for replay.

    i got your point ADC pin direction we can't change but we can read the status of ADC pins.

    but here i am using "giogetport ()" function in this we have to mention ADC Registor but it throughing warning.

    any other method is there to read ADC pin's status!

    with regards

    D.Srikanth.

  • Hi Srikanth,

    we can read the status of ADC pins.

    No, it is not possible to read the ADC pins status like as GIO (High and Low). They are not digital pins, and they can't provide Logic-High or Low status and they are analog pins, and they can only provide the analog voltage on the pin.

    but here i am using "giogetport ()" function in this we have to mention ADC Registor but it throughing warning.

    You can't use "giogetport()" port function for analog pins.

    To use this function the corresponding module should have the Pin control registers, for example look at this SPI pin control registers.

    If you see analog module registers there you don't find any pin control registers, as i said this is because you can't use analog pins for digital functionalities.

    The only method you can do here is the method i mentioned in my previous comment.

    --
    Thanks & regards,
    Jagadish.

  • ok thank you jagadish.

    with regards 

    D. Srikanth.