Olin Lathrop wrote: > Never ever set the configuration bits from this menu. Always specify them > in the code else they may not end up in the HEX file. Use the configuration > bits menu to verify that the source code is setting the bits as you > intended. > That's good to know! I might assume you would want them in the code so that you (and others) know what was done at some future date. >> I'm >> new enough at this to not know what needs to be set (ie _MCLRE_ON & >> _CP_OFF & _WDT_OFF) as I might have done with a 16F84. >> > > There is no shortcut with the config bits. You have to go thru the manual > and decide which way you want every one of them. In general, leave the MCLR > pin in its MCLR role, for starters you can use the internal oscillator to > get the first LED blinking, always disable PGM, keep the watchdog off, and > don't turn on any of the code or read or write protection. > I'm certainly not against reading the datasheet. I do want to understand what the settings are for and how they might apply for what I'm trying to do - even if it's as simple as lighting an LED. I think it might be in my best interest to sacrifice an ink cartridge and print out all 400+ pages at least for my first 18F chip. >> CONFIG OSC=LP ;I'll use a 20MHz crystal at OSC1 & OSC2 >> > > For 20MHz you will need HS mode. LP is "low power", which uses a weaker > drive that won't work at 20MHz. > I overlooked that setting despite looking at the datasheet. :-) I see I can also choose the internal oscillator, which is probably adequate for lighting and flashing LEDs. Once I get a basic program working, I think I'll want to play around with various configurations to see if it affects the operation as my interpretation of the datasheet. > If you're going to be sticking to the 18F for a while, get a handful of > 10MHz crystals. That way you can run the PIC at its maximum speed of 40MHz > using the 4x PLL mode. > That's another mode I'll still need to read about. >> start >> CLRF PORTB ;initialize port B >> > > Labels start in column 1 and opcodes in column 2 or greater. > > Also, there are various analog peripherals multiplexed on many of the pins. > In general, every pin that could be analog wakes up that way. You should > probably just disable the A/D (and comparator ?) up front, then turn it on > in a module for that purpose later if you are using it. Just clearing TRIS > isn't necessarily enough to make a pin a usable output. > > To my credit, I did have the example in columns as you suggest. I think the plain text format of my post may have removed any tabs. Part of the problem I see as a beginner is not knowing about all the various modes of operation, such as A/D, comparator, etc. While I certainly agree that the datasheet is an indispensable reference, at 400 pages it's hard to know what all needs to be done, especially when starting out. Such and such a mode is possible, but is it necessary to enable / disable / don't care for what I'm trying to do? Such questions are probably answered, but I need to know such capabilities exist in the first place. >> I receive >> errors such as: Executable code and data must be defined in an >> appropriate section. I'll need to learn what that means. >> > > You need to read about the various assembler directives in the > MPASM/MPLIB/MPLINK manual. In this case you are missing a CODE directive, > but you need to read that manual anyway because there are a lot more > directives you will bump into. > > Now that is something I'll look at! I know in my failed example, I used binary in the code. I'm sure that could just as easily be expressed in hex, though I find the binary easier at a glance to see which setting is affected. Thank you for the help and suggestions. Joe -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist