|
|
View previous topic :: View next topic |
Author |
Message |
garryw
Joined: 15 Apr 2016 Posts: 2 Location: Syracuse, NY
|
error after compiler update |
Posted: Fri Apr 15, 2016 2:11 pm |
|
|
I was using ver 4.141 and could compile without errors.
I updated to ver 5.057 and now get the following:
*** Error 99 "main.c" Line 45(5,68): Option invalid Software PWM frequency is not achievable with Timer 2
*** Error 99 "main.c" Line 46(5,68): Option invalid Timer2 already being used for another PWM
I can deal with the first error by changing the frequency, it's the second one I'm not sure how to deal with.
Code: | #if defined(__PCH__)
#include "18F67J93.h"
#ignore_warnings 202,240
#DEVICE ADC=10
#device *=16
#fuses WDT,NOPROTECT,INTRCPLL_IO,NODEBUG,CCP2C1
#use fast_io(all)
#use delay(clock=8000000)
#use rs232(uart1, baud=9600, RESTART_WDT, PARITY=N, BITS =8, STOP=1,stream=PC)
#use spi(FORCE_HW, BITS=8, baud=9600, MODE=0)
#USE PWM(PWM2,OUTPUT=PIN_C1,FREQUENCY=10kHz,DUTY=0)//unlatch C1 P2A
#USE PWM(PWM1,OUTPUT=PIN_C2,FREQUENCY=10kHz,DUTY=0)//unlatch C2 P1A
#use fast_io(ALL)
#include <stdio.h>
#include <stdlib.h> |
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Apr 15, 2016 3:11 pm |
|
|
It compiles if I add FORCE_HW to each #use pwm() statement, as shown below in bold:
Quote: | #include "18F67J93.h"
#ignore_warnings 202,240
#DEVICE ADC=10
#device *=16
#fuses WDT,NOPROTECT,INTRCPLL_IO,NODEBUG,CCP2C1
#use fast_io(all)
#use delay(clock=8000000)
#use rs232(uart1, baud=9600, RESTART_WDT, PARITY=N, BITS =8, STOP=1,stream=PC)
#use spi(FORCE_HW, BITS=8, baud=9600, MODE=0)
#USE PWM(PWM2, OUTPUT=PIN_C1, FREQUENCY=10kHz, DUTY=0, FORCE_HW)//unlatch C1 P2A
#USE PWM(PWM1,OUTPUT=PIN_C2,FREQUENCY=10kHz,DUTY=0, FORCE_HW)//unlatch C2 P1A
#use fast_io(ALL)
#include <stdio.h>
#include <stdlib.h> |
Compiler output (with vs. 5.057):
Quote: | Executing: "C:\Program files\Picc\CCSC.exe" +FH "PCH_Test.c" +DF +LY -T -A +M -Z +Y=9 +EA #__18F87J93=TRUE
--- Info 300 "PCH_Test.c" Line 10(1,1): More info: PWM Resolution: 9.64 bits
Memory usage: ROM=0% RAM=0% - 0%
0 Errors, 0 Warnings.
Build Successful.
Loaded C:\Program Files\PICC\Projects\PCH_Test\PCH_Test.cof.
BUILD SUCCEEDED: Fri Apr 15 14:12:11 2016
|
|
|
|
garryw
Joined: 15 Apr 2016 Posts: 2 Location: Syracuse, NY
|
|
Posted: Mon Apr 18, 2016 6:22 am |
|
|
Thank you so much for the FORCE_HW. That did the trick. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|