16f818 from 16f628a


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: 16f818 from 16f628a

    Hi,
    There are 628's available that are specified to run at 20MHz - i used one this weekend.
    With that said, your config for the 818 says INTRC which means you're running from the internal oscillator. Looking at the oscillator section of the datasheet it's clear that the internal oscillator defaults to 31.25kHz while you're telling the compiler that your chip is running at 8MHz - which it isn't. I notice this:
    Code:
    DEFINE OSC 8    'Set oscillator in MHz
    Please note that DEFINE OSC xxx does not SET the oscillator speed in any way. What it does is inform the compiler at which speed you intend to run the PIC so that it can calculate the proper delays etc. In this case you're telling the compiler that the PIC is operating at 8MHz when in fact it's operating at 31.25kHz. Your one second pause becomes a 256 second pause. I think that if you leave the circuit powered up long enough you will see the LED blink.

    /Henrik.

    EDIT: Add OSCCON = 112 to set the oscillator to 8MHz.
    EDIT2: As far as I can see all 16F628A's are specified to run at 20MHz.
    Last edited by HenrikOlsson; - 25th August 2014 at 13:35.

  2. #2
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: 16f818 from 16f628a

    Quote Originally Posted by HenrikOlsson View Post
    EDIT: Add OSCCON = 112 to set the oscillator to 8MHz.
    EDIT2: As far as I can see all 16F628A's are specified to run at 20MHz.
    Ahhhhhh…. I am hoping this maybe the answer …. Will try this later.

    Will let you know if it works.

    Am trying to get stuff going using internal RC clock…. Then can do drop in upgrade !

    TY

    Andy

  3. #3
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: 16f818 from 16f628a

    Yes ….

    Was the clock misunderstand on my part!

    Thank you for pointers and help

    Andy

Similar Threads

  1. Interface for 16f818
    By davekav in forum Serial
    Replies: 4
    Last Post: - 17th April 2008, 11:33
  2. 3.3V not working with 16f818
    By jjohannson in forum General
    Replies: 3
    Last Post: - 8th March 2007, 20:53
  3. ERROR Compling 16F819...l but the 16F818 works fine
    By 4Lewis in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 21st April 2006, 06:47
  4. 16F818 ADCON question
    By peterdeco1 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 1st February 2006, 10:50
  5. .inc & .bas for 16f818 12fxx
    By a.majid in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 23rd March 2005, 06:49

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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