Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Ads

Discussion Groups

Discussion Groups | BasicX | Timer2 on Pin 25

Discussion forum for the BasicX family of microcontroller chips.

Timer2 on Pin 25 - John Piccirillo - Mar 15 10:18:00 2002


Not too long ago Frank Manning posted some code to use
Timer 2 to control PWM on pin 25. I'm using Timer 1 to control
a motor at 14 kHz on pin 27 and would like to use timer 2 to control
at servo at 56 Hz. Using the code supplied, pin 25 does indeed
put out a pulse every approx 18 msec. However, for a 1 ms wide pulse
the falling edge is not sharp but looks like a capacitor discharge curve.
This is with only a 10x scope probe on the pin (the same scope output
on pin 27 shows sharp rise and fall times).

Two questions:

1) is the slow decay time normal for timer 2 or for timer 2 at 56 Hz?
If not what can I do to remedy the situation?

2) The servo, which works with a pulseout on one of the regular I/O
pins, does not work at all with timer 2 controlling pin 25. Is this
a function of the slow decay time ?

I'd appreciate any hints to make the servo work with the timer 2 output.
Timer 2, to my knowledge, is not being used for any other function, ie Com3.

Thanks,

John Piccirillo





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


Re: Timer2 on Pin 25 - Frank Manning - Mar 15 16:01:00 2002

From: "John Piccirillo" <>

> Not too long ago Frank Manning posted some code to use
> Timer 2 to control PWM on pin 25. I'm using Timer 1 to
> control a motor at 14 kHz on pin 27 and would like to use
> timer 2 to control at servo at 56 Hz. Using the code
> supplied, pin 25 does indeed put out a pulse every approx
> 18 msec. However, for a 1 ms wide pulse the falling edge
> is not sharp but looks like a capacitor discharge curve.
> This is with only a 10x scope probe on the pin (the same
> scope output on pin 27 shows sharp rise and fall times).
>
> Two questions:
>
> 1) is the slow decay time normal for timer 2 or for timer
> 2 at 56 Hz? If not what can I do to remedy the situation?

No, it shouldn't be doing that. The on-board red LED is connected to pin 25,
but that shouldn't be causing the problem. We'll have a look at it.

> 2) The servo, which works with a pulseout on one of the
> regular I/O pins, does not work at all with timer 2
> controlling pin 25. Is this a function of the slow decay
> time ?

What servo are you using? I have been able to drive a servo using Timer2,
but perhaps the particular servo I was using just happens to be more
tolerant of variations in the input signal. Obviously it's not good for
Timer2 to work with some servos and not others.

> I'd appreciate any hints to make the servo work with the
> timer 2 output. Timer 2, to my knowledge, is not being used
> for any other function, ie Com3.

OK, I'll see if we can reproduce the problem.

-- Frank Manning
-- NetMedia, Inc.




(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Timer2 on Pin 25 - John Piccirillo - Mar 17 16:01:00 2002

Thanks for replying Frank. The servo I'm using is Hitec
HS-805BB Mega Power, 1/4 Scale Servo. The puzzling thing
is that it works with a pulseout on pin 19. Since this is a class
project, there's no telling what a student may have done (so
far I have about a dozen dead BasicX chips that students have
fried). I'll try a pulseout on pin 25 and see if the pin is working
properly.

John Piccirillo
From: "John Piccirillo" <jpicciri@r...>

> Not too long ago Frank Manning posted some code to use
> Timer 2 to control PWM on pin 25. I'm using Timer 1 to
> control a motor at 14 kHz on pin 27 and would like to use
> timer 2 to control at servo at 56 Hz. Using the code
> supplied, pin 25 does indeed put out a pulse every approx
> 18 msec. However, for a 1 ms wide pulse the falling edge
> is not sharp but looks like a capacitor discharge curve.
> This is with only a 10x scope probe on the pin (the same
> scope output on pin 27 shows sharp rise and fall times).
>
> Two questions:
>
> 1) is the slow decay time normal for timer 2 or for timer
> 2 at 56 Hz? If not what can I do to remedy the situation?

No, it shouldn't be doing that. The on-board red LED is connected to pin 25,
but that shouldn't be causing the problem. We'll have a look at it.

> 2) The servo, which works with a pulseout on one of the
> regular I/O pins, does not work at all with timer 2
> controlling pin 25. Is this a function of the slow decay
> time ?

What servo are you using? I have been able to drive a servo using Timer2,
but perhaps the particular servo I was using just happens to be more
tolerant of variations in the input signal. Obviously it's not good for
Timer2 to work with some servos and not others.

> I'd appreciate any hints to make the servo work with the
> timer 2 output. Timer 2, to my knowledge, is not being used
> for any other function, ie Com3.

OK, I'll see if we can reproduce the problem.

-- Frank Manning
-- NetMedia, Inc.
[Non-text portions of this message have been removed]




(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Timer2 on Pin 25 - Frank Manning - Mar 17 20:40:00 2002

From: "John Piccirillo" <>

> Thanks for replying Frank. The servo I'm using is Hitec
> HS-805BB Mega Power, 1/4 Scale Servo. The puzzling thing
> is that it works with a pulseout on pin 19. Since this
> is a class project, there's no telling what a student may
> have done (so far I have about a dozen dead BasicX chips
> that students have fried). I'll try a pulseout on pin 25
> and see if the pin is working properly.

Yesterday I looked at the PWM output on pin 25. I was seeing rise times and
fall times within about 200 ns. Is that what you were seeing?

I also tested the pin with a Hitec HS-5645MG, which looked like it worked
OK. I also tried a couple of other servos (Cirrus CS-50 and GWS S05/2BB) --
haven't been able to reproduce the problem.

I'll see if we can round up a HS-805BB for testing.

-- Frank Manning
-- NetMedia, Inc.




(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )