I'm just starting a small project using a 12F675 and would like to use Timer1 to time the PWM signal going to a remote controlled servo. The typical 1ms to 2ms pulse with 1.5ms being centred. I've done a few small projects but I've never used Timer1 before. Looks like I sould feed the signal in on GP4/T1G(not) to be the gate. I plan on using a 4Mhz clock. When using this input as a gate can it still be read as an input? I'm trying to figure out how to tell when to read the counter and clear it for the next pulse. Do I need to tie it to another input pin and use that pin to tell if the pulse has ended or not? Thanks, Max |
|
Servo pulse using Timer1
Started by ●October 28, 2004
Reply by ●November 1, 20042004-11-01
Just to clairify my orginal post, I'm trying to read a pulse width with Timer1, not generate a pulse. Max --- In , "kg4pid" <kg4pid@y...> wrote: > > > I'm just starting a small project using > a 12F675 and would like to use Timer1 > to time the PWM signal going to a remote > controlled servo. The typical 1ms to 2ms > pulse with 1.5ms being centred. I've > done a few small projects but I've never > used Timer1 before. Looks like I sould > feed the signal in on GP4/T1G(not) to > be the gate. I plan on using a 4Mhz clock. > When using this input as a gate can it > still be read as an input? I'm trying to > figure out how to tell when to read the > counter and clear it for the next pulse. > Do I need to tie it to another input pin > and use that pin to tell if the pulse > has ended or not? Thanks, Max |
|
Reply by ●November 2, 20042004-11-02
Correct. The way I see it, if configured properly(CLKOUT disabled and Analog disabled) TMR1 should count while T1G is low. Looking at the schematic of the GP4 pin, not only can you read the input, but it looks like interrupt on change should also work. Good luck, Chad --- kg4pid <> wrote: > > Just to clairify my orginal post, I'm trying to read a pulse width > with Timer1, not generate a pulse. > Max > > --- In , "kg4pid" <kg4pid@y...> wrote: > > > > > > I'm just starting a small project using > > a 12F675 and would like to use Timer1 > > to time the PWM signal going to a remote > > controlled servo. The typical 1ms to 2ms > > pulse with 1.5ms being centred. I've > > done a few small projects but I've never > > used Timer1 before. Looks like I sould > > feed the signal in on GP4/T1G(not) to > > be the gate. I plan on using a 4Mhz clock. > > When using this input as a gate can it > > still be read as an input? I'm trying to > > figure out how to tell when to read the > > counter and clear it for the next pulse. > > Do I need to tie it to another input pin > > and use that pin to tell if the pulse > > has ended or not? Thanks, Max > > ===== My software has no bugs, only undocumented features. __________________________________ |