Slow starting up


Closed Thread
Results 1 to 35 of 35

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    Hey
    belive me I had a look..
    page 278 and 279 of the manual states the define and OSCCON values.
    The datasheet talks about the OSCCON value which I set. But the define OSC 1 Mhz do not work. Lowest it will go is 4Mhz.
    Datasheet stipulates internal oscillation can go as low as 31khz...

  2. #2
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    I'd like to see the rest of your code but is OSCCON = %01001000 correct? Shouldn't it be OSCCON = %01001110? I'm assuming you're using an internal oscillator, should be stable and it should be used as system clock. I don't know why 4Mhz worked but, if that's all you changed between compiles, then try that.

    This is for a 16F88 and is on page 40 of the datasheet.

  3. #3
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    ya that works, that bit at position 1. Ithink that did it. thanks

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


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    Bits 0 through 3 of OSCCON are read only?
    Last edited by mackrackit; - 16th May 2013 at 14:58.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    Actually it compiles , but after careful testing, the frequency is all over the place when using only OSCCON = %01001110..

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    Hi All. After reading this thread, it made me look at something I now don't understand. I've been using this table for years for 'F819 and 'F88. But when you convert the decimal numbers to binary, the bits don't match the table in the datasheet. When you pick the bits and convert to decimal, they don't match the table. Does anyone know why? Thank you.


    'osccon values for 16f818/819:
    'OSCCON = $00 'for 31.25 khz
    'OSCCON = $10 '125khz
    'OSCCON = $20 '250khz
    'OSCCON = $30 '500khz
    'OSCCON = $40 '1mhz
    'OSCCON = $50 '2mhz
    OSCCON = $60 '4mhz 'set int osc to 4mhz
    'OSCCON = $70 '8mhz

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,161


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    You can change READ-ONLY registers all you want. The PIC will just ignore your requests at best.

    Robert

  8. #8


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    As you can see, the 4MHZ is uncommented. If you convert the number to binary, it doesn't match the osccon bits in the datasheet when you select 4MHZ. Same with the reverse, select the 4MHZ bits in the datasheet, convert to decimal and it doesn't match the table. Yet, the numbers in the table do work.

    'osccon values for 16f818/819:
    'OSCCON = $00 'for 31.25 khz
    'OSCCON = $10 '125khz
    'OSCCON = $20 '250khz
    'OSCCON = $30 '500khz
    'OSCCON = $40 '1mhz
    'OSCCON = $50 '2mhz
    OSCCON = $60 '4mhz 'set int osc to 4mhz
    'OSCCON = $70 '8mhz

  9. #9
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    Quote Originally Posted by mackrackit View Post
    Bits 0 through 3 of OSCCON are read only?
    I'm curious what do you mean? Bits 0 to 3 set status bit, oscillator stability and mode select. Can't these be set at beginning of code?

  10. #10


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    Sorry Dave. I still don't get it. 60 on the table I use comes out to 0111100 in binary. Are we choosing the bits from left to right (MSB first) instead of right to left (LSB first)?

  11. #11
    Join Date
    Oct 2011
    Posts
    54


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    I think this is the problem
    You are reading $60 as decimal when it is a HEX number
    60 = 00111100 in binary
    $60 = 01100000 in binary

    Phil

  12. #12


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    Thank you Phil. Makes perfect sense now.

Similar Threads

  1. My project is starting
    By cncmachineguy in forum General
    Replies: 91
    Last Post: - 15th February 2011, 01:56
  2. Starting with PIC18F
    By Gérard in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th May 2006, 16:40
  3. Starting PC from PIC
    By Tissy in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 25th February 2006, 14:42
  4. Help starting a 876A
    By Naslund in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th March 2005, 09:25
  5. Help for someone just starting
    By Ed Cannady in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 30th March 2003, 11:17

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