• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Low Power RF & Wireless Connectivity » Low Power RF Bluetooth® Low Energy & ANT Forum » CC2540 power-on default state of PIO pins
Share
Low Power RF & Wireless Connectivity
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

Forums

CC2540 power-on default state of PIO pins

This question is answered
Kapil Pendse9562
Posted by Kapil Pendse9562
on Aug 11 2012 09:35 AM
Prodigy140 points

Hello,

I'm using P0.1, P1.0, P1.1, P2.0 as output pins. I noticed that all these pins go to logic HIGH state just after power on. I checked on oscilloscope to confirm this. This is just momentary, just until I set the pins to LOW at the *end* of the function SimpleBLEPeripheral_Init():

SimpleBLEPeripheral_Init()

{

...........

// makes sure LEDs are off
HalLedSet( (HAL_LED_1 | HAL_LED_2), HAL_LED_MODE_OFF );

P0SEL = 0; // Configure Port 0 as GPIO
P1SEL = 0; // Configure Port 1 as GPIO
P2SEL = 0; // Configure Port 2 as GPIO

//kdp P0DIR = 0xFC; // Port 0 pins P0.0 and P0.1 as input (buttons), all others (P0.2-P0.7) as output
P0DIR = 0xFF; // (P0.0-P0.7) as output
P1DIR = 0xFF; // All port 1 pins (P1.0-P1.7) as output
P2DIR = 0x1F; // All port 1 pins (P2.0-P2.4) as output

//kdp P0 = 0x03; // All pins on port 0 to low except for P0.0 and P0.1 (buttons)
P0 = 0; // All pins on port 0 to low
P1 = 0; // All pins on port 1 to low
P2 = 0; // All pins on port 2 to low

}

Is the default state of all CC2540 PIO pins HIGH? Is there a way to keep them LOW at power ON?

Thanks for your time and best regards,

Kapil

CC2540 PIO
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Igor Sherer
    Posted by Igor Sherer
    on Aug 12 2012 03:27 AM
    Guru21965 points

    Hi,

    After reset all the IOs are configured as inputs. Measuring HIGH on IOs suggests that some other

    code configuring these IOs to act as output HIGH, In BLE stuck you can look for default board

    configuration.

    Br,

    Igor

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Eng351
    Posted by Eng351
    on Aug 12 2012 13:21 PM
    Verified Answer
    Verified by Fredrik K
    Genius3030 points

    Default is inputs with pull-ups enabled, which is why they measure high. The pull-ups are to stop the inputs floating and causing excessive shoot-through current in the IO fets. If you want them low configure as low outputs. 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Kapil Pendse9562
    Posted by Kapil Pendse9562
    on Aug 13 2012 02:05 AM
    Prodigy140 points

    @Eng351, @Igor Sherer,

    Thanks for your replies. I am checking the board default configuration and trying a few things.

    @Fredrik K:

    Why would you hit the verify button so soon? I am still checking and I will verify an answer when I get this problem solved. Thank you!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Fredrik K
    Posted by Fredrik K
    on Aug 13 2012 04:11 AM
    Genius9570 points

    Kapil,

    I verified the answer because what Eng351 wrote about the default GPIO configuration is correct. This information can also be found in the CC253x/4x Users Guide.

    It is great that you will verify answers once you have confirmed they are working. Unfortunately not everybody does this, so threads tend to stay un-verified even though the original question(s) are answered.

    /Fredrik

    --
    PS. If I answered your question, please hit   Verify Answer  !

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Fredrik K
    Posted by Fredrik K
    on Aug 13 2012 04:21 AM
    Genius9570 points

    To elaborate Eng351's answer:

    The default state of GPIOs when the chip is in reset (as it is during power up) is as inputs with pull-ups. There is no way to change this. As soon as the chip is fully powered up you can configure the pins to whatever you want.

    /Fredrik

    --
    PS. If I answered your question, please hit   Verify Answer  !

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Kapil Pendse9562
    Posted by Kapil Pendse9562
    on Aug 13 2012 11:17 AM
    Prodigy140 points

    Thanks everyone for helping out so quickly!

    Fredrick, appreciate your additional information. So the earliest that I can set the pins LOW is in "hal_board_cfg.h" in HAL_BOARD_INIT(). Despite this I do see a momentary HIGH on the pins when the board is switched ON. Just have to live with it.

    I'll leave Eng351's answer as the verified answer where he first mentioned the default state to be INPUT with pull-ups.

    PS: I have relays connected to these 4 pins. The side-effect of this momemtary HIGH is that the relays switch ON for a little bit on Power Up. Is there any way to prevent this? Anything I could do in hardware?

    Thanks again, Kapil

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • BugKing
    Posted by BugKing
    on Aug 13 2012 13:37 PM
    Prodigy630 points

    Hi Kapil,

    There could be a couple of hardware options, the background for these suggestions is the knowledge that the internal pull up resistor on the pad is 23k.

    1) You could place an external resistor to ground that is much smaller than 23k, you would want to make sure the resistor was small enough that the resistive divided voltage appearing at the pin input is not around mid rail and causing excessive shoot through current to the input buffer of the chip.  The downside to this solution is that when you are outputting a high on the pin then there will be a lot of wasted current through the external resistor.

    2) You could place external NMOS FETs which would have their gate control connect to another GPIO and the drain connected to the GPIO connected to the relay.  During power up you are assured that the FET gate control will be high thus causing the GPIO lines in question to be pulled down.  Once in a powered up state you would want to make sure the FET gate control was set to low.  For this solution you will have to ensure the external FET threshold voltage and rdson are appropriate, though I would think you'd have a lot of options.

    I know both of these are a little painful but maybe one will work for you.

    Regards,

    BK

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Eng351
    Posted by Eng351
    on Aug 13 2012 13:45 PM
    Genius3030 points

    Hi Kapil, I assume you have a transistor between the I/O and the relay. You can add a voltage divider between the I/O and transistor base / gate to load down the pull up resistor and also ensure your transistor only switches when the I/O is high. If you are using an NPN and VCC = 3V, i would use say a 5K6 and 2K2:

    GPIO ------[5K6]-------Base 

                                    |

                                   2K2

                                    |

                                  Gnd

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Kapil Pendse9562
    Posted by Kapil Pendse9562
    on Aug 20 2012 21:51 PM
    Prodigy140 points

    Thank you  BugKing, Eng351!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use