Bob and David, Thank you both very much! It took a few moments to locate the proper file. The 16f690 datasheet covers several devices, and the proper Hi-Tech file was the 16F685. As you both stated, everything I need to know for the configuration word is in this file. Now I'm curious as to how this pic16F685.h file is called by '#include' Does the compiler choose from the device selection during project setup? Joe -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of David Meiklejohn Sent: Sunday, February 08, 2009 7:17 PM To: Microcontroller discussion list - Public. Subject: Re: [PIC] Configuration Bits with Hi-Tech Compiler Joe Bento wrote: > > It can get frustrating trying to track down information when one is > learning. This is true - which is one reason I started writing tutorials - but even when someone like me tries to write a guide, it doesn't always help, because there is simply a lot of information to take in. For C programming using HI-TECH C on a 16F690, I can refer you to my midrange C tutorials (http://www.gooligum.com.au/tut_midrange_C.html), where the answer to your question is to be found in lesson 1. But you might say that it's buried... > If I were writing this program from scratch, how would I know, and where > would I find 'DIS' for 'MCLRDIS' ? I searched on the web, and I see that > If > wanted MCLR enabled, the command is 'MCLREN'. No mention that I can see in > the manual. > > Since it's apparently related to the compiler, I don't expect to see the > reference in the datasheet, but the compiler manual itself seems devoid of > explanation. You are right that this isn't covered in the manual, because it's processor dependent. It's in the include files. Here's the relevant section from my tutorial (saves me writing the same thing again...) - see the last line: -------- The symbols relevant to specific processors are defined in include files. But instead of including a specific file, as we would do in assembler, it is normal to include a single "catch-all" file: "htc.h". This file identifies the processor being used, and then calls other include files as appropriate. So our next line, which should be at the start of every HI-TECH C program, is: #include To set the processor configuration, a macro called '__CONFIG(x)' is used, in a very similar way to the __CONFIG directive in MPASM: // Config: ext reset, no code protect, no brownout detect, no watchdog, // power-up timer enabled, 4MHz int clock __CONFIG(MCLREN & UNPROTECT & BORDIS & WDTDIS & PWRTEN & INTIO); Note that the configuration symbols used are different to those defined in the MPASM include files. For example, 'MCLREN' instead of '_MCLRE_ON', and 'INTIO' instead of '_INTRC_OSC_NOCLKOUT'. To see which symbols to use for a given MCU, you need to look in the appropriate include file. For example, in this case (for the 12F629), these symbols are defined in the "pic126x.h" file, found in the "include" directory within the compiler install directory. -------- For the 16F690, you need to find the appropriate header file, and that means hunting in the include directory, within the HI-TECH C installation. The config symbols are defined there. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist