16F628A and 37 KHZ internal clock


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2006
    Location
    Brasil, Sao Paulo, Campinas
    Posts
    54

    Default 16F628A and 37 KHZ internal clock

    Hi All,

    I would like to use a 37 KHZ internal clock mode with 16F628A. I never user it internal clock option, just 4 MHZ.
    Anybody know how to do it with PBP?
    I know that by default the compiler uses 4MHZ, but I can't to use it. I need 37KHZ but my problem is that I also need to put a LCD in my project and I don't know how to ajust the timming to the commands. Maybe a DEFINE 37, or something ???

    Thanks

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,516


    Did you find this post helpful? Yes | No

    Default Re: 16F628A and 37 KHZ internal clock

    Hi,
    * There is no internal 37kHz mode on the 628A. It's either 4MHz or 48kHz.
    * You can RUN the PIC at 48kHz.
    * You can NOT make PBP aware of it - ie. no DEFINE OSC for such low frequency.

    Why do you NEED to run it at such slow speed? Power?

    If so then one or more of these ideas might be worth to consider:
    * There are modern parts with lower current consumption.
    * Use the switchable oscillator and run it at 4MHz when needed, switch it back to 48kHz when you don't.
    * Use the sleep feature and wake the PIC up when needed.

    /Henrik.

  3. #3
    Join Date
    Dec 2006
    Location
    Brasil, Sao Paulo, Campinas
    Posts
    54


    Did you find this post helpful? Yes | No

    Default Re: 16F628A and 37 KHZ internal clock

    Hi Henrik

    I am trying to help a friend who built an air band receiver but he's having trouble in a certain frequency approach, 120.00 MHZ, because there is a noise that he believes happen to be multiple of 4 MHz, which is crystal value it are using today with a 16F84A mcu. I found the information in the datasheet of 16F628A (page 97) on two options for internal clock, 4 MHz and 37 KHz. I got to work with 37 KHZ doing PCON.3 register = 0.
    However, latency commands such as PAUSE, SEROUT / SERIN, are compromised.
    The idea is to make the mcu control a PLL, the MB1501, so I think the problem of latency should not influence much.
    I appreciate your feedback and suggestions.

    Pimentel

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


    Did you find this post helpful? Yes | No

    Default Re: 16F628A and 37 KHZ internal clock

    120 mhz is high enough to have several frequencies of which a harmonic will be 120 mhz. I would recommend putting the PIC and it's crystal in a shielded box and have feed through caps for power and I/O. Also filter the power in with a choke.
    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.

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,516


    Did you find this post helpful? Yes | No

    Default Re: 16F628A and 37 KHZ internal clock

    Hi,
    I found the information in the datasheet of 16F628A (page 97) on two options for internal clock, 4 MHz and 37 KHz. I got to work with 37 KHZ doing PCON.3 register = 0.
    Then it's got to be a typo in the datasheet, either yours or mine because it does say 48kHz where I look:

    A software programmable dual-speed oscillator mode
    is provided when the PIC16F627A/628A/648A is
    configured in the INTOSC oscillator mode. This feature
    allows users to dynamically toggle the oscillator speed
    between 4 MHz and 48 kHz nominal in the INTOSC
    mode.
    Make sure you always download your datasheets directly from Microchip as they will always have the latest versions.

    /Henrik.

  6. #6
    Join Date
    Dec 2006
    Location
    Brasil, Sao Paulo, Campinas
    Posts
    54


    Did you find this post helpful? Yes | No

    Default Re: 16F628A and 37 KHZ internal clock

    Look Henrik,
    14.3 Special Feature: Dual Speed
    Oscillator Modes
    A software programmable Dual Speed Oscillator mode
    is provided when the PIC16F62X is configured in either
    ER or INTRC Oscillator modes. This feature allows
    users to dynamically toggle the oscillator speed
    between 4 MHz and 37 kHz. In ER mode, the 4 MHz
    setting will vary depending on the value of the external
    resistor. Also in ER mode, the 37 kHz operation is fixed
    and does not vary with resistor value. Applications that
    require low current power savings, but cannot tolerate
    putting the part into SLEEP, may use this mode.
    The OSCF bit in the PCON register is used to control
    Dual Speed mode. See Section 3.2.2.6, Register 3-4.

    And Archangel, I will test it, thanks!

  7. #7
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,516


    Did you find this post helpful? Yes | No

    Default Re: 16F628A and 37 KHZ internal clock

    Hi,
    But that's the thing. You're quoting "the same" paragraph of the datasheet as I was but in "your" datasheet it says 37kHz, while in "mine" it says 48kHz. One of them is wrong or they've changed the silicon (unlikely). I'm not saying mine's correct and your's wrong (actually perhaps I am....) just that there is an inconsistency and that the 37kHz you might think you're running at might not be 37kHz.

    The one I'm reading is called DS40044F and is dated 2007. Is it possible that you're looking at either an old version (prior to revision C is my guess) of the datasheet OR perhaps a version for the 16F628 (non A version?)

    Anyway, good luck with the project!

    /Henrik.

  8. #8
    Join Date
    Dec 2006
    Location
    Brasil, Sao Paulo, Campinas
    Posts
    54


    Did you find this post helpful? Yes | No

    Default Re: 16F628A and 37 KHZ internal clock

    Hi Henrik,

    Thanks for your help.
    I solved the problem using internal OSC config ( the noise finished using 37/48KHZ or 4 MHZ).
    I don't remember where I downloaded the datasheet, but I perceved that was very slow speed. Maybe was 16f628 as you said.
    Thank you again my friend.

  9. #9
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,611


    Did you find this post helpful? Yes | No

    Default Re: 16F628A and 37 KHZ internal clock

    The truth ...

    37 khz is for 16F628
    48 khz is for 16F628 A ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  10. #10
    MarshRu's Avatar
    MarshRu Guest


    Did you find this post helpful? Yes | No

    Default Re: 16F628A and 37 KHZ internal clock

    Actually as per my experience with it a software programmable Dual Speed Oscillator mode is provided when the PIC16F62X is configured in either ER or INTRC Oscillator modes. This feature allows users to dynamically toggle the oscillator speed between 4 MHz and 37 kHz. In ER mode, the 4 MHz setting will vary depending on the value of the external
    resistor.
    And in ER mode, the 37 kHz operation is fixed and does not vary with resistor value. Applications that require low current power savings, but cannot tolerate
    putting the part into SLEEP, may use this mode.

Similar Threads

  1. Configure Internal Oscillator 16F628A
    By scasale in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 27th February 2012, 07:11
  2. LED CLOCK using 16F628A
    By bentech4u in forum mel PIC BASIC
    Replies: 7
    Last Post: - 4th November 2008, 22:27
  3. external clock / internal clock
    By grounded in forum General
    Replies: 4
    Last Post: - 31st May 2008, 18:44
  4. counter/ internal clock
    By jimbobjones in forum General
    Replies: 10
    Last Post: - 30th April 2007, 14:28
  5. 16F628 Internal clock
    By srob in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th February 2007, 19:46

Members who have read this thread : 1

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