girgis adly
New Member
Dear all iam girgis adly in 4th year electrical faculty of engineer I try to write a program for pic18f452 firing the mosfets of the multilevel inverter at a certain time by a certain sequence and the frequency of the output equal 50 HZ I write the program using (microC) language
void main()
{
TRISB=0;
LOOP:
PORTB=0;
delay_ms(.3355);
PORTB=0B00100110;
delay_ms(2.717);
PORTB=0B00100101;
delay_ms(3.889);
PORTB=0B00100110;
delay_ms(2.667);
PORTB=0;
delay_ms(0.777);
PORTB=0B00011010;
delay_ms(2.667);
PORTB=0B00011001;
delay_ms(3.889);
PORTB=0B00011010;
delay_ms(2.667);
PORTB=0;
delay_ms(0.388);
goto loop;
}
but the compiler found this errors
Internal error line 8
';'expected but delay_ms is found line7
Integral constant expected line6
Syntax error :expected ')'but found ';' line7
I don’t know how to re write the program without errors and without changing the time it will be grateful if any one help me
thanks
void main()
{
TRISB=0;
LOOP:
PORTB=0;
delay_ms(.3355);
PORTB=0B00100110;
delay_ms(2.717);
PORTB=0B00100101;
delay_ms(3.889);
PORTB=0B00100110;
delay_ms(2.667);
PORTB=0;
delay_ms(0.777);
PORTB=0B00011010;
delay_ms(2.667);
PORTB=0B00011001;
delay_ms(3.889);
PORTB=0B00011010;
delay_ms(2.667);
PORTB=0;
delay_ms(0.388);
goto loop;
}
but the compiler found this errors
Internal error line 8
';'expected but delay_ms is found line7
Integral constant expected line6
Syntax error :expected ')'but found ';' line7
I don’t know how to re write the program without errors and without changing the time it will be grateful if any one help me
thanks