View previous topic :: View next topic |
Author |
Message |
grasspuddle
Joined: 15 Jun 2006 Posts: 66
|
oscillator voltage |
Posted: Thu Mar 15, 2007 1:52 pm |
|
|
Anyone able to explain why my 10mhz oscillator drops from 2v to .4v after about 2/3 mins?
I am pretty sure it is the breadboard i'm using, but why? how?
fuses:
#fuses NOWDT,HS, NOPROTECT, NOOSCSEN, BROWNOUT, BORV20, PUT, STVREN, NODEBUG, NOLVP, NOWRT, NOWRTD, NOWRTB, NOWRTC, NOCPD, NOCPB, NOEBTR, NOEBTRB
#use delay(clock=10000000)
Code: |
void init(void)
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_wdt(WDT_OFF);
setup_timer_0(RTCC_INTERNAL);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
setup_low_volt_detect(FALSE);
setup_oscillator(False);
output_float(PIN_B2);
ext_int_edge(H_TO_L);
//enable_interrupts(INT_RDA);
//enable_interrupts(INT_EXT2);
//enable_interrupts(GLOBAL);
}
void main(void)
{
int j=0;
output_bit(PIN_D0,1);
output_bit(PIN_D1,1);
switch ( restart_cause() )
{
case WDT_TIMEOUT:
{
output_toggle(PIN_D0);
break;
}
case NORMAL_POWER_UP:
{
output_bit(PIN_D1,0);
break;
}
case MCLR_FROM_SLEEP:
{
//output_bit(PIN_D0,0);
break;
}
case BROWNOUT_RESTART:
{
//output_bit(PIN_D0,0);
break;
}
}
init();
while (1)
{
//output_toggle(PIN_D1);
delay_ms(200);
j++;
if (j>12)
{
//output_toggle(PIN_D1);
j=0;
}
}
}
|
|
|
|
Sherpa Doug Guest
|
|
Posted: Thu Mar 15, 2007 7:16 pm |
|
|
It might be a marginal oscillator design. Try changing the capacitors on the crystal a little. |
|
|
grasspuddle
Joined: 15 Jun 2006 Posts: 66
|
|
Posted: Fri Mar 16, 2007 7:56 am |
|
|
thanks for the reply,
.10uF caps keep the voltage up, but program still does not run. moving the project over solved the problem, but I still can't figure out why this new breadboard doesn't let the oscillator work. |
|
|
drh
Joined: 12 Jul 2004 Posts: 192 Location: Hemet, California USA
|
|
Posted: Fri Mar 16, 2007 8:00 am |
|
|
The capacitors should be in the 12pF to 22pF range. Thats pico farad, NOT micro (u) farad. _________________ David |
|
|
Ttelmah Guest
|
|
Posted: Fri Mar 16, 2007 8:15 am |
|
|
I think there is a problem in communication here.
The poster, talks about an 'oscillator', so people have (logically) assumed they are talking about the chip's oscillator. However the suspicion is that the question actually relates to the logic output pulses being developed by the code.
So the question is: what is the question?... Is this a question about the chip's oscillator, or about the pulse train (not oscillator), being developed by the code?.
Best Wishes |
|
|
grasspuddle
Joined: 15 Jun 2006 Posts: 66
|
|
Posted: Fri Mar 16, 2007 8:43 am |
|
|
Sorry for the confusion.
It is a pic18f452 so I am talking about the voltage out to the external xtal 10mhz oscillator.
The uF caps were put in because the smaller pico caps were not working, they were a temporary test and did seem to solve the voltage dropping after a time period, but did not solve the problem of the program. I thought that by making the voltage appear correctly that it would fix the rest of the problem, but it didn't.
The wiring works correctly on another breadboard, but the new breadboard is causing all this problem. My older breadboard works with no caps or the pico caps.
It is a 3pin 10.00M oscillator.
When running the LED that turns on after 'normal running' reset blinks on and off telling me that the pic is resetting?
The watchdog LED also resets, yet I have no WDT active... |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Fri Mar 16, 2007 9:00 am |
|
|
If it's a three pin device, it sounds like it's a resonator and should have the caps built into the device. If this is the case, you should not need external capacitors to make it run. |
|
|
Sherpa Doug Guest
|
|
Posted: Fri Mar 16, 2007 10:07 am |
|
|
Can you give us the manufacturer & part number of this "Oscillator", or better yet a link to the datasheet? |
|
|
Ttelmah Guest
|
|
Posted: Fri Mar 16, 2007 10:07 am |
|
|
It could be a resonator, or an external oscillator module.
If the latter, 'EC' would be the preferred fuse (draws slightly less power, turing off the internal oscillator amplifier).
At 10MHz, a 0.1MHz capacitor, gives an equivalent resistance of just on 6.3 ohms. This could easily damage the oscillator, and would certainly lead to the internal driver overloading....
Best Wishes |
|
|
grasspuddle
Joined: 15 Jun 2006 Posts: 66
|
|
Posted: Fri Mar 16, 2007 10:45 am |
|
|
It just has '10.00M' written on it telling me it must be 10mhz
The program wasn't running before the capacitor was added, and I just used it once to check the voltage levels.
Replacing the oscillator and pic would fix it if it was damaged? I changed out the osc and pic and have had no change.
I have a dale 10mhz xtal (2 pin) XT 49U, with 2 caps around 20 pF, same response as having the 10mhz 3 pin in.
And I say again, moving the exact components over to old boad, it works... move it back to new board... it behaves badly. |
|
|
kevcon
Joined: 21 Feb 2007 Posts: 142 Location: Michigan, USA
|
|
Posted: Fri Mar 16, 2007 11:42 am |
|
|
If it's the type of breadboard I'm thinking of, I seem to remember that they can have high capacitance between rows, which might be the source of your problem.
Check the data sheet for it to see what it is.
Try a lower speed oscillator/crystal. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Mar 16, 2007 11:54 am |
|
|
Anyone able to explain why my 10mhz oscillator drops from 2v to .4v after about 2/3 mins?
Your breadboard is probably missing the MCLR pull-up resistor
or the power supply is flaky. |
|
|
grasspuddle
Joined: 15 Jun 2006 Posts: 66
|
|
Posted: Fri Mar 16, 2007 12:01 pm |
|
|
The lowest I have is 8mhz, i'll try to find a slower one later. Under 4mhz good?
What kind of breadboard are you thinking of? Its 3M solderless breadboard
even found a picture:
http://www.mlecmn.net/~lyle/proto/LFproto.htm
2nd breadboard down, its the red one |
|
|
kevcon
Joined: 21 Feb 2007 Posts: 142 Location: Michigan, USA
|
|
Posted: Fri Mar 16, 2007 12:09 pm |
|
|
Yep those are the ones.
You could try an RC oscillator just for grins too. |
|
|
|