Add Crystal Doesn't Work


+ Reply to Thread
Results 1 to 8 of 8

Thread: Add Crystal Doesn't Work23 days old

  1. #1
    Junior Member Abinz's Avatar
    Join Date
    Apr 2020
    Posts
    8
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Add Crystal Doesn't Work

    Hello,
    I am new member here.
    I need some info and help from you here.
    Yesterday I am trying to compiled my project, there is working good in compiled, but it doesn't working on proteus.
    Code:
    Device = 16F628A
    Config FOSC_HS, WDTE_OFF, PWRTE_OFF, MCLRE_ON, BOREN_OFF, LVP_OFF, CPD_OFF, CP_OFF
     'Xtal 4Mhz 
     'Xtal 4 
    'Config INTRC_OSC_CLKOUT, MCLRE_OFF, LVP_OFF, WDT_OFF, PWRTE_OFF, CP_OFF, BODEN_OFF    'Configuration of bits 
     'Config FOSC_XT, WDTE_OFF, PWRTE_OFF, MCLRE_ON, BOREN_OFF, LVP_OFF, CPD_OFF, CP_OFF    'Configuration of bits
    I use a external crystal 4Mhz then I adding of configuration are :
    Code:
    Device = 16F628A
    Config FOSC_XT, WDTE_OFF, PWRTE_OFF, MCLRE_ON, BOREN_OFF, LVP_OFF, CPD_OFF, CP_OFF    'Configuration of bits
    Xtal 4Mhz
    With above configuration that my code can compiled, but when i tested on proteus my character on LCD doesn't working properly, something like stuck can't continue to next process.

    Then I trying to disable my crystal into project page :
    Device = 16F628A
    Config FOSC_XT, WDTE_OFF, PWRTE_OFF, MCLRE_ON, BOREN_OFF, LVP_OFF, CPD_OFF, CP_OFF 'Configuration of bits, Osc External 4Mhz adn 'MCLRE is On pullup 10K of resistor
    'Xtal 4Mhz 'Disable for some reason.

    And it working normal.

    My question, what is wrong with my configuration bit, does it wrong fuse or ...?,.

    I hope someone here can describe me what happen and what should I do.


    Thanks,
    Abinz..

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,352
    Thumbs Up
    Received: 83
    Given: 183
    Total Downloaded
    5.30 GB

    0 Not allowed!

    Default Re: Add Crystal Doesn't Work

    Did you tell Proteus you were using a 4 MHz crystal?
    George.

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,582
    Thumbs Up
    Received: 337
    Given: 161
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: Add Crystal Doesn't Work

    When using the internal oscillator on the PIC device, you must still inform the compiler what speed it is running at with the Declare Xtal directive.

    Isis is not 100% guaranteed to work so when testing the main operation of a microcontroller always use a real device and flash an LED to make sure it is running. Then the program can go into a simulator for some testing of code operation.

    Serial text can be transmitted to a serial terminal to make sure the frequency of the microcontroller is OK. If the text is not correct at the Baud rate chosen, you know the frequency of the microcontroller is not correct.

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,884
    Thumbs Up
    Received: 91
    Given: 34
    Total Downloaded
    4.60 GB

    0 Not allowed!

    Default Re: Add Crystal Doesn't Work

    Abinz,
    Find "Declare xtal" in the manual.
    For a start you don't put MHz after it.
    John

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,352
    Thumbs Up
    Received: 83
    Given: 183
    Total Downloaded
    5.30 GB

    1 Not allowed!

    Default Re: Add Crystal Doesn't Work

    Proteus does not model the oscillator, it just uses whatever speed you enter into the properties for the PIC device in the field Processor Clock Frequency. It is obviously vital the the value you enter in that property value is the same as you have declared in "Declare Xtal".

    From memory if you use the old form of Xtal declaration ie "Xtal = 4" (without the text Declare) proteus will update the property correctly.
    George.

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #6
    Member keytapper's Avatar
    Join Date
    Jun 2019
    Posts
    192
    Thumbs Up
    Received: 8
    Given: 5
    Total Downloaded
    331.75 MB

    0 Not allowed!

    Default Re: Add Crystal Doesn't Work

    Quote Originally Posted by towlerg View Post
    if you use the old form of Xtal declaration ie "Xtal = 4" (without the text Declare) proteus will update the property correctly.
    Great tip George!!

  12. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  13. #7
    Junior Member Abinz's Avatar
    Join Date
    Apr 2020
    Posts
    8
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Re: Add Crystal Doesn't Work

    Dear All,
    Thank you so much for your advice and respond according my problem, I will note it for my reference.
    As I know that Proteus is not our measure that project work or not [I say here = Depends], once i recheck in this simulation on Proteus, adding a Crystal into page it will taken around 60 second and without Crystal will taken only 5 second.
    Code:
    '----------------------------------------------------------------- Added by Fuse Configurator ------------------------------------------
    'Use the Fuse Configurator plug-in to change these settings
    
    
    Device = 16F628A
         'xtal = 4 
         'Xtal 4 
    Declare Xtal = 4  
    
    
    'Config FOSC_HS, WDTE_OFF, PWRTE_OFF, MCLRE_ON, BOREN_OFF, LVP_OFF, CPD_OFF, CP_OFF
    'Config INTRC_OSC_CLKOUT, MCLRE_OFF, LVP_OFF, WDT_OFF, PWRTE_OFF, CP_OFF, BODEN_OFF    'Configuration of bits 
     Config FOSC_XT, WDTE_OFF, PWRTE_OFF, MCLRE_ON, BOREN_OFF, LVP_OFF, CPD_OFF, CP_OFF    'Configuration of bits
     
    
    
    '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ End of Fuse Configurator Settings ^^^^^^^^^^^^^^^^^^^^^^^^^^
    Finally I use this Declare Xtal = 4 .


    Thanks,
    Abinz..

  14. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  15. #8
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,352
    Thumbs Up
    Received: 83
    Given: 183
    Total Downloaded
    5.30 GB

    0 Not allowed!

    Default Re: Add Crystal Doesn't Work

    As I posted previously, if you use the format

    Declare Xtal = 4
    you will need to change the appropriate property in Proteus.
    George.

  16. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. PLL doesn't work with 18F2480
    By John Drew in forum Proton Plus Compiler v3
    Replies: 11
    Last Post: 12th August 2014, 15:10
  2. [SOLVED !] MCP2200 Doesn't work
    By Mario in forum The Lounge
    Replies: 5
    Last Post: 4th August 2010, 17:00
  3. 18F2550 doesn't work
    By Stijn in forum Proton Plus Compiler v3
    Replies: 9
    Last Post: 20th June 2010, 23:29
  4. 16F887 MSSP doesn't work!!! HELP
    By fgcity in forum Proton Plus Compiler v3
    Replies: 10
    Last Post: 30th January 2008, 07:24
  5. [SOLVED !] Basic SPI doesn't work
    By franco in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 24th April 2007, 07:08

Posting Permissions

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