4Mhz Circuit with a 20Mhz PIC


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1

    Default 4Mhz Circuit with a 20Mhz PIC

    Good day Picers!

    I have layout an easy LED blink circtuit at 4Mhz.
    I only have 20Mhz PICs, 1 x PIC16F877-20l/P and 2 x PIC16F877-20/P

    When I program the PIC16F877-20l/P @ 4Mhz it works fine, but when I program the PIC16F877-20/P it does not work and it's exactly the same circuit.

    Is there any setting to get this Pics working @ 4Mhz?


    Thank you!
    Koossa

  2. #2
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    I assume you have the following line at the top of your PBP program:

    DEFINE OSC 4

    Thats the only setting I can think of that you would need to worry about.

    What does happen? Does everything happen at the wrong speed, or does the PIC refuse to do anything at all?

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Here is my code, and nothing at all happen
    With the PIC16F877-20l/P it is working, but when I switch it with the PIC16F877-20/P it does not work.


    <code>
    &nbsp;&nbsp;Include "Modedefs.bas"

    &nbsp;&nbsp;DEFINE OSC 4 ' Set the Xtal frequency to 4mHz

    &nbsp;&nbsp;LEDPin VaR PORTC.2
    &nbsp;&nbsp;i var byte

    Main:
    &nbsp;&nbsp;for i = 1 to 10
    &nbsp;&nbsp;&nbsp;&nbsp;High LEDPin
    &nbsp;&nbsp;&nbsp;&nbsp;Pause 400
    &nbsp;&nbsp;&nbsp;&nbsp;Low LEDPin
    &nbsp;&nbsp;&nbsp;&nbsp;Pause 400
    &nbsp;&nbsp;next i
    end
    </code>

  4. #4
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Config bits?

    Hi,

    At 20 MHz I guess you use "HS" for 20 MHz but for 4 MHz "XT" would be a better choice.

    What do you clock it with? do you have a 4MHz x-tal or osc?

    /me

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Jumper

    Thank you very much for your feedback.
    I do have my Oscillator setting on "XT" and I'm using a 4Mhz X-tal.

    Koossa

  6. #6
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Default

    ... a long shot but try blinking RB0 instead of RC2 (and report back).
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

Similar Threads

  1. PIC backup power supply: switchover ???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 18th April 2008, 17:05
  2. Circuit Diagram for interfacing AC to PIC IC?
    By wellyboot in forum Schematics
    Replies: 3
    Last Post: - 8th March 2008, 19:40
  3. Pic driven digital audio delay
    By skimask in forum Off Topic
    Replies: 12
    Last Post: - 19th April 2007, 20:42
  4. Circuit needed to allow a PIC to turn something on or off
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th October 2005, 21:17
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

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