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

Bad header for pic16f1459

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



Joined: 07 May 2013
Posts: 23

View user's profile Send private message

Bad header for pic16f1459
PostPosted: Tue May 07, 2013 9:15 pm     Reply with quote

Hi

The supplied header that comes for the pic16f1459 is completely wrong for the fuses section. There are misspelled keys, fuses that don't exist and many fuses missing. I only have the command version of the ccs compiler so there is no application tool to edit the header file. I contacted ccs support but it has been over a week and absolutely no response. Is this the norm with them?

What can I do to solve this issue?

Thank you in advance for your reply.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue May 07, 2013 11:47 pm     Reply with quote

Quote:

There are misspelled keys, fuses that don't exist and many fuses missing.

Post your compiler version and give an example of each one of the
problems you list above.

CCS version numbers:
http://www.ccsinfo.com/devices.php?page=versioninfo
jackmicro



Joined: 07 May 2013
Posts: 23

View user's profile Send private message

PostPosted: Wed May 08, 2013 12:29 am     Reply with quote

I'm using the PCM 5.001

Header file:

//////// Program memory: 8192x14 Data RAM: 1008 Stack: 16
//////// I/O: 17 Analog Pins: 9
//////// C Scratch area: 77 ID Location: 8000
//////// Fuses: LL_DIV_16,PLL_DIV_8,PLL_DIV_4,PLL_DIV_2,BORM_MED,BORRES
//////// Fuses: PMPEMB,NOPMPEMB,NOWDT,WDT_SW,WDT_NOSL,WDT,PUT,NOPUT,NOMCLR
//////// Fuses: MCLR,PROTECT,NOPROTECT,NOBROWNOUT,BROWNOUT_SW,BROWNOUT_NOSL
//////// Fuses: BROWNOUT,CLKOUT,NOCLKOUT,NOGSSK,RESET_PRIMARY,NOFCMEN,FCMEN
//////// Fuses: SS1NORM,CKSFSM,NOCKSFSM,NOWRT,NOCPUDIV,CPUDIV2,CPUDIV3
//////// Fuses: CPUDIV6,LS24MHZ,LS48MHZ,PLL4X,PLL3X,NOPLLEN,PLLEN,NOSTVREN
//////// Fuses: STVREN,BORV25,BORV19,LPBOR,NOLPBOR,DEBUG,NODEBUG,NOLVP,LVP
////////

What's LL_DIV_16? would it be PLL_DIV_16? but the pic16f1459 doesn't even have that mode...

What's NOPMPEMB? not for the 1459....

On the other hand, for example where is FOSC? no fuse programming for oscillator mode? what?

Datasheet info for the pic16f1459:

Word 1:

bit 13 FCMEN: Fail-Safe Clock Monitor Enable bit
1 = Fail-Safe Clock Monitor is enabled
0 = Fail-Safe Clock Monitor is disabled
bit 12 IESO: Internal External Switchover bit
1 = Internal/External Switchover mode is enabled
0 = Internal/External Switchover mode is disabled
bit 11 CLKOUTEN: Clock Out Enable bit
1 = CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin
0 = CLKOUT function is enabled on the CLKOUT pin
bit 10-9 BOREN<1:0>: Brown-out Reset Enable bits(1)
11 = BOR enabled
10 = BOR enabled during operation and disabled in Sleep
01 = BOR controlled by SBOREN bit of the BORCON register
00 = BOR disabled
bit 8 Unimplemented: Read as ‘1’
bit 7 CP: Code Protection bit(2)
1 = Program memory code protection is disabled
0 = Program memory code protection is enabled
bit 6 MCLRE: MCLR/VPP Pin Function Select bit
If LVP bit = 1:
This bit is ignored.
If LVP bit = 0:
1 = MCLR/VPP pin function is MCLR; Weak pull-up enabled.
0 = MCLR/VPP pin function is digital input; MCLR internally disabled; Weak pull-up under control of
WPUA register.
bit 5 PWRTE: Power-Up Timer Enable bit
1 = PWRT disabled
0 = PWRT enabled
bit 4-3 WDTE<1:0>: Watchdog Timer Enable bits
11 =WDT enabled
10 =WDT enabled while running and disabled in Sleep
01 =WDT controlled by the SWDTEN bit in the WDTCON register
00 =WDT disabled
bit 2-0 FOSC<2:0>: Oscillator Selection bits
111 = ECH: External clock, High-Power mode: on CLKIN pin
110 = ECM: External clock, Medium-Power mode: on CLKIN pin
101 = ECL: External clock, Low-Power mode: on CLKIN pin
100 = INTOSC oscillator: I/O function on OSC1 pin
011 = EXTRC oscillator: RC function connected to CLKIN pin
010 = HS oscillator: High-speed crystal/resonator on OSC1 and OSC2 pins
001 = XT oscillator: Crystal/resonator on OSC1 and OSC2 pins
000 = LP oscillator: Low-power crystal on OSC1 and OSC2 pins

Word 2
bit 13 LVP: Low-Voltage Programming Enable bit(1)
1 = Low-voltage programming enabled
0 = High-voltage on MCLR must be used for programming
bit 12 DEBUG: In-Circuit Debugger Mode bit(3)
1 = In-Circuit Debugger disabled, ICSPCLK and ICSPDAT are general purpose I/O pins
0 = In-Circuit Debugger enabled, ICSPCLK and ICSPDAT are dedicated to the debugger
bit 11 LPBOR: Low-Power BOR Enable bit
1 = Low-Power Brown-out Reset is disabled
0 = Low-Power Brown-out Reset is enabled
bit 10 BORV: Brown-out Reset Voltage Selection bit(2)
1 = Brown-out Reset voltage (Vbor), low trip point selected
0 = Brown-out Reset voltage (Vbor, high trip point selected
bit 9 STVREN: Stack Overflow/Underflow Reset Enable bit
1 = Stack Overflow or Underflow will cause a Reset
0 = Stack Overflow or Underflow will not cause a Reset
bit 8 PLLEN: PLL Enable bit
1 = PLL is enabled
0 = PLL is disabled
bit 7 PLLMULT: PLL Multiplier Selection bit
1 = 3x PLL Output Frequency is selected
0 = 4x PLL Output Frequency is selected
bit 6 USBLSCLK: USB Low-Speed Clock Selection bit
1 = USB Clock divide-by 8 (48 MHz system input clock expected)
0 = USB Clock divide-by 4 (24 MHz system input clock expected)
bit 5-4 CPUDIV<1:0>: CPU System Clock Selection bits
11 = CPU system clock divided by 6
10 = CPU system clock divided by 3
01 = CPU system clock divided by 2
00 = No CPU system clock divide
bit 3-2 Unimplemented: Read as ‘1’
bit 1-0 WRT<1:0>: Flash Memory Self-Write Protection bits
8 kW Flash memory:
11 = Write protection off
10 = 000h to 01FFh write-protected, 0200h to 1FFFh may be modified
01 = 000h to 0FFFh write-protected, 1000h to 1FFFh may be modified

It is obvious one doesn't match the other...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed May 08, 2013 12:42 am     Reply with quote

But version 5 hasn't been released. You must be in a CCS Beta group.
This forum is largely concerned about released versions.
jackmicro



Joined: 07 May 2013
Posts: 23

View user's profile Send private message

PostPosted: Wed May 08, 2013 1:19 am     Reply with quote

hmmm... not sure about beta.

I bought the compiler only a couple of weeks ago. Followed the download instructions and this is the version I got.

What should I do?
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Wed May 08, 2013 3:13 am     Reply with quote

You may nto be sure about beta, but *we* are sure about beta. The current "stable" version of CCS C is 4.141. There's a big prominent button for it on CCS's download webpage: http://www.ccsinfo.com/downloads.php . They have a colour click through ad for version 5, which when clicked says:

Quote:

CCS will be releasing Version 5 beta of the CCS C Compiler in the upcoming months. We will be regularly rolling out new features with each beta release. Check back weekly to see "What is new now!"

We are looking for beta testers* and welcome any comments on features you would like to see most in Version 5.

*All customers with active maintenance are eligible to apply for Version 5 betas. All customers with active maintenance when V.5 is released will receive V.5 at no additional cost.


So, according to CCS, V5 has not yet been fully released - its available only as for beta testing at the users risk. So CCS are sure about beta too.

Now, I'm not saying that V4.141 will have the support for the device you need, nor am I making any gaurantees whatsoever for V4.141. Only CCS can do that, as we are NOT CCS, just CCS users. What I am saying is that if V5.xxx doesn't have the support, or its broken - it is beta after all and that's the sort of issue beta testing is intended to find - then report it to CCS and try V4.141 which is the current *fully released* version of CCS C.

RF Developer
Ttelmah



Joined: 11 Mar 2010
Posts: 19477

View user's profile Send private message

PostPosted: Wed May 08, 2013 3:40 am     Reply with quote

As a comment though, the header file fuse list, is only a text list to 'remind' you what fuses exist for the device. It is not the actual fuses used.
All that has happened, is that somebody has selected the actual fuses from an editor, and gone 'cut and paste' to make the list at the top of the file, and missed the first character off the list. So PLL, became 'LL'.

Look in fuses.txt which comes with the compiler, to see how to translate CCS names to Microchip names.
Unfortunately, it is common for the header to be wrong for a couple of releases after a chip is added. Your chip has only just been added, and differs from the older chips in it's PLL configuration, so email CCS, and point this out.

On internal oscillator frequency selection, if you look at the data sheet, on this chip, it is _not_ selectable by fuses. It is software settable only. So you use "setup_oscillator" after booting.
The data sheet says:
"• Program the FOSC<2:0> bits in Configuration
Words to select the INTOSC clock source, which
will be used as the default system clock upon a
device Reset.
• Write the SCS<1:0> bits in the OSCCON register
to switch the system clock source to the internal
oscillator during run-time. See Section 5.3 “CPU
Clock Divider”for more information."
Note "during run-time".
So the speed selection is done in software, not through fuses.

In fact if the compiler is handling this right, it'll set the value for you, if you just specify tbe clock rate and internal oscillator.

Best Wishes
jackmicro



Joined: 07 May 2013
Posts: 23

View user's profile Send private message

PostPosted: Wed May 08, 2013 8:44 am     Reply with quote

Thanks guys,

I understand that the fuses section is only comments, but thought the section was created automatically when choosing the fuses for the device using the pcw tool: so the actual fuses would follow the comment section and if the comments were wrong so would the fuses.

I'll replace my compiler with the latest stable version.
Will also double check the configuration for the internal oscillator during run time.

Guess I got it wrong...

Much appreciated.

Jack
jackmicro



Joined: 07 May 2013
Posts: 23

View user's profile Send private message

PostPosted: Sun May 12, 2013 1:01 pm     Reply with quote

Ttelmah wrote:
As a comment though, the header file fuse list, is only a text list to 'remind' you what fuses exist for the device. It is not the actual fuses used.
All that has happened, is that somebody has selected the actual fuses from an editor, and gone 'cut and paste' to make the list at the top of the file, and missed the first character off the list. So PLL, became 'LL'.

Look in fuses.txt which comes with the compiler, to see how to translate CCS names to Microchip names.
Unfortunately, it is common for the header to be wrong for a couple of releases after a chip is added. Your chip has only just been added, and differs from the older chips in it's PLL configuration, so email CCS, and point this out.

On internal oscillator frequency selection, if you look at the data sheet, on this chip, it is _not_ selectable by fuses. It is software settable only. So you use "setup_oscillator" after booting.
The data sheet says:
"• Program the FOSC<2:0> bits in Configuration
Words to select the INTOSC clock source, which
will be used as the default system clock upon a
device Reset.
• Write the SCS<1:0> bits in the OSCCON register
to switch the system clock source to the internal
oscillator during run-time. See Section 5.3 “CPU
Clock Divider”for more information."
Note "during run-time".
So the speed selection is done in software, not through fuses.

In fact if the compiler is handling this right, it'll set the value for you, if you just specify tbe clock rate and internal oscillator.

Best Wishes



* There is no FOSC fuse. That is the problem!!!

* Couldn't find the fuses.txt file in my installation. There is no such file.

* I can't download the production version of the compiler as it is asking for a NEW reference number when I enter mine.

I'm stuck!
dyeatman



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

View user's profile Send private message

PostPosted: Sun May 12, 2013 1:06 pm     Reply with quote

I have the beta version and the fuses.txt file is in the PICC directory in mine.
_________________
Google and Forum Search are some of your best tools!!!!
jackmicro



Joined: 07 May 2013
Posts: 23

View user's profile Send private message

PostPosted: Sun May 12, 2013 1:22 pm     Reply with quote

dyeatman wrote:
I have the beta version and the fuses.txt file is in the PICC directory in mine.


Do you have the complete pcw? maybe that is why.

No fuses on the command version, for sure.
jackmicro



Joined: 07 May 2013
Posts: 23

View user's profile Send private message

PostPosted: Sun May 12, 2013 2:37 pm     Reply with quote

jackmicro wrote:
dyeatman wrote:
I have the beta version and the fuses.txt file is in the PICC directory in mine.


Do you have the complete pcw? maybe that is why.

No fuses on the command version, for sure.


Deinstalled the compiler
Installed the demo. Extracted the fuses.txt file from the installation
Deinstalled the Demo
Reinstalled the compiler (beta, again, as it is the only one it allows me to download)

Yikes!
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