PicBasic Pro 16F628A Clock speed help !


+ Reply to Thread
Results 1 to 11 of 11
  1. #1
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237

    Default PicBasic Pro 16F628A Clock speed help !

    Hi All

    Using PBP 2.50C

    Confused..... I am attempting to slow a 16F628A from the default 4Megs to 48K Clock Speed

    Am I right in assuming the Command :-

    PCON.3 = 0

    At beginning of code should do it....

    My code works fine at 4Megs and is not that complex... :-) Just drives a LCD and a few buttons.

    Any help welcome

  2. #2
    Join Date
    Oct 2004
    Posts
    448

    Default Re: PicBasic Pro 16F628A Clock speed help !

    Hi Andy,

    The 16F628A does not have a frequency multiplier; you can either use the internal osc at 4 Mhz, or an external crystal upto a maximum of 20 Mhz.

    Regards,

    Anand

    Oops, sorry read the 48 Khz as MHz
    Last edited by ardhuru; - 14th April 2014 at 16:13.

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,356

    Default Re: PicBasic Pro 16F628A Clock speed help !

    Hi,
    Yes, as far as I can see setting PCON.3=0 should switch from 4Mhz (default) to 48kHz.
    However, PBP doesn't have a suitable DEFINE OSC xx for that frequency so all software timed commands will be off by a factor of about 83 (if you're using the default DEFINE OSC 4), ie a PAUSE 10 will in reality be a PAUSE 830 and so on. This affects ALL selftimed commands, like PULSIN/OUT, SERIN/OUT, LCDOUT, PAUSE, PAUSEUS, PWM and so on.

    For LCDOUT perhaps you could try changing your data and command delays by a factor of ~80 and see what happens. I'm not saying it'll work but it's worth a try. If you have any PAUSE or PAUSEUS in your code then you'd need to scale those too obviously.

    /Henrik.

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,256

    Default Re: PicBasic Pro 16F628A Clock speed help !

    I'm curious why you would want to slow the PIC to 48 kHz. What requirement prevents you from running at 4 MHz?

    It might be easier to run everything at 4 MHz and tweak whatever specific logic you want to simulate 48 kHz.

    Robert

  5. #5
    Join Date
    Oct 2004
    Posts
    448

    Default Re: PicBasic Pro 16F628A Clock speed help !

    Battery conservation, perhaps?

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

    Default Re: PicBasic Pro 16F628A Clock speed help !

    Yes…. Am attempting to use a pic in field from solar sources… so saving power is a premium !!!

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

    Default Re: PicBasic Pro 16F628A Clock speed help !

    In Short ….

    It should work,,,?

    I understand Pause etc will be somewhat slower !

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

    Default Re: PicBasic Pro 16F628A Clock speed help !

    Thank you all for help !

    BR
    Andy

  9. #9
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    628

    Default Re: PicBasic Pro 16F628A Clock speed help !

    Quote Originally Posted by andybarrett1 View Post
    Yes…. Am attempting to use a pic in field from solar sources… so saving power is a premium !!!
    This is from the datasheet

    Standby Current:
    - 100 nA @ 2.0V, typical

    • Operating Current:
    - 12μA @ 32 kHz, 2.0V, typical
    - 120μA @ 1 MHz, 2.0V, typical
    You can put the chip in standby mode and wake the chip up when needed using interrupts.

    Robert
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

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

    Default Re: PicBasic Pro 16F628A Clock speed help !

    Quote Originally Posted by rsocor01 View Post
    This is from the datasheet



    You can put the chip in standby mode and wake the chip up when needed using interrupts.

    Robert
    I Never thought of interrupts.... Even Better!!!

    Thank you

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

    Default Re: PicBasic Pro 16F628A Clock speed help !

    Not interrupts but SLEEP or NAP. Interrupts keep the clock running but with SLEEP and NAP it all shuts down for a selectable period of time, wakes up, does its thing and goes back to sleep.

    The data sheet I saw said 1uA at 3.3V so you may get down that low if you work at it.

    It also looks like this chip has LED driver pins. Maybe you should look at a different chip for your more specific needs.

Similar Threads

  1. Picbasic pro speed issues?
    By CuriousOne in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th July 2013, 16:09
  2. Replies: 2
    Last Post: - 25th July 2012, 02:19
  3. Replies: 2
    Last Post: - 1st May 2009, 08:23
  4. LED CLOCK using 16F628A
    By bentech4u in forum mel PIC BASIC
    Replies: 7
    Last Post: - 4th November 2008, 21:27
  5. clock speed
    By Armando Herjim in forum General
    Replies: 1
    Last Post: - 30th November 2006, 12:25

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