Let's Make Robots!

Conflict with PWM2 output and osc input (PIC)

this is some data i got from the datasheet of the 18f252:



Digital I/O. 

Timer1 oscillator input. 

Capture2 input, Compare2 output, PWM2 output. 



It is quite clear that the PWM2 output is clashing with the osc input. Can I still use this pin as a PWM output. ?




Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
You can use it as an oscillator input for Timer1 or a PWM output, but not both.
is there another place for osc input?
Do you need an oscillator input for Timer1? You still have Timer0, Timer2 and Timer3... plus Timer1 can be run off the internal oscillator anyway.
im not sure. but the whole thing does not work if i dont have the osc. Hmmmm. 

The PIC does not need the Timer1 oscillator to run. You only need to use that if you're synchronising Timer1 with a clock source other than the main clock the PIC itself is using.
This oscillator is not the same oscillator that the PIC processor itself runs off. If your code doesn't make use of Timer1 then you don't need to worry about the Timer1 module, you can just disable it.

PIC's are so damn confusing. but the 18f252 does not have an internal osc.

The PIC18F252 has no internal oscillator, you are correct there. However, the Timer1 oscillator has nothing to do with the primary oscillator.
The primary oscillator uses pins OSC1/CLKI and OSC2/CLKO/RA6, whereas the Timer1 oscillator uses pin RC0/TOSO/T1CKI, but it only uses that pin if you enable external clock source for Timer1.
but if i want to use pwm, i would need timer 1 right? all along i've been unsing the input for timer 1 and its working well. Without the osc nothing works. 

If you are using the actual PWM module you need Timer2, not Timer1.
When you say that nothing works without the oscillator, which oscillator are you talking about?

i mean the crystal (20mhz) that i've been connecting to timer 1 input/output. Where's timer 2's input/output?