> -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf > Of toftat@cowshed.us > Sent: 26 July 2011 17:16 > To: piclist@mit.edu > Subject: [PIC] MPLAB X, Hitech-C and configuration bits >=20 > I am having an issue getting the configuration bits set properly in my > current project... >=20 > The project is based on the 18F2321 part, using the MPLAB-X IDE and going > to be written in Hitech C lite. I have defined my config bits in main.c as > follows: >=20 > __CONFIG(1, INTCLKO & FCMDIS & IESODIS & PWRTDIS & BORDIS & BORV46); > __CONFIG(2, WDTDIS & WDTPS32K & PBADDIS & LPT1DIS & MCLREN); > __CONFIG(3, DEBUGDIS & XINSTEN & STVREN & LVPDIS); >=20 > hoping to get the chip running on the internal oscillator with the clock > output, and most everything else disabled, unless I don't understand it at > which point I left it as default. >=20 > I am seeing 2.5v DC on the OSC pins rather than the expected square wave, > and the pin toggle that is later in the program doesn't occur either. The brownout and power on timer are located in config register 2; by adding them to config register 1 you have corrupted the oscillator setting. Unless HiTech changed the way they defined stuff in the later version I think the rest of your config settings are wrong as well! Have a look in the device datasheet under "Special Features of the CPU" to find out which bits are located in which register. The 18F2321 has 7 config registers to set. Regards Mike =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .