20MHz Oscillator not working correctly

Status
Not open for further replies.

imhereithink

New Member
Hey guys,

Just wandering if you can suggest what is going wrong with my oscillator. I am using this: https://www.electro-tech-online.com/custompdfs/2007/08/64649.pdf

I have previously used the 4MHz oscillator for the clock input of the PIC16F84a, im now using the 20MHz model and is wired up the same, i.e. 1: n/c 7:gnd 8: output 14: +5v

I have attached a snap shot of the output, and as you can see its not the best

Thanks in advance
 

Attachments

  • 20MHz clock.jpg
    43.5 KB · Views: 441
How did you check the oscillator with the test circuit given in the data sheet or from the PIC circuit?

Is your 4mhz is working correctly?
Best thing is to replace & see with another one.Are you sure that you working with a PIC16F84A not PIC16F84?
 
Thanks for the quick reply,

I checked the oscillator on the PIC circuit, not using the test circuit in the data sheet. And the 4MHz is working great giving a good solid output.

I meant to say that i am using the 20MHz on the 16F74 and not the 16F84a, since the 16F74 requires a 20MHz clock source, but have wired it up the same. I have already swapped it over for a new one, which does exectly the same

Iv attached a quick drawing of how i have connected the Oscillator.

Thanks again
 

Attachments

  • clock.JPG
    11.1 KB · Views: 347
I mean a PIC16F84 not 74.Why the PIC output wont give any results?When using the 20MHz the PIC runs five times faster than 4MHz codings.
Are you sure with your codings?
 

You don't show any decoupling capacitors?, presumably you have them?.

Also, why don't you just use a 20MHz crystal instead of a module?.
 
Yes i do have a 0.1uF cap accross +vs and ground, forgot to add it onto the drawing

Im using the module because it is what i had available and have used before in other projects. Do you think the crystal would be better than the module?

Thanks
 
eng1 said:
I suspect that you didn't select the HS oscillator in the config fuses!

You don't, you select external oscillator - although it's possible he's not selected that correctly?.

imhereithink: - try unplugging the PIC and scoping the oscillator, it may be that you have the fuses set wrong and it's loading the oscillator?.
 
? You select the external oscillator in the High Speed mode: _HS_OSC if you use the config labels.
 

Standard crystal 20MHz is ideal for many Timing applications.I have being using for many circuits.also power consumption is mucher than a standard crystal in a mudule isn't it?
 
eng1 said:
? You select the external oscillator in the High Speed mode: _HS_OSC if you use the config labels.

Sorry, just checked the datasheet for the 16F74, and it doesn't have an 'external oscillator' option, like you said it says to set to HS.
 
sorry for the confusion guys, i am currently using the 16F74. I was making reference to the 16F84a because i got the 4MHz oscillator to work on that.

Its the 20MHz oscillator on the 16F74 that i cannot get to work properly, here is the config_word i am using:

__config 0x3F10
;Configuration bits set as: Oscillator EXTERNAL 20MHz
; Watchdog Timer OFF
; Power-up Timer ON
; Code Protect OFF
Brown-out Detect OFF
; Master Clear Enable OFF
; Low Volatge Program OFF
; Data EE Read Protect OFF Code Protect OFF

Nigel i tried it without the PIC in place and still get the same reading
 
The frequency looks good, and that's what high frequency looks like with an uncontrolled impedance. So how long is the trace? Where is the nearest ground? Is this on a two layer board or a four layer board? Is your scope probe calibrated at 20 MHz.

Hint: Turn on the bandwidth limit switch. It always makes high frequency signals look a whole lot better. Seriously you may be in a panic over nothing.
 
Papabravo said:
Hint: Turn on the bandwidth limit switch. It always makes high frequency signals look a whole lot better. Seriously you may be in a panic over nothing.

Thanks for the hint, i switched the bandwidth from full to 20MHz, and now im getting a smooth sine wave, is this correct? AFAIK it was supposed to be a sqaure wave output. Sorry for the silly question
 
It doesn't matter which PIC you're using, with a 20 MHz oscillator you have to select the High Speed mode. Your configuration word seems wrong to me, you select the LP oscillator. Try with 0x3FB2.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…