jake1272
Joined: 15 Mar 2021 Posts: 37
|
Pulse Steering |
Posted: Mon Apr 05, 2021 7:52 am |
|
|
Hi everyone,
How do I implement a pulse at 10Hz and output to each of the 4 pulse steering pins every second?
Code: | //Pulse steering example
//Use CCP_PULSE_STEERING_X, where X= A,B,C or D
//Can also use multiple outputs ORd together
#include <16F1847.h>
#fuses INTRC_IO,NOWDT,NOPROTECT,NOLVP,MCLR
#use delay(clock=8000000)
#use rs232(baud=9600, UART1 ,Errors)
void main (){
setup_timer_2(T2_DIV_BY_16,207,1); //sets Freq = 600Hz
setup_ccp1(CCP_PWM | CCP_PULSE_STEERING_B); //Sends to PIN_B5
set_pwm1_duty(416L); //Sets 50% duty cycle
while(1);
}
|
|
|