Jump to content
CorB

How to use an ADCpin for GPIO ?

Recommended Posts

And a small snippet of code to show the usage of the functions:

 

.....
.....
char testpin=J2_10;
....
....

  OutputPin(testpin);
   PinLow(testpin);

   OutputPin(GPIO_Number_0); // LED to check functionality
   PinLow(GPIO_Number_0);


   for(; { /// forever loop

        PinToggle(testpin);
        PinToggle(GPIO_Number_0);
     DELAY_US(1000000);
       }
.....
.....

Share this post


Link to post
Share on other sites

I noticed two things I'd like to comment on:

  1. The LEDs are setup such that they are on when the associated GPIO is low. The buffers driving them are non-inverting and the LEDs are setup such that the buffer sinks current. There is no design reason for this...its just how I implemented it at the time.
  2. Initially all the GPIOs are Hi-Z at reset. The buffers which drive the LEDs also have a Hi-Z input, so it very easy for a little bit of charge to build up and change the voltage on these nets when the GPIOs are unconfigured. This is purposeful as this is a learning tool and this makes a great remonstration of floating nodes.

Trey

Share this post


Link to post
Share on other sites

That explains the effect of touching the launchpad ... sometimes the LEDs simply lit up shortly and dim away again. Thanks for mentioning this.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...