Announcement

Collapse
No announcement yet.

How to interpret result from IO Pin

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to interpret result from IO Pin

    Hi

    Hardware is ĀµOLED-96-G1

    I've got my IO set as follows:
    pin_Set(ANALOGUE_10,PIN_1);

    When I read the pin using:
    pin_Read(PIN_1);
    I get a value of 1023. If the pin is set to ANALOGUE_8 I get a value of 255.

    How am I supposed to interpret these values. I've searched the doco but I can't find what the range of the A/D is on the IO pin.

    Any advice or references would be appreciated.

    Thanks,
    Evan.
    Cheers,
    Evan.

  • #2


    ANALOGUE_10 is 10 bit Analogue, i.e. you will get a value between 0 and 2^10-1 (1023)

    ANANLOGUE_8 is 8 bit Analogue, i.e. you will get a value between 0 and 2^8-1 (255)
    Mark

    Comment


    • #3


      Thanks for the reply.

      Can I assume that a value of 255 (or 1023 depending on resolution) is 0v and that a value of 0 is 3.3v and that it's linear across the range?

      Cheers,
      Evan.
      Cheers,
      Evan.

      Comment


      • #4


        If you look at the circuit you will see a pullup resistor in there.

        So you can assume that 0v is 0 and 3.3v is 255 (or 1023) and that it is linear.
        Mark

        Comment


        • #5


          Thankyou, VERY much appreciated.

          Is there doco for this (for example the 0-3.3v range)? I read everything that I could find and only found a passing mention of the IO pin in the 'Internal Functions' document.

          Thanks again,
          Evan.
          Cheers,
          Evan.

          Comment


          • #6


            Maybe not in as many words.

            To me the range is 'obvious'.

            The 3.3v is indicated by the samples in the datasheet
            Mark

            Comment


            • #7


              I'm a software engineer so some things aren't as obvious to me

              Could you please send me a link to the datasheet you mentioned.

              Thanks again,
              Evan.
              Cheers,
              Evan.

              Comment


              • #8


                http://www.4dsystems.com.au/prod.php?id=94

                First download on the downloads tab.

                Yeah, I wonder if we need to write the manuals in a way that doesn't assume any hardware knowledge
                Mark

                Comment


                • #9


                  Documentation is quite good.

                  Just looking at that example I guess that it's possible that the A/D has an input range of 0v to something and the sofware in the display knows that the max it is ever going to get is 3.3V.

                  Still I have my answer now, so thanks again.

                  Evan.
                  Cheers,
                  Evan.

                  Comment

                  Working...
                  X