Page 1 of 1

Problem with C code

Posted: Mon Jan 29, 2007 8:52 pm
by serstel
I use pic 18f4550 and I am trying to output PWM using this code:
{
ccpr2l = FCV_speed;
}

{
ccpr1l = FCV_speed;
}
the two channels are implemented in two different C code blocks. However when I try to convert the flowchart into assembly I get the folowing errors:
C:\Documents and Settings\Administrator\Desktop\Flowcodeprog\Flowcodetest.c(382): error: missing semicolon
C:\Documents and Settings\Administrator\Desktop\Flowcodeprog\Flowcodetest.c(383): error: missing semicolon
C:\Documents and Settings\Administrator\Desktop\Flowcodeprog\Flowcodetest.c(448): error: missing semicolon
C:\Documents and Settings\Administrator\Desktop\Flowcodeprog\Flowcodetest.c(449): error: missing semicolon
Can anyone help? Thank you in advance.

Posted: Tue Jan 30, 2007 9:50 am
by Steve
Flowcode variables are converted to all capitals in the C code, so use this:

Code: Select all

ccpr2l = FCV_SPEED;
Although when I tried to replicate your error, I got a different error message ("variable undefined") - so there may be something else going wrong with your code. The above line should work fine on its own within a C icon (i.e. no curly brackets, etc).