View previous topic :: View next topic |
Author |
Message |
inge_simo
Joined: 28 Nov 2017 Posts: 1
|
Problem with fuses |
Posted: Tue Nov 28, 2017 4:37 am |
|
|
Hello to everybody,
I'm going crazy with #FUSES defined with pic16f88 and ccs/ide version 5.019.
This is the code:
file .h
Code: |
#include <16F88.h>
#device ADC=10
#FUSES NOWDT
//#device ICD=TRUE
#use delay(clock=8000000)
|
file.c
Code: |
#include <VR_PWM.h>
/*
#INT_TIMER1
void TIMER1_isr(void) {
clear_interrupt(int_TIMER1);
}
*/
void main() {
setup_oscillator(OSC_8MHZ|OSC_INTRC);
setup_wdt(0);
// setup_adc_ports(sAN0);
// setup_adc(ADC_CLOCK_DIV_2);
// setup_timer_1(T1_INTERNAL|T1_DIV_BY_4); //131 ms overflow
// setup_timer_2(T2_DIV_BY_1,39,1); //20,0 us overflow, 20,0 us interrupt
// setup_ccp1(CCP_PWM);
// set_pwm1_duty((int16)0);
// enable_interrupts(INT_TIMER1);
// enable_interrupts(GLOBAL);
while(TRUE){
//TODO: User Code
output_High(PIN_A2);
delay_ms(100);
output_Low(PIN_A2);
delay_ms(100);
}
}
|
When i compile the code i have:
Quote: | Unknown keyword in #FUSES "NOWDT"
|
I tried to change multiple fuses but the result is the same!
Simone |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Tue Nov 28, 2017 6:19 am |
|
|
I don't see why that error occurs. Perhaps remove all commented out code, the pwm header, etc. and recompile. Even IF the device header was bad, that error shouldn't happen.
this...
setup_wdt(0);
is incorrect as '0' is not a valid option. If you look at the pic 'device' header, it lists all the options for that PIC.
I'd start with the simple '1Hz LED program', get it working, then build upon that.
Jay |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Tue Nov 28, 2017 6:21 am |
|
|
It compiles under 5.075 with no problems. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Nov 28, 2017 6:32 am |
|
|
You have this line at the top of your program:
Quote: | #include <VR_PWM.h> |
You call your header file "file.h". But you don't have an #include line
for file.h. You have it for VR_PWM.h.
What is in VR_PWM.h ? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Tue Nov 28, 2017 9:41 am |
|
|
maybe (V)ariable (R)esistor to (P)ulse(W)idth(M)odulation .
it is confusing though
For small 'beginner' or 'test' programs, it's always best to have the ENTIRE program in one file. Everything from PIC device.h to end of main(). Once it does work THEN you can breakdown into smaller 'include' files.
I have a separate 'fuses' file ( 46k22_basic_fuses.fuz ) for PIC18F46K22 projects. It is a complete(yes, every fuse) set that works as tested with a 1Hz LED program. I'm a lousy typist(bad finger) so doing it once really helps, especially since there are more fuses than PIC instructions ! |
|
|
|