|
Re: Program digital IO to PWM?
The PIC18F8520 actually has several hardware counter-compare modules which are connected to the first four motor ports. These can be used to generate a high resolution PWM signal from 0% duty to 100% duty at high frequencies (I think I used 40kilohertz). Since hardware is taking care of this, after you set a value your code can continue to do anything else and the signal will continue to be generated until it is told otherwise.
I attached some code that I used to drive an h-bridge motor controller via this method.
__________________
"there are 10 types of people in this world, those who understand binary and those who don't"
|