PIC – Troubleshooting 4-SMD Crystal with PIC16F1575

crystalmicrochippic

I'm trying to work with 32Mhz 4-SMD Crystal. (ASX3F-32M-FA100A4) with two capacitors: 10 pF (attached datasheet)
The IC I choosed is the PIC16f1575. And using MPLABX-IDE MCC
I performed the connection as in the pictures below.

When I select INTOSC in MCC everythings works fine, but if I change the selection INTOSC to ECH in MCC as at the picture below the IC doesnt work.

It only LED blink code in main loop.

void main(void){
    SYSTEM_Initialize();
    INTCONbits.GIE = 1;INTCONbits.PEIE = 1;
    while (1)
    {
        LED_Toggle();
        __delay_ms(500);
    }
}
  1. Is there a wrong connection between pic and crystal?

  2. Is that crystal not suited for this usage?

  3. Something missing on the code?

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Rest of the configuration Code:

// CONFIG1
#pragma config FOSC = ECH // Oscillator Selection Bits->ECH, External Clock, High Power Mode (4-32 MHz); device clock supplied to CLKIN pin
#pragma config WDTE = OFF // Watchdog Timer Enable->WDT disabled
#pragma config PWRTE = OFF // Power-up Timer Enable->PWRT disabled
#pragma config MCLRE = ON // MCLR Pin Function Select->MCLR/VPP pin function is MCLR
#pragma config CP = ON // Flash Program Memory Code Protection->Program memory code protection is enabled
#pragma config BOREN = ON // Brown-out Reset Enable->Brown-out Reset enabled
#pragma config CLKOUTEN = ON // Clock Out Enable->CLKOUT function is enabled on the CLKOUT pin
// CONFIG2
#pragma config WRT = OFF // Flash Memory Self-Write Protection->Write protection off
#pragma config PPS1WAY = ON // PPSLOCK bit One-Way Set Enable bit->PPSLOCKED Bit Can Be Cleared & Set Once
#pragma config PLLEN = OFF // PLL Enable->4x PLL disabled
#pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable->Stack Overflow or Underflow will cause a Reset
#pragma config BORV = LO // Brown-out Reset Voltage Selection->Brown-out Reset Voltage (Vbor), low trip point selected.
#pragma config LPBOREN = OFF // Low Power Brown-out Reset enable bit->LPBOR is disabled
#pragma config LVP = OFF // Low-Voltage Programming Enable->High-voltage on MCLR/VPP must be used for programming

And Initialization;

void OSCILLATOR_Initialize(void)
{
    // SCS FOSC; SPLLEN disabled; IRCF 8MHz_HF;
    OSCCON = 0x70;
    // TUN 0;
    OSCTUNE = 0x00;
    // SBOREN disabled; BORFS disabled;
    BORCON = 0x00;
}

Best Answer

From Microchip:

The External Clock (EC) mode allows an externally generated logic level signal to be the system clock source. When operating in this mode, an external clock source is connected to the CLKIN input. CLKOUT is available for general purpose I/O or CLKOUT. Figure 5-2 shows the pin connections for EC mode

enter image description here

This chip is not designed with an internal clock source from an RC oscillator. But it has no oscillator to run a crystal. If you want an external 32MHz clock source, you need to generate it and then apply it to the chip.