CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC16LF1709 compiling with errors

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mutthunaveen



Joined: 08 Apr 2009
Posts: 100
Location: Chennai, India

View user's profile Send private message

PIC16LF1709 compiling with errors
PostPosted: Sun Oct 23, 2016 11:05 am     Reply with quote

Dear board

I use CCS 5.015 version of compiler.
I used project wizard to create my code and here is my code with internal 8MHZ oscillator:
Code:

#include <16LF1709.h>
#device ADC=16

#FUSES WDT                      //Watch Dog Timer
#FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#FUSES HSBB_200_AFE         
#FUSES DRTEN                 
#FUSES HSBB_200_AFE         
#FUSES HSBB_200_AFE         

#use delay(internal=8000000)

#define LED PIN_C7
#define DELAY 1000

void main()
{
   setup_wdt(WDT_16S);      //~16.3 s reset


   //Example blinking LED program
   while(true)
   {
      output_low(LED);
      delay_ms(DELAY);
      output_high(LED);
      delay_ms(DELAY);
   }

}



when i compile it is displaying following errors
Code:

*** Error 28 "C:\Program Files\PICC\devices\16LF1709.h" Line 447(34,35): Expecting an identifier  Bad SFR name
*** Error 12 "C:\Program Files\PICC\devices\16LF1709.h" Line 447(35,37): Undefined identifier
*** Error 28 "C:\Program Files\PICC\devices\16LF1709.h" Line 552(35,36): Expecting an identifier  Bad SFR name
*** Error 12 "C:\Program Files\PICC\devices\16LF1709.h" Line 553(2,5): Undefined identifier
*** Error 48 "C:\Program Files\PICC\devices\16LF1709.h" Line 553(6,12): Expecting a (
*** Error 28 "C:\Program Files\PICC\devices\16LF1709.h" Line 553(35,36): Expecting an identifier  Bad SFR name
*** Error 48 "C:\Program Files\PICC\devices\16LF1709.h" Line 553(35,36): Expecting a (
*** Error 28 "C:\Program Files\PICC\devices\16LF1709.h" Line 554(35,36): Expecting an identifier  Bad SFR name
*** Error 12 "C:\Program Files\PICC\devices\16LF1709.h" Line 554(36,38): Undefined identifier
*** Error 111 "H:\003 Projects\CCS4078\WATER_LEVEL_SENSOR\TX\Base\water_level_remote.h" Line 4(7,47): Unknown keyword in #FUSES   "WDT"
*** Error 99 "H:\003 Projects\CCS4078\WATER_LEVEL_SENSOR\TX\Base\water_level_remote.h" Line 11(5,29): Option invalid   No Internal Osc
      11 Errors,  0 Warnings.
Build Failed.


Can someone help me how can i solve this issue?

I need to work on this nanowatt tech PIC controller. I'm building a remote water level indicator battery operated, so, i chose this uc.

Thank you for your response in solving the compile issue.
dyeatman



Joined: 06 Sep 2003
Posts: 1937
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Oct 23, 2016 11:33 am     Reply with quote

When I compile under 5.064 I only get errors for the fuses after WDT:

Code:
#FUSES WDT                      //Watch Dog Timer
// #FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
// #FUSES HSBB_200_AFE         
// #FUSES DRTEN               
// #FUSES HSBB_200_AFE         
// #FUSES HSBB_200_AFE       

The fuses available in the header file are:
Code:

//////// Fuses: LP,XT,HS,RC,INTRC_IO,ECL,ECM,ECH,NOWDT,WDT_SW,WDT_NOSL,WDT
//////// Fuses: PUT,NOPUT,NOMCLR,MCLR,PROTECT,NOPROTECT,NOBROWNOUT
//////// Fuses: BROWNOUT_SW,BROWNOUT_NOSL,BROWNOUT,CLKOUT,NOCLKOUT,NOIESO
//////// Fuses: IESO,NOFCMEN,FCMEN,WRT,WRT_1000,WRT_200,NOWRT,NOPPS1WAY
//////// Fuses: PPS1WAY,NOZCDDIS,ZCDDIS,NOPLLEN,PLLEN,NOSTVREN,STVREN,BORV25
//////// Fuses: BORV19,LPBOR,NOLPBOR,DEBUG,NODEBUG,NOLVP,LVP

The fuses you have are not listed in the header. When I comment out the ones not listed it compiles fine for me.
For the other errors, are you modifying the 16LF1709.h header file somehow?
If so, you should never do that
_________________
Google and Forum Search are some of your best tools!!!!
mutthunaveen



Joined: 08 Apr 2009
Posts: 100
Location: Chennai, India

View user's profile Send private message

error again
PostPosted: Sun Oct 23, 2016 7:34 pm     Reply with quote

Hi.. thanks for reply

1. i did not modify my PIC header file.
2. i ve modified my code as follows still no success

Code:

#include <16LF1709.h>
#device ADC=16

//#FUSES WDT                      //Watch Dog Timer

#define LED PIN_C7
#define DELAY 1000

void main()
{
   setup_wdt(WDT_16S);      //~16.3 s reset


   //Example blinking LED program
   while(true)
   {
      output_low(LED);
      delay_ms(DELAY);
      output_high(LED);
      delay_ms(DELAY);
   }
}


the error lists are same. here is exactly ccs c compiler showing the issue in PIC header file
Code:

#bit C1OUT = getenv("SFR:CM1CON0").6
#bit C2OUT = getenv("SFR:CM2CON0").6

#bit LC1OUT = getenv("SFR:CLC1CON").5
#bit LC2OUT = getenv("SFR:CLC2CON").5 
#bit LC3OUT = getenv("SFR:CLC3CON").5 


when i analyze your header Fuses list and my header fuses list there is a mismatch. seems what i use is a old header file list.

how can i update my header file?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Oct 23, 2016 8:20 pm     Reply with quote

The header file won't do it. The database for this PIC for your version
is hopelessly screwed up. The .h file for your version doesn't even list
any of the valid oscillator fuses. The compiler won't accept them.
This means the database is not correct. You need a later version of
the compiler to use your PIC.

Here's the fuses list from the 16LF1709.h file, for version 5.015.
It doesn't even have any oscillator fuses.
Code:
//////// Fuses: WRT_40,WRT_80,ZCDDIS,DSWDTOSC_SOSC,PPS1WAY,HPOL_LOW,FLTAA5
//////// Fuses: FLTAA7,WPSA1,XINST,NOXINST,WPSB16,MSSP2MSK5,MSSP2MSK7,ICSP4
//////// Fuses: WPSA512,WPSA64,WPSA8,CINA_ALT,CINA_DEFAULT,T5G_IS_T3G
//////// Fuses: T5G_IS_T5G,LPRC_HIGH,T1OSCA6,BB_WRT,IOLIWAY,HSBB_200_AFE
//////// Fuses: BB_NOWRT,DRTEN,WRT_800,WRT_200,NOWDT   NODS,HSBB_200_AFE
//////// Fuses: HSBB_200_AFE,HSBB_200_AFE,HSBB_200_AFE,WDT1024,WDT512
//////// Fuses: FREQ_100K_TO_8M,FREQ_LT_100K,SDOC7,RSS256,LPBOR,NOLPBOR
//////// Fuses: NOVREGSLEEP,WDTCLK_PERIPHERAL,WDTCLK_LPRC,WDTCLK_FRC,WPSB15
//////// Fuses: WPSB15
mutthunaveen



Joined: 08 Apr 2009
Posts: 100
Location: Chennai, India

View user's profile Send private message

Yes i see the issue
PostPosted: Sun Oct 23, 2016 10:19 pm     Reply with quote

Plz confirm me. if i update the device .h file (16LF1709.h) file alone will solve the problem with same compiler version? or do i have to update the compiler itself?

thank you.
Ttelmah



Joined: 11 Mar 2010
Posts: 19559

View user's profile Send private message

PostPosted: Mon Oct 24, 2016 1:04 am     Reply with quote

Multiple things:

The actual compiler needs to update. The one you are trying to use, was about the first to actually list the PIC16LF1709. The include file had been added, but the chip database was not complete, and the include file has some really silly things (NOXINST for example, is a PIC18 fuse - Duh). An 'alpha' release for the chip at best....

Then there are things in your code that won't work.

So you need to update the compiler, with the include file, and then your code.

Several of the lines that fail in the include, fail because of the chip database, others are just 'wrong'.
mutthunaveen



Joined: 08 Apr 2009
Posts: 100
Location: Chennai, India

View user's profile Send private message

PostPosted: Mon Oct 24, 2016 1:36 am     Reply with quote

OK thank you and let me see to choose final best option

i will get only device database and work and see if it works. after if not i will upgrade to latest version.
Ttelmah



Joined: 11 Mar 2010
Posts: 19559

View user's profile Send private message

PostPosted: Mon Oct 24, 2016 1:51 am     Reply with quote

The device database, comes _with_ the compiler. The include file is not the database.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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