blinking problem with PIC16f887


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    The PBP default config settings for this PIC are;
    device pic16F887, intrc_osc_noclkout, wdt_on, mclr_on, lvp_off, protect_off

    So, it's actually running on the internal oscillator.

    And the PIC default setting of OSCCAL (for the internal oscillator) is for 4MHz.

    Define OSC 20 forces PBP tro assume it's running at 20MHz, but its actually running on
    the 4MHz internal osc, so Define OSC 20 screws the timing .. when it's running at 4MHz.

    For it to work as expected, at 20MHz, you would need to connect an external 20MHz
    crystal (or resonator), and change config settings to;

    device pic16F887, hs_osc, wdt_on, mclr_on, lvp_off, protect_off.

    Then use the DEFINE OSC 20.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bruce View Post
    The PBP default config settings for this PIC are;
    device pic16F887, intrc_osc_noclkout, wdt_on, mclr_on, lvp_off, protect_off

    So, it's actually running on the internal oscillator.

    And the PIC default setting of OSCCAL (for the internal oscillator) is for 4MHz.

    Define OSC 20 forces PBP tro assume it's running at 20MHz, but its actually running on
    the 4MHz internal osc, so Define OSC 20 screws the timing .. when it's running at 4MHz.

    For it to work as expected, at 20MHz, you would need to connect an external 20MHz
    crystal (or resonator), and change config settings to;

    device pic16F887, hs_osc, wdt_on, mclr_on, lvp_off, protect_off.

    Then use the DEFINE OSC 20.
    See Bruce,
    We need your book
    Can I get that on Amazon ?
    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. Blinking an led problem on P16F84
    By aimenbukharie in forum General
    Replies: 1
    Last Post: - 20th March 2009, 05:00
  2. PIC16F887 Config problem
    By Agent36 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 13th November 2008, 22:38
  3. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  4. 7-segment display blinking problem?
    By serdar_ozcan in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th March 2006, 14:43
  5. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 22:59

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