View previous topic :: View next topic |
Author |
Message |
paolope
Joined: 29 May 2009 Posts: 7
|
18f26k80 oscillator |
Posted: Thu Feb 16, 2012 3:42 am |
|
|
hello,
whatever I do, the chip runs at about 7.97Mhz (internal RC)
I tried with #use delay (crystal=6.144M)
I tried with #fuses HSM or even HSH.
Any idea?
I feel very stupid and frustrated. In this condition the 4xPLL option is far away.
Paolo |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Thu Feb 16, 2012 6:49 am |
|
|
It would help to see what you have so far. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
paolope
Joined: 29 May 2009 Posts: 7
|
|
Posted: Thu Feb 16, 2012 8:40 am |
|
|
Here is adc.h:
Code: |
#include <18f26k80.h>
#device icd=true
#device *=16
#device adc=16
#FUSES SOSC_DIG,HSM,PUT// PC0 PC1 I/O,MEDIUM PWR OSC
#use delay(crystal=6.144M)
|
nothing else |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Thu Feb 16, 2012 9:39 am |
|
|
Where is your crystal connected?. OSC1/2, or SOSCI/O?. You are enabling the secondary oscillator as the clock source. Unless your crystal is on the secondary pins, it won't run, so the system will drop back to the internal oscillator. Given you are talking about wanting to use the PLL (which is only available on the primary oscillator), I'd guess your crystal is on the primary pins.
Remember fuses 'or' together, so the '00' pattern selected by HSM or H to use the primary oscillator, 'ored' with SOSC_DIG, gives the pattern for SOSC_DIG....
HSM, PLLEN, NOFCMEN, NOIESO, PUT
#use delay(crystal=6.144M, clock=24.576M)
Best Wishes |
|
|
paolope
Joined: 29 May 2009 Posts: 7
|
|
Posted: Thu Feb 16, 2012 10:43 am |
|
|
Mr Murphy states that 'things left alone go from bad to worse'...
in effect NOIESO crashes the debugger-ICDU64 which is then not able to control the PIC, so nothing new happens |
|
|
|