logo elektroda
logo elektroda
X
logo elektroda

Using 2.9375MHz, 3.2768MHz, 6.144MHz Crystals With PIC Microcontrollers?

267 10
Best answers LABEL_AI_GENERATED

Can I use 2.9375 MHz, 3.2768 MHz, or 6.144 MHz crystals with a PIC microcontroller, and how do I set the firmware for them?

Yes—PIC microcontrollers can use non-integer crystal frequencies like 2.9375 MHz, 3.2768 MHz, and 6.144 MHz as long as the crystal is within the PIC’s allowed minimum and maximum oscillator frequency range [#21683600][#21683602] 3.2768 MHz and 6.144 MHz are common because they make it easier to derive useful frequencies such as UART baud rates, while 2.9375 MHz is unusual but should still work if the MCU supports it [#21683600][#21683601][#21683604] When you build the firmware, specify the oscillator frequency in the source code and also in the utility used to program the HEX file into the PIC [#21683602] If you need very precise baud rates or timing, an unusual crystal frequency can make that harder [#21683601] Many PICs can also run from an RC network or their internal clock instead of an external crystal [#21683602]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT
  • #1 21683599
    John Curtin
    Anonymous  
  • ADVERTISEMENT
  • #2 21683600
    PeterTraneus Anderson
    Anonymous  
  • ADVERTISEMENT
  • #3 21683601
    David Ashton
    Anonymous  
  • ADVERTISEMENT
  • Use matching crystal frequency in firmware settings

    #4 21683602
    Giovanni Di Maria
    Anonymous  
  • ADVERTISEMENT
  • #5 21683603
    coolan cop
    Anonymous  
  • Custom crystal chosen to simplify baud-rate division

    #6 21683604
    PeterTraneus Anderson
    Anonymous  
  • #7 21683605
    ravi veeramalla
    Anonymous  
  • #8 21683606
    kuk couin
    Anonymous  
  • #9 21683607
    David Ashton
    Anonymous  
  • #10 21683608
    Thomas Boyce
    Anonymous  
  • #11 21683609
    Thomas Boyce
    Anonymous  

Topic summary

LABEL_AI_GENERATED
Crystals with non-integer frequencies such as 2.9375 MHz, 3.2768 MHz, and 6.144 MHz can be used with PIC microcontrollers provided their frequencies fall within the MCU's specified minimum and maximum crystal frequency range. These non-standard frequencies are often chosen to facilitate specific application requirements, such as generating precise baud rates for serial communication. For example, 3.2768 MHz is derived from 100 times 32.768 kHz, and 6.144 MHz can be divided to produce standard RS-232 baud rates. When programming firmware, it is essential to specify the exact crystal frequency in both the source code and the programming utility to ensure correct timing. Some PIC microcontrollers also support internal RC oscillators or can operate with RC networks instead of crystals. Overclocking beyond the maximum rated frequency is possible but not recommended for production. The choice of crystal frequency impacts timing accuracy and baud rate generation, especially in applications requiring precise serial communication.
AI summary based on the discussion. May contain errors.
ADVERTISEMENT