CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

oscillator voltage

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
grasspuddle



Joined: 15 Jun 2006
Posts: 66

View user's profile Send private message

oscillator voltage
PostPosted: Thu Mar 15, 2007 1:52 pm     Reply with quote

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







PostPosted: Thu Mar 15, 2007 7:16 pm     Reply with quote

It might be a marginal oscillator design. Try changing the capacitors on the crystal a little.
grasspuddle



Joined: 15 Jun 2006
Posts: 66

View user's profile Send private message

PostPosted: Fri Mar 16, 2007 7:56 am     Reply with quote

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: 193
Location: Hemet, California USA

View user's profile Send private message

PostPosted: Fri Mar 16, 2007 8:00 am     Reply with quote

Quote:
.10uF caps

The capacitors should be in the 12pF to 22pF range. Thats pico farad, NOT micro (u) farad.
_________________
David
Ttelmah
Guest







PostPosted: Fri Mar 16, 2007 8:15 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 16, 2007 8:43 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 16, 2007 9:00 am     Reply with quote

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







PostPosted: Fri Mar 16, 2007 10:07 am     Reply with quote

Can you give us the manufacturer & part number of this "Oscillator", or better yet a link to the datasheet?
Ttelmah
Guest







PostPosted: Fri Mar 16, 2007 10:07 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 16, 2007 10:45 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 16, 2007 11:42 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 16, 2007 11:54 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 16, 2007 12:01 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 16, 2007 12:09 pm     Reply with quote

Yep those are the ones.

You could try an RC oscillator just for grins too.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group