PIC16F887, turn off..


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2007
    Posts
    48

    Default PIC16F887, turn off..

    How do I turn off all A/D,timers and all the stuff on PIC16F887?

    I know that ANSELH=0 turns of the A/D on PORTB but thers tons of extra on the other ports that i dont want..

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Cut the power supply !

    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  3. #3
    Join Date
    Jul 2007
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sayzer View Post
    Cut the power supply !

    Thats one way but I want to know how to do it the other way.. (in the code)

  4. #4
    sinoteq's Avatar
    sinoteq Guest


    Did you find this post helpful? Yes | No

    Default Just don't use them....

    Look at a PIC like a toolbox with lots of funny tools inside (they are acually hardware functions) Some of these functions are activated after a Power on Reset or similar event, other functions stays in the toolbox until you start to use them. You have already figured out how to turn off PORTB analog functions.

    You 1--PIC 0

    Next we have to worry about Comparators, they are normally a headache so look in the manual, page 87 under 8.6. As you can see a reset event turns this function off and because the PIC makes a POR when it starts this is taken care of.

    You 1--PIC 1


    Timers and other functions:
    Look at other modules and see how they are tured on, look at page 26 Table 2.1 and figure out what the default startup setting is after POR. Table 2.1 shows how things are when the PIC is released from POR

    If the module is not turned on by the PIC and you don't want to use it I see no reason at all to activate them, just let them be and they won't bother you. When you see a need for them just get them one by one and use them as you see fit.

    The only thing left that can make serious trouble is Ocillator settings 4.0 make sure you read and understand this because this is the key module for all functions, no or wrong ocillator freq and you will not get anywhere nor will your program.

  5. #5
    Join Date
    Jul 2007
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Ok, so this will turn off the Comparators?

    Code:
    CMxCON0
    CM2CON1
    And I have no idea how Table 2.1 works :/

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Have you read these?
    http://www.picbasic.co.uk/forum/showthread.php?t=564
    http://www.picbasic.co.uk/forum/showthread.php?t=561

    Table 2-1 just tells the address and names of special function registers. Each is covered in the corresponding part of the data sheet. What one are you looking at?
    Dave
    Always wear safety glasses while programming.

  7. #7
    sinoteq's Avatar
    sinoteq Guest


    Did you find this post helpful? Yes | No

    Default Table 2.1

    Does not only show the name and address of each register,it does that ALSO. Look at Figure 2-4,2-5 and 2-6 they ONLY name and addresss information. The key with Table 2.1 is under the text "Value on POR,BOR" at the top of each table. Table 2-2,2-3,2-4 are similar but addresses different functions. It is only here we can figure out what settings the PIC has after a BOR or POR event. The safe way is to set all registers to a known value the first thing you do in your program or let the POR or BOR event make it for you. Or a combination of these......

    If you do not know what functions are activated how can you turn them off?


    Most people stick to one or two different PICs and use these for many different applications, because of this they learn what and what not to to..... Many times the hard way

  8. #8
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sinoteq View Post
    Does not only show the name and address of each register,it does that ALSO. Look at Figure 2-4,2-5 and 2-6 they ONLY name and addresss information. The key with Table 2.1 is under the text "Value on POR,BOR" at the top of each table. Table 2-2,2-3,2-4 are similar but addresses different functions. It is only here we can figure out what settings the PIC has after a BOR or POR event. The safe way is to set all registers to a known value the first thing you do in your program or let the POR or BOR event make it for you. Or a combination of these......

    If you do not know what functions are activated how can you turn them off?


    Most people stick to one or two different PICs and use these for many different applications, because of this they learn what and what not to to..... Many times the hard way
    Hi sinoteq,
    look in your Microchip mpasm suite folder for the PIC Chip number of your choice .inc file and open it. You will see the register names and syntax for using them, at least in as much as the correct names, I . E. things like . . . Configuration Bits, OSCON , PCON etc . . . Definately worth a look.
    JS
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 20:19
  2. Serial Question + General Review
    By Freman in forum General
    Replies: 2
    Last Post: - 20th June 2008, 22:27
  3. Help with PIC project
    By davekav in forum General
    Replies: 3
    Last Post: - 17th April 2008, 23:15
  4. Interface for 16f818
    By davekav in forum Serial
    Replies: 4
    Last Post: - 17th April 2008, 11:33
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts