AtomSoft
Well-Known Member
PWM in title
How would i go about making a PWM signal using software alone.. 38khz of course
i know this much:
From https://www.micro-examples.com/public/microex-navig/doc/097-pwm-calculator.html
But that just sets the registers... Now what?
Do i just do a high/low with delays? Or would that be just a software PWM by itself?
How would i go about making a PWM signal using software alone.. 38khz of course
i know this much:
Code:
/*
* PWM registers configuration
* Fosc = 8000000 Hz
* Fpwm = 37735.85 Hz (Requested : 38000 Hz)
* Duty Cycle = 50 %
* Resolution is 7 bits
* Prescaler is 1
* Ensure that your PWM pin is configured as digital output
* see more details on http://www.micro-examples.com/
* this source code is provided 'as is',
* use it at your own risks
*/
PR2 = 0b00110100 ;
T2CON = 0b00000100 ;
CCPR1L = 0b00011010 ;
CCP1CON = 0b00011100 ;
From https://www.micro-examples.com/public/microex-navig/doc/097-pwm-calculator.html
But that just sets the registers... Now what?
Do i just do a high/low with delays? Or would that be just a software PWM by itself?
Last edited: