go away spammer

Author Topic: generating pwm throgh non ccp pin in 16F877A  (Read 3957 times)

0 Members and 1 Guest are viewing this topic.

Offline aruna1Topic starter

  • Supreme Robot
  • *****
  • Posts: 381
  • Helpful? 4
  • I'm an Ordinary guy
generating pwm throgh non ccp pin in 16F877A
« on: February 25, 2009, 06:24:12 AM »
guys is it possible to generate pwm signal using non ccp pin (like E0) in PIC 16F877A?. I'm using both pwm pins(ccp1 & ccp2) to drive my robot and now i need to operate a servo. so if i use a loop to toggle a pin between high and low to generate a pwm signal will it damage my PIC? and will pwm signal generate by this method is precise?
thanks
I'm Me

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: generating pwm throgh non ccp pin in 16F877A
« Reply #1 on: February 26, 2009, 10:22:22 PM »
Quote
so if i use a loop to toggle a pin between high and low to generate a pwm signal will it damage my PIC? and will pwm signal generate by this method is precise?
Nope it won't damage anything. And in fact its my preferred way to control servos. Its very precise.

Offline ArcMan

  • Supreme Robot
  • *****
  • Posts: 519
  • Helpful? 4
  • Mmmm... Plasma
Re: generating pwm throgh non ccp pin in 16F877A
« Reply #2 on: February 27, 2009, 12:51:42 PM »
Like admin said, it is the preferred way to drive servos.  If you do the math from the PIC data sheet, you'll find that the pulse width accuracy at 50 Hz (the typical servo update frequency) is not very good using the CCP hardware.

 


Get Your Ad Here