Is it possible to use MicroC without using the PIC - gui? If not are there other alternatives
A
Answer by
Ashish Bajaj
Yes, it is possible to use mikroC PRO for PIC without using the PIC - gui. There are other alternatives available for programming PIC microcontrollers as well.
To call an external file in mikroC PRO for PIC, you can use the #include directive followed by the file name. For example: #include "filename.h" to include a header file or #include "filename.c" to include a source file.
hello I am traying to built pwm motor controller using pic18f4550 and I need help to CHECK and improved my code AND add watchdog timer because my project will run for long time , I will attach my code .
unsigned int adc_rd1 ; long current_duty1; unsigned int adc_rd2; long current_duty2;
Is it possible to use MicroC without using the PIC - gui? If not are there other alternatives
Yes, it is possible to use mikroC PRO for PIC without using the PIC - gui. There are other alternatives available for programming PIC microcontrollers as well.
To call an external file in mikroC PRO for PIC, you can use the #include directive followed by the file name. For example: #include "filename.h" to include a header file or #include "filename.c" to include a source file.
hello I am traying to built pwm motor controller using pic18f4550 and I need help to CHECK and improved my code AND add watchdog timer because my project will run for long time , I will attach my code .
unsigned int adc_rd1 ;
long current_duty1;
unsigned int adc_rd2;
long current_duty2;
void main() {
TRISA.RA2= 1 ;
TRISA.RA3= 1 ;
TRISC = 0 ;
TRISB = 0 ;
PWM1_Init (6000);
PWM1_Start();
PWM2_Init (6000);
PWM2_Start();
ADC_Init();
PORTB.F0 = 1;
while (1) {
adc_rd1 = ADC_Read (2);
adc_rd2 = ADC_Read (3);
current_duty1 = (long) adc_rd1 * 240;
current_duty1 = current_duty1/1023;
current_duty2 = (long) adc_rd2 * 240;
current_duty2 = current_duty2/1023;
if( adc_rd1 > adc_rd2){
Delay_us(50);
pwm1_set_Duty(current_duty1);
pwm2_set_Duty(0); }
else if ( adc_rd2> adc_rd1){
Delay_us(50);
pwm2_set_Duty(current_duty2);
pwm1_set_Duty(0);
}
else {
Delay_us(100);
pwm1_set_Duty(0);
pwm2_set_Duty(0);
}
}
}
Yes, MikroC PRO for PIC does support the 16F18446.