Configuration of 18F268x


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2009
    Location
    Ohio, USA
    Posts
    57

    Default Configuration of 18F268x

    I am currently working on a project with an 18F4550. 32k seemed like it would be enough program memory ... I purchased some 18F2682, 18F2680 and 18F2685, because of their enormous program memory. However, simple Serin2 & Serout2, SDA & SCL do not work.

    I did set the OSC in the 18F2680 as such
    Code:
    INCLUDE "P18F2680.INC"    ; MPASM  Header
            __CONFIG    _CONFIG1H,  _OSC_IRCIO67_1H 
            __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
            __CONFIG    _CONFIG3H, _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
            __CONFIG    _CONFIG4L, _LVP_OFF_4L
            NOLIST
    But even such statements like PORTB.1=1 do nothing...
    I have the INCLUDE "ALLDIGITAL.pbp"

    Any help would be great.

    Mike

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Configuration of 18F268x

    Are you writing in assembly language or PicBasic Pro?
    If PicBasic Pro, you should not include the MPASM header.

    Since MCLRE is ON, do you have a pull-up resistor on the MCLR pin?
    DT

  3. #3
    Join Date
    Jul 2009
    Location
    Ohio, USA
    Posts
    57


    Did you find this post helpful? Yes | No

    Default Re: Configuration of 18F268x

    Quote Originally Posted by Darrel Taylor View Post
    Are you writing in assembly language or PicBasic Pro?
    If PicBasic Pro, you should not include the MPASM header.

    Since MCLRE is ON, do you have a pull-up resistor on the MCLR pin?
    I am writing the program in PicBasic Pro... the above [code] is from the PBP file in my C drive.
    Yes I have a pull up resistor/diode on my MCLR

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Configuration of 18F268x

    Oh, you're modifying the 18F2680.inc file in your PBP folder, of an older version of PBP.

    _OSC_RCIO_1H
    is for an external RC oscillator.
    Do you have a resistor/capacitor circuit on your OSC pin?

    Or did you really want the Internal oscillator?
    _OSC_IRCIO67_1H

    You should also have _XINST_OFF_4L since PBP cannot use the extended instruction set.

    Try them like this ...
    Code:
            __CONFIG    _CONFIG1H, _OSC_IRCIO67_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
            __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
            __CONFIG    _CONFIG3H, _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
            __CONFIG    _CONFIG4L,  _STVREN_ON_4L & _LVP_OFF_4L & _BBSIZ_1024_4L & _XINST_OFF_4L
    Don't forget to set the OSCCON register or it will be running at the default 1Mhz.
    DT

  5. #5
    Join Date
    Jul 2009
    Location
    Ohio, USA
    Posts
    57


    Did you find this post helpful? Yes | No

    Default Re: Configuration of 18F268x

    Thank you, Thank you, & Thank you! Worked like a charm, I just moved some ports around and it took right off.
    Could you help me out with the Config fuses for the 18F2682 and 18F2685 while we are at it?

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Configuration of 18F268x

    I think they will be the same.

    But you might want to verify them in the bottom of the P18F2682.inc and P18F2685.inc files in your C:\Program Files\Microchip\MPASM Suite folder.

    C:\Program Files (x86)\Microchip\MPASM Suite - for 64-bit systems.
    DT

  7. #7
    Join Date
    Jul 2009
    Location
    Ohio, USA
    Posts
    57


    Did you find this post helpful? Yes | No

    Default Re: Configuration of 18F268x

    Ah yes...Nice to have the elbow room of 96K (program memory). At least this way I can start big and choose the correct size after I am done. Thanks again for your help.
    I have been getting better at finding just such information in the 400+ page data sheets

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts