On Sun, Jan 4, 2009 at 7:16 PM, Joseph Bento wrote: > OK, I'm reviewing some documentation for the 18F2620. I'm going to > try and avoid printing 412 pages of documentation, so for the time > being I'll refer to the pdf datasheet as needed. > > I created a new project in MPLAB, and am going to begin using the > MPASM tool suite. I've copied the template file for the 18F2620 and > renamed it simply, "blinky" as a basis to begin my project. > > One thing I immediately see that appears different from the 16F series > is how the configuration bits are defined > > ;Configuration bits > ;Microchip has changed the format for defining the configuration bits, > please > ;see the .inc file for futher details on notation. Below are a few > examples. > > (I don't know where to find this 'inc' file mentioned) > > ; Oscillator Selection: > CONFIG OSC = LP ;LP > > (OK, I can see this means 'low-powered crystal'. ) > > So far, so good. On the pull down menu, however, under 'configure, > configuration bits' there is a check box to either set the bits in > code (default, it seems) or to select from the individual fields. 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. If I am > understanding these functions, it appears I would set them the same > way as I did previously, and if the default condition is correct, no > further action needs to be done. I might assume that setting the bits > in code is preferred over the pull down configuration to allow you as > well as anyone else to see what is configured. > > Bear with me here... I'm trying this out on paper before ever > plugging anything into the breadboard. > > I want to light a single LED on RB0 of the 18F2620. > > list p=18F2620 > #include > > CONFIG OSC=LP ;I'll use a 20MHz crystal at OSC1 & OSC2 > > > start > CLRF PORTB ;initialize port B > MOVLW b'11111110' ;configure RB0 as output > MOVWF TRISB > MOVLW b'00000001' ;set RB0 high > MOVWF TRISB > > goto $ > > > As Olin suggests, I came up with this by quickly looking at sections > of the datasheet. Much extensive study is obviously required. My > next step should be to see if this compiles - IT DOESN'T. I receive > errors such as: Executable code and data must be defined in an > appropriate section. I'll need to learn what that means. > > At any rate, if someone can let me know if I'm on the right track to > start. > > Thanks. > > Joe > I also have a bunch of 18F2620 that I haven't even touched yet. Also have two C compilers for them. I am as interested as you are in these things. Try this: list p=18F2620 #include CONFIG OSC=LP ;I'll use a 20MHz crystal at OSC1 & OSC2 start code CLRF PORTB ;initialize port B MOVLW b'11111110' ;configure RB0 as output MOVWF TRISB MOVLW b'00000001' ;set RB0 high MOVWF TRISB goto $ -- solarwind -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist