element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Embedded Forum State of micro pins when in sleep mode
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 7 replies
  • Subscribers 495 subscribers
  • Views 761 views
  • Users 0 members are here
Related

State of micro pins when in sleep mode

Former Member
Former Member over 16 years ago

This may be an obvious question, If I am using a micro. (Normally Microchip devices) and I have a pin set high. If I put the micro to sleep, does this pin stay hi or do all the pins go low ?

 

Background is I want to measure a battery voltage that also powers the micro.If this drops to a low value, I want the micro to go to sleep, and enable a FET. i.e switch on an output pin.

 

This FET switches out the potential divider that I'm using to measure the battery voltage with the micro.

 

The leakage current of the circuit is then reduced.

 

Thanks

  • Sign in to reply
  • Cancel
  • Former Member
    Former Member over 16 years ago

    A PICs general output pins remain in their previous state - hi, low, input, analogue - while in sleep.

     

    If you're saving power, be sure to turn off the ADC, USART, comparitor voltage reference and pullups, too.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 16 years ago in reply to Former Member

    Andy,

     

    Appreciate the reply. Thanks.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 16 years ago

    ...just a thought - if your pic is powered directly from the battery, rather than using an external potential divider, does the device have a voltage reference module?

     

    Many of the PICs have a fixed 0.6v reference.  If you measure this (see the ADC input selection section to see if VRef can be selected on the multiplexer) you can deduce the PIC supply voltage: ( 0.6 / Reading ) * 256 when using an 8 bit ADC value.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 16 years ago in reply to Former Member

    Andy,

     

    Useful tip. Thanks.

     

    The micro I'm using is the PIC16F506-I/STPIC16F506-I/ST, however the battery supply is 3 Li-Ion cells approx 10.8V.

     

    The battery supply is reduced to 3.3V via a regulator. The potential divider is across the 3 cells so I dont think I can use the method above.

     

    My thought is that an inline N-channel Fet on the P.D when switched off will 'isolate' the leakage across the P.D.

     

    Any other ideas appreciated !

     

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 16 years ago in reply to Former Member

    I may be missing something in the design but if the fet is in effect disconnecting the bottom of the divider, Vbat would appear on the input pin?

     

    The datasheet suggests Vdd + 0.3v as the maximum voltage on any pin, so you'll probably still have current flowing through the divider, but into the pic rather than the lower half of the divider.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 16 years ago in reply to Former Member

    Andy,

     

    I guess I need to actually protoype my thought on this but attached is the concept. Supply and regulator for pic not shown.

     

    Pin 6 reads the analogue measurement of battery when Pin 7 is active.

     

    When 7 is low, Q1 is off and therefore I was thinking leakage of the divider is removed.

     

    I may have missed the obvious however !

     

    Thoughts?

     

    File attached

    Attachments:
    image
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 16 years ago in reply to Former Member
    Yup, sorry, that's fine, carry on!
    I wasn't sure if you intended connecting pin 6 above or below Q1.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube