Menu

12Mhz crystal change

Anonymous
2019-02-02
2019-02-04
  • Anonymous

    Anonymous - 2019-02-02

    Hi Alberto,
    I have built your programmer and the AVR extender and everything works fine....Thanks and congratulations for this very nice project.

    I would have a question:
    1) How could I change the 12 Mhz crystal to a 16 or 20Mhz crystal ?
    You are saying in the component list that:
    '' U1 12Mhz quartz (also 4, 8, 16, 20; reconfiguration of input divider options is required)''
    When you are saying that reconfiguration of input divider options is required, are you talking about the input voltage divider R1(22K) and R2(12K) resistors? If so, how could someone calculate the divider for a 16 or 20 Mhz?

    Thanks and Best Regards

    Roger

     
  • Anonymous

    Anonymous - 2019-02-03

    Hi Alberto,

    Forget about my silly question....I was able to make it work at 16Mhz with with my JDM at input divider (/4).

    Thanks

     
  • Alberto Maccioni

    In the selected configuration the main clock comes from a 96MHz PLL which requires a 4MHz reference. The oscillator feeds the PLL through a divider (see the device spec for reference), so you have to adapt the division in order to produce 4 MHz.
    This is done by using bits PLLDIV[2:0] in CONFIG1L.
    The current value of CONFIG1L is 0x22, so the PLL prescaler divides by 3, in line with the suggested 12MHz crystal.
    Using other frequencies requires changing PLLDIV in CONFIG1L, and fortunately just one line in the hex file (towards the end):
    :0100000022DD
    The new value of CONFIG1L should replace "22", then a new checksum can be calculated, for example using the "utility" tab in opgui.
    Here the final result for all possibilities:
    Fosc PLLDIV CONFIG1L Hex line
    4MHz 0 0x20 :0100000020DF
    8MHz 0 0x21 :0100000021DE
    12MHz 0 0x22 :0100000022DD
    16MHz 0 0x23 :0100000023DC
    20MHz 0 0x24 :0100000024DB
    24MHz 0 0x25 :0100000025DA
    40MHz 0 0x26 :0100000026D9
    48MHz 0 0x27 :0100000027D8
    In reality the internal oscillator can only work up to 20MHz, higher values require an external oscillator.
    Also note that the capacitors applied to OSC1-2 require a different value for different frequency ranges; it's all described in the datasheet, I copy the table here for convenience:
    For ceramic resonators:
    4MHz 33pF
    8MHz 27pF
    16MHz 22pF
    For crystals:
    4MHz 27pF
    8MHz 22pF
    20MHz 15pF

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.