![]() | ![]() | ![]() |
| | |||||||
| Robotics Chat Specific to discussions about robots and the making of. |
| | Thread Tools | Display Modes |
| | (permalink) |
| New Member | I need to use PIC16F877A to generate a PWM signal to control my motor driver--MD22(http://www.robot-electronics.co.uk/htm/md22tech.htm), the RC servo mode of MD22 need a PWM signal which has PWM period of 20ms and duty cycle range from 1ms to 2ms. I look for the frequency problem online regarding PIC16F877A, but it seems that the lowest PWM frequency I can get is about 488Hz. How can I generate the PWM signal in this case? I need some help... thank you |
| | |
| | (permalink) |
| Super Moderator | It's usual to do it completely in software, even a BASIC STAMP can do it. |
| | |
| | (permalink) |
| Experienced Member | You can make a timer interrupt that goes as long as you want and base some code that manually turns a pin high and low off of that to make slow PWM. |
| | |
| | (permalink) | |
| New Member | Quote:
| |
| | |
| | (permalink) |
| New Member | iznalgnaij: Just use a slower xtal oscillator (32.768 kHz would work), or maybe an RC osc; read up on the different osc types (this is all explained in the PIC16F877A data sheet). The duty cycle pulse is no problem no matter what xtal you use. The Period=P is: P=[(PR2+1)4(Tosc)(PSV)] where PSV=prescale value Ex. If use a 32.768 kHz xtal, with PSV=1 then PR2+1=163.84 ->164 Period(actual) = 20.0195 mS, 0.002 % difference from 20 mS Last edited by second286; 25th March 2008 at 09:51 PM. |
| | |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Latest |
| The Oscilloscope | ElectroMaster | Electronic Theory | 12 | 3rd February 2008 01:45 PM |
| Using Oscilloscopes | mechie | Electronic Theory | 9 | 29th November 2007 09:48 PM |
| RF SIGNAL problem | stanleymyc | Electronic Projects Design/Ideas/Reviews | 2 | 1st June 2004 05:39 PM |
| Big thermocouple ADC problem | Oznog | General Electronics Chat | 9 | 4th May 2004 08:42 PM |
| Building a signal mixer (for music primary) | thec | Electronic Projects Design/Ideas/Reviews | 4 | 3rd October 2002 05:07 PM |