Jump to content
Sign in to follow this  
imp

C2000 Launchpad GPIO question

Recommended Posts

Hi all

I've just started my experiments with C2000 Launchpad. During the analysis of sample code I found that GPIO_setLow(myGpio, GPIO_Number_3) lights up the user LED. However I'd expect that the procedure, which does it should be GPIO_setHigh. Sampling the random GPIO pin (other than user LED) with oscilloscope gives logic 1 after calling GPIO_setHigh.

I'm a bit confused about this behavior and I'd appreciate any explanation.

Thanks a lot in advance!

Share this post


Link to post
Share on other sites

Hi all

I've just started my experiments with C2000 Launchpad. During the analysis of sample code I found that GPIO_setLow(myGpio, GPIO_Number_3) lights up the user LED. However I'd expect that the procedure, which does it should be GPIO_setHigh. Sampling the random GPIO pin (other than user LED) with oscilloscope gives logic 1 after calling GPIO_setHigh.

I'm a bit confused about this behavior and I'd appreciate any explanation.

Thanks a lot in advance!

It's probably because the GPIOs are pulled up causing them to invert.

Share this post


Link to post
Share on other sites

It's probably because the GPIOs are pulled up causing them to invert.

Thank you for your response. I added the line 'GPIO_setPullUp(myGpio, GPIO_Number_3, GPIO_PullUp_Disable);' to my code but nothing has changed. Perhaps that is a design feature, and I'm trying to figure out exactly why it works this way.

Share this post


Link to post
Share on other sites

Imp,

This is part of the design. The buffer on the LEDs are inverting buffers, so when you give it a logic high they put out a logic low which then sinks current from the LEDs.

 

Another thing which is kinda cool is that the buffers have a very high input impedance, so much so that you may have noticed when the buffers aren't driven that you can change the LEDs state by touching the GPIO pins. This was done intentionally to show users what a floating node looks like and how it acts.

Share this post


Link to post
Share on other sites

The buffer on the LEDs are inverting buffers, so when you give it a logic high they put out a logic low which then sinks current from the LEDs.

 

Not trolling nor trying to be pedantic. The buffers (SN74LVC2G07) are not inverting. The LED and current limiting resistors are tied to 3.3V (according to http://www.ti.com/li...hh2/spruhh2.pdf). So when the GPIO pin goes low, the buffer output goes low as well and current flows from 3.3V through the resistor and LED then drains into the buffer output of the SN74LVC2G07. So this is the expected behavior but for a slightly different reason.

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.

Sign in to follow this  

×
×
  • Create New...