I have searched the whole datasheet, but couldn't find where are the OSC1 and OSC2 pins are. I've found the CLKOUT (which is CMOS output) on RA4 and CLKIN (which is TTL input) on RA5. But I need the XTAL input/output pins.

I tried connecting my 4 MHz crystal to these CLKOUT & CLKIN with two 22 pF capacitors connected to GND, but it's not working.

I need to use UART on this microcontroller, that's why I need external crystal oscillators.

Please suggest some solution.enter image description here

enter image description here

  • \$\begingroup\$ Reading the datasheet, it seems to me that PIC12LF1572 doesn't allow an external crystal, just an external clock signal, CLKIN. \$\endgroup\$ – Roger Rowland Feb 15 '16 at 12:54
  • \$\begingroup\$ The writers of the datasheet seem to be a bit confused on that point. The text says that a crystal is an option, but there doesn't seem to be any way to configure it for that and the block diagram of the clock module doesn't show it. \$\endgroup\$ – brhans Feb 15 '16 at 12:55
  • \$\begingroup\$ I guess you are right. In the PIC12(L)F1571/2 PINOUT DESCRIPTION table, in the bottom it writes "XTAL = Crystal", but there seems to be no XTAL pin described. So, how do use UART here? \$\endgroup\$ – Ashish Ranjan Feb 15 '16 at 13:00
  • \$\begingroup\$ If the internal oscillator isn't good enough, maybe use an external oscillator module, connected to CLKIN (RA5). However, the HFINTOSC should be good up to 16MHz. \$\endgroup\$ – Roger Rowland Feb 15 '16 at 13:07

It only has a CLKIN pin.

Either use the internal oscillator, or try this crystal oscillator to CLKIN pin: Crystal oscillator

  • \$\begingroup\$ How can you generate a frequency greater than internal oscillator using this circuit?.Atleast near to the frequency of internal oscillator? \$\endgroup\$ – Aadarsh Feb 15 '16 at 13:37
  • \$\begingroup\$ The frequency of this circuit is set by selecting the crystal for the frequency that you need. \$\endgroup\$ – user1582568 Feb 15 '16 at 13:53
  • \$\begingroup\$ But this is not the exact substitute for external oscillator.This clock doesn't be used by the processor unit.This frequency is just like clock input,not the external oscillator.In datasheet,in the pin description,I can't see any term XTAL used related with pins.however they gave the abbreviation that XTAL-crystal oscillator.Did you notice the architecture of that chip.This CLKIN is just goes to CPU and get processed out.This clock signal is not used by the CPU to run entire processor.I mean,this clock signal is not used to increment the Program counter,ALU etc.That is governed by internal clk \$\endgroup\$ – Aadarsh Feb 15 '16 at 18:55

Much of these datasheets are cut-and-paste, as the people responsible for creating them don't feel like typing everything. Since most of the data is the same as other similar micros, they just copy the test from their datasheets and paste it in the datasheet for this part. It looks like the PIC12LF1572 doesn't have external crystal connections, and the text describing the crystal connections was simply copied from the datasheet of a similar part and was not removed. You might look at the errata sheet for this micro, perhaps it was discovered and listed.

  • 1
    \$\begingroup\$ I don't see anywhere in the data sheet that it states that a crystal can be used directly with this micro. It says an external oscillator can be used, which may be a crystal oscillator. This is fed into the CLKIN pin. \$\endgroup\$ – user1582568 Feb 15 '16 at 13:52
  • \$\begingroup\$ @user1582568 Ahh, good point! I didn't bother reading the datasheet, I left that to the OP. Thanks for clarifying. \$\endgroup\$ – DerStrom8 Feb 15 '16 at 13:57

For most of the 8 pin microcontroller,there won't be any external oscillator option give(not all MCU,some may have external).This that when you use 2 pins for oscillator,2 pins for power supply and 1 for reset,then you left with only 3 pins.This wont be sufficient to use.

    In your MCU,it seems that there is no option for external clock crystal to be connected.The CLKIN is the timer input and it's not for external oscillator pin
    From the Architecture of this chip,I notice that the timer uses the internal clock crystal to count and output the timer sequenced output and not that the pin CLKIN is said to act as external clock.If so,you need 2 pins and they gave you only one pin for CLKIN.
    So don't confuse with timer input pin and the external clock oscillator pin.There is a huge variation between those two.
      If you want to program that PIC chip,use PIC KIT2 or something like that.They also gave option for ESUART for UART type of communication.Internal crystal may not be more accurate than external,but in such case,you have to rely on internal clock crystal only.No other go.
    That's how they designed.We can't change the die structure of that chip to function as external oscillator pin.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.