Hello All,
I could use some help, please. I'm having issues compiling a program to use two PWM channels simultaneously. I get the error:
Error: GCASM: Symbol INITPWM has not been defined Message AT not defined in
messages.dat! CALL INITPWM
I'm using:
GCB Compiler Version
0.98.06
2019-06-12
(Windows 32 bit)
The program is as follows:
'Chip model and speed
#chip18F8722, 4
#include<lowlevel/pwm.h>'Configs
#configosc=intio67'Use the internal clock
#configmclr=off'Reset handled internally
#configwdt=off'Give the dog a rest'Directions
#definePORTC.2Out'PWM1, pin 43
#definePORTC.1Out'PWM2, pin 35'DimensionsdimCh1DCasByte'Duty Cycle 1dimCh2DCasByte'Duty Cycle 2'InitializationCh1DC=1Ch2DC=255DoForCh1DC=1to255HPWM1, 1, Ch1DCHPWM2, 1, Ch2DCCh2DC=Ch2DC-1IfCh2DC<=1ThenCh2DC=1EndIfWait10mSNextForCh1DC=255to1HPWM1, 1, Ch1DCHPWM2, 1, Ch2DCCh2DC=Ch2DC+1IfCh2DC>=255ThenCh2DC=255EndIfWait10mSNextLoopEnd
Am I doing something wrong?
Last edit: Chris Roper 2021-01-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
NOTNEEDED #include<lowlevel/pwm.h>'NOT NEEDED Configs until later... get the basics working
#configosc=intio67'Use the internal clock
#configmclr=off'Reset handled internally
#configwdt=off'Give the dog a rest'DirectionsWRONG..... #definePORTC.2Out'PWM1, pin 43useDIRWRONG..... #definePORTC.1Out'PWM2, pin 35useDIR
:-)
Last edit: Anobium 2021-01-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Oops, that's what it was originally. I messed up the syntax during the heat of battle. I changed it back and still get the same error when I try to compile.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
GCBASIC generally takes care of all the config for you.
The #Config derivatives are only there to force specific configs that are not normally used and are Device specific.
I also suggest that you use the Release Candidates if you hit a problem as many bugs get fixed in the background.
Thanks much Chris and Anobium. I'll bookmark that link for future reference. I spend a lot of time in the Forums and can usually find solutions to issues I'm having there. I'm sure the Release Candidates will be a powerful resource.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello All,
I could use some help, please. I'm having issues compiling a program to use two PWM channels simultaneously. I get the error:
Error: GCASM: Symbol INITPWM has not been defined Message AT not defined in
messages.dat! CALL INITPWM
I'm using:
GCB Compiler Version
0.98.06
2019-06-12
(Windows 32 bit)
The program is as follows:
Am I doing something wrong?
Last edit: Chris Roper 2021-01-27
Sorry for the appearance of the program. I just copied and pasted from the editor and it pasted really strangely.
Fixed the Formatting for you .
OK.
Try the basics. Does this work? This will show the CCP/PWM is operational. You dont need anything else in this test.
Hi Anobium!
Yes, that works fine.
Now rebuild your code from this.
You know now CCP/PWM1 works. So, focus on that.
:-)
Last edit: Anobium 2021-01-27
This:
should be
Last edit: Chris Roper 2021-01-27
Oops, that's what it was originally. I messed up the syntax during the heat of battle. I changed it back and still get the same error when I try to compile.
Well, how about that. The two LED's are cycling perfectly now. Were the CONFIGS messing it up?
GCBASIC generally takes care of all the config for you.
The #Config derivatives are only there to force specific configs that are not normally used and are Device specific.
I also suggest that you use the Release Candidates if you hit a problem as many bugs get fixed in the background.
That latest is here:
https://sourceforge.net/projects/gcbasic/files/Release%20Candidates/
Thanks much Chris and Anobium. I'll bookmark that link for future reference. I spend a lot of time in the Forums and can usually find solutions to issues I'm having there. I'm sure the Release Candidates will be a powerful resource.