pwm definition problems

Each time I try using any pwm with index lower than 13 I get something like
‘symbol pwm10 not found…’ and I don’t know what could it mean.
I tried using ‘generate_pwms’ but it says there are too much parameters.
If someone could explain the problem, it could really help me(I don’t really like being limited to 4 motors).
Thanks

Anton,

Can you describe which file, and which function you are adding code to? (i.e. user_routine.c -> Default_Function)

I am also assuming you are using one of the default code packages provided this year.

Can you describe what modifications you made to the code?

The only thing that comes to mind is that you might be opening only the C file, and not the workspace file, meaning you might not have access to your other C files and headers. Maybe try opening the .mcp file first, and then open the C file through the workspace window and try again?

-SlimBoJones…

You could be missing a particular compiler flag.

In MPLAB go to:
Project -> Build Options… -> Project
then the MPLAB C18 tab
Look under “Marco Definitions” and you should see _FRC_BOARD

Missing this will cause the errors you describe, because the compiler thinks you are targeting the EDU controller which takes different arguments for the Generate_PWMs command, and it only has 8 PWMs.

If this is indeed the problem click on “Add…” and type in _FRC_BOARD.
Then re-build everything.

well, I’m sure I used the .mcp file(I mean, I wouldn’t see the project tree if I hadn’t, would I?)
I’m using the 2.2 code version(from ifirobotics.com), with minor difications to the default routine.c & .h
I thought that mabe I didn’t use the generate_pwms properly, could you please explain how to use it?

I believe the generate_pwms function handles only PWM outputs 13-16. All the other PWM outputs are handled elsewhere. PWM 13-16 are a little different from 1-12, in that there is explicit code to generate the PWM signals. For pwm 1-12, no such explicit code exists, and to us, those PWM signals are auto-magically generated.

Basically, you should never have to use generate_pwms with pwm outputs 1-12. Just do “pwm01=255;” and get out of the way =).

-SlimBoJones…