Crystal oscillator clarification

Status
Not open for further replies.

electronicsman

Full Member level 5
Joined
May 4, 2012
Messages
291
Helped
11
Reputation
22
Reaction score
12
Trophy points
1,298
Activity points
3,737
I have a 8Mhz crystal given to inputs osc1 and osc2 as per the data sheet. I have configured in primary oscillator with XT mode. My issue is I am not getting Crystal output. Main questions regarding this are
a. Based upon the number of ICs on the board or large schematic will there be any load on the crystal?
b. In case if my crystal is not working can i still program the device using Pickit. So, that i can conclude that there is some mistake in my program.

I am sorry if i am not providing all the details. Right now i don't have access to the schematics. Please help. The micro is dspic33e family.
 

a. The crystal should only be connected to the dsPIC pins and loading capacitors, it you are also driving other circuits from the crystal connections the answer would depend on what those circuits are. It isn't recommended that you connect anything else to the dsPIC oscillator pins.

b. The oscillator does not run during programming. You can program the dsPIC with nothing at all connected to it except the Pickit.

Be careful how you check the oscillator is running, it is a fairly low power circuit and connecting an oscilloscope or frequency counter to the pins may be enough to stop it running. A better check is to load a simple program to toggle a pin and see if it runs.

Brian.
 
I am very confused with the OSC2 pin

OSCIOFNC: OSC2 Pin Function bit (except in XT and HS modes):
• 1 = OSC2 is the clock output, and the instruction cycle (FCY) clock is output on the OCS2
pin (see Figure 7-6)
• 0 = OSC2 is a general purpose digital I/O pin (see Figure 7-7)


The above statements as per the data sheet. I have configured in XT mode. Then how should i configure OSC2 as digital? What is the difference if I configure as digital or clock output? Please help.
 

Attachments

  • osc.pdf
    301.9 KB · Views: 64

Hi,

as far as I understand the datasheet: in XT (and HS) mode there is no need to worry about pin function. It is fixed set as oscillator pin and can not be altered.

Klaus
 

Thank you for the reply. But could you please tell me the difference between oscillator pin and digital pin what difference does it make to the functionality. How the crystal oscillator functionality would change? Thanks in advance.
 

Hi,

Again: in XT mode it can not be altered. Your question is useless.

Klaus
 

No why i am asking is there is a peculiar situation. Initially on power on i am starting with internal Fast RC then i am doing a clock switching to the XT mode, then do i need to initialize this pin or not?
 

I can't be certain but I would guess switching to XT mode would automatically configure the pins as oscillator input and output as there is no mention in the data sheet of having to do it in code. With a crystal connected to it in XT mode, the pins would not function as normal input or output pins anyway.

Brian.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…