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 support@ccsinfo.com

Looking for CLOCKOUT fuse for 18F26K22

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



Joined: 03 Dec 2008
Posts: 184
Location: Gresham, OR USA

View user's profile Send private message Send e-mail Visit poster's website

Looking for CLOCKOUT fuse for 18F26K22
PostPosted: Sat Apr 27, 2013 11:25 am     Reply with quote

Does anyone know the fuse setting to get the clock output on OSC2?
Usually this is CLOCKOUT or CLKOUT but neither works. Just something I like to use so I can verify proper clock setting with my O-Scope. The .h file and FUSES.TXT have not provided any clues.
Thanks.
_________________
Jürgen
www.jgscraft.com
jeremiah



Joined: 20 Jul 2010
Posts: 1328

View user's profile Send private message

PostPosted: Sat Apr 27, 2013 11:58 am     Reply with quote

Just scanning through the list of fuses provided by the compiler it would depend on your oscillator setup. You should look at the fuses used to select the oscillator. Some have an _IO at the end of the name, which is what turns off the clock out. You would need to use a FUSE that doesn't have the _IO. If you are using the internal RC for example, it would be INTRC (INTRC_IO makes the pin I/O rather than clock out).

If you have the IDE take a look at the Valid Fuses tool.
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Sat Apr 27, 2013 12:03 pm     Reply with quote

the fuses do seem a bit inscrutable in CCS sometimes, as the spelling does not always match the data sheet

when i am faced with a problem like that -
and am in a HURRY ( which is usually )
i use my MEI PROGRAMMER to sort it out
(microEngineering Labs, Inc.)

the MEI ( micro engineering labs) , USB programmer has a wonderful drop down menu with VERY clear settings for ALL processor fuses.
decodes what the compiler inserted in the same language as the datasheet
and
best of all, it will let edit the HEX fuse line in the CCS hex source file to incorporate whatever fuses you want - interactively.


Last edited by asmboy on Sat Apr 27, 2013 1:28 pm; edited 1 time in total
jgschmidt



Joined: 03 Dec 2008
Posts: 184
Location: Gresham, OR USA

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Sat Apr 27, 2013 12:16 pm     Reply with quote

Thanks. I've gone through those, checked the fuse settings in the listing to see if I could reverse one, and still no joy. Here is my setup:
Code:
#include <18F26K22.h>
#FUSES INTRC         //Internal RC Osc, with output - doesn't work, CCS sets this back to INTRC_IO
#FUSES NOWDT         //No Watch Dog Timer
#FUSES NOPUT         //No Power Up Timer
#FUSES NOMCLR        //Engages weak pullup
#FUSES NOBROWNOUT    //No brownout reset
//#FUSES CLKOUT        //Check FOSC/4 on OSC2 - should be .125us - doesn't work

#use delay(internal=32M)

When I try INTRC, the compiler listing shows INTRC_IO so it appears CCS is overriding this for some reason.

PCWHD 4.135
_________________
Jürgen
www.jgscraft.com
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Apr 27, 2013 12:29 pm     Reply with quote

If your compiler version has a bug, the Config bits can be set manually.
See the posts near the end of this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=48366
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Sat Apr 27, 2013 12:30 pm     Reply with quote

YEP
CONFIG1H
BIT 0-3 set as

1001 = Internal oscillator block, CLKOUT function on OSC2

looks right - BUT how to get that set ??

not a fuse in the CCS list seems right for that bit of change.

you could try patching the HEX file - after compilation
jeremiah



Joined: 20 Jul 2010
Posts: 1328

View user's profile Send private message

PostPosted: Sat Apr 27, 2013 12:46 pm     Reply with quote

As an alternative, the manual suggests this example as a way to manually set fuses:
Code:

 #FUSES 1 = 0xC200 // sets config word 1 to 0xC200


Obviously change the number and the value to fit what you need. I haven't tested that to see how it works yet though.
dyeatman



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

View user's profile Send private message

PostPosted: Sat Apr 27, 2013 12:56 pm     Reply with quote

Quote:
#FUSES 1 = 0xC200 // sets config word 1 to 0xC200


That's a neat little gem I never noticed after all these years of RTM!
_________________
Google and Forum Search are some of your best tools!!!!
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Sat Apr 27, 2013 1:33 pm     Reply with quote

Hey, cool - never noticed that before. Added a "flag" to my manual on that one (for others, it is in the #FUSES section - pg 105 or there abouts)

mikey
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Sat Apr 27, 2013 2:03 pm     Reply with quote

In a simple flash the led program, where you do your normal fuses, as well as they can be done so far- calling for an INTernal oscillator with PLL off
and AFTER the normal #fuses statements
ADD
#FUSES 1 = 0x0900

what does it buy you ??
jgschmidt



Joined: 03 Dec 2008
Posts: 184
Location: Gresham, OR USA

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Sat Apr 27, 2013 5:00 pm     Reply with quote

Thanks, guys. I always enjoy and learn from these discussions.

I tried the #FUSES 1=0xF900.

First, the compiler didn't like spaces around the "=" sign
Second, in the listing it still forced F800 as the first fuse. In fact the FUSES override seems to not work at all.

Fortunately, I can set the bits manually with my PicKit2 and it's only for testing so no big deal. Just something that makes me wonder what other surprises await.

I even checked the configuration editor. It has the correct entry and value for the INTRC option. It just doesn't come through when compiled.

That's why we double, and then redouble, our software development time estimates, right?

Cheers,
_________________
Jürgen
www.jgscraft.com
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Sat Apr 27, 2013 5:12 pm     Reply with quote

thats why when in doubt - i rely on my programmer
to 'fixup' faulty fuses.

and not afraid to do that to a release version either - if thats what
it takes to push it across the finish line.
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