Trying to migrate to 18F..


Closed Thread
Results 1 to 30 of 30

Hybrid View

  1. #1
    Join Date
    Sep 2008
    Location
    Stockholm
    Posts
    80


    Did you find this post helpful? Yes | No

    Default

    scalerobotics: Yes, I have looked at that, but still, for example that include mentions:

    _BOREN_OFF_2L

    ..But if I include that in my PBP program I get a "symbol previosly not defined" error from mpasmwin:

    Error[113] C:\PBP\LTIMERT.ASM 70 : Symbol not previously defined (_BOREN_OFF_2L)

    acetronics: Same with that, a good example is the _BOREN_OFF_2L that does not work ?

    Just an example of working configbits for internal oscillator that works on 20MHz would be great, then I could try things after that, but now I cant even get the damned thing to run..

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Glenn View Post

    Just an example of working configbits for internal oscillator that works on 20MHz would be great, then I could try things after that, but now I cant even get the damned thing to run..
    Section 2.6 datasheet.
    section 2.64 " "
    32 mhz is your speed limit using PLL and internal osc.
    Set it up in OSCCON register
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Sep 2008
    Location
    Stockholm
    Posts
    80


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    Section 2.6 datasheet.
    section 2.64 " "
    32 mhz is your speed limit using PLL and internal osc.
    Set it up in OSCCON register
    Well, at maximum I presume ? actually I don't really understand what they mean exactly in that part of the datasheet, I would belive that I set one speed on the oscillator, and then the PLL multiplies it ? then 8x4 would give 32Mhz ? ..Ofcourse that would give me troubles to get excactly 20Mhz then, but still, it would work I think ? (but for exampe, "pause 1000" would not be one second)

    Anyway, I could use another clock frequency too, the main reason to use 20Mhz is that I tried the same program on a 16f PIC with no internal oscillator, and then I used a 20Mhz xtal.

    Quote Originally Posted by Joe S. View Post
    Did you write it @ __CONFIG _CONFIG1H, _OSC_INTIO67_1H & _FCMEN_OFF_1H & _IESO_OFF_1H ; enable int osc, disable failsafe osc enable, disable internal external switchover ?
    As for ' , is a PBP compiler directive, whereas ; directs both compiler and assembler
    I simply wrote:

    @ __CONFIG _CONFIG1H, _OSC_INTIO67_1H & _FCMEN_OFF_1H & _IESO_OFF_1H

    with no comment at all..

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    I don't have an 18F2520 to test this on, but give this a try;
    Code:
    asm
      __CONFIG _CONFIG1H, _OSC_INTIO67_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
      __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H
      __CONFIG _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_OFF_3H
      __CONFIG _CONFIG4L, _STVREN_OFF_4L & _LVP_OFF_4L & _XINST_OFF_4L
    endasm
            
    DEFINE OSC 32     ' internal 8MHz x 4 with PLL enabled
    
    blueled var LATB.4 ' prevents read-modify-write
    redled  var LATB.5 ' problems
    
    OSCTUNE = %0100000 ' turn on PLL for 4 x 8MHz
    OSCCON = %01110000 ' set 8MHz internal osc
    ADCON1 = %00001111 ' disable all A/D
    
    main:
      low redled
      low blueled
      pause 500
      high redled
      pause 500
      high blueled
      pause 500
      goto main
      
      END
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    Join Date
    Sep 2008
    Location
    Stockholm
    Posts
    80


    Did you find this post helpful? Yes | No

    Default

    bruce:

    I get this..

    Warning[230] C:\PBP\LTIMERT3.ASM 64 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
    Error[113] C:\PBP\LTIMERT3.ASM 64 : Symbol not previously defined (_OSC_INTIO67_1H)
    Warning[230] C:\PBP\LTIMERT3.ASM 65 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
    Warning[230] C:\PBP\LTIMERT3.ASM 66 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
    Error[113] C:\PBP\LTIMERT3.ASM 66 : Symbol not previously defined (_CCP2MX_PORTC_3H)
    Warning[230] C:\PBP\LTIMERT3.ASM 67 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.

  6. #6
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Glenn,

    Newer versions of PBP include w = -230 in the .INC file that gets rid of the deprecated
    warning.

    I.E. a new version .INC file looks something like this if you have the default config settings
    commented out.

    Code:
       NOLIST
        ifdef PM_USED
            LIST
            "Error: PM does not support this device.  Use MPASM."
            NOLIST
        else
            LIST
            LIST p = 18F2520, r = dec, w = -311, w = -230, f = inhx32
            INCLUDE "P18F2520.INC"   ; MPASM  Header
           ; __CONFIG _CONFIG1H, _OSC_INTIO67_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
           ; __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H
           ; __CONFIG _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
           ; __CONFIG _CONFIG4L, _STVREN_OFF_4L & _LVP_OFF_4L & _XINST_OFF_4L
            NOLIST
        endif
            LIST
    EEPROM_START	EQU	0F00000h
    BLOCK_SIZE	EQU	64
    These are all you have commented out right? What version of PBP are you using?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  7. #7
    Join Date
    Sep 2008
    Location
    Stockholm
    Posts
    80


    Did you find this post helpful? Yes | No

    Default

    I'm using 2.50b, and my include looks like:

    Code:
    ;****************************************************************
    ;*  18F2550.INC                                                 *
    ;*                                                              *
    ;*  By        : Leonard Zerman, Jeff Schmoyer                   *
    ;*  Notice    : Copyright (c) 2004 microEngineering Labs, Inc.  *
    ;*              All Rights Reserved                             *
    ;*  Date      : 12/31/04                                        *
    ;*  Version   : 2.46                                            *
    ;*  Notes     :                                                 *
    ;****************************************************************
            NOLIST
        ifdef PM_USED
            LIST
            "Error: PM does not support this device.  Use MPASM."
            NOLIST
        else
            LIST
            LIST p = 18F2550, r = dec, w = -311, f = inhx32
            INCLUDE "P18F2550.INC"	; MPASM  Header
            ;__CONFIG    _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
            ;__CONFIG    _CONFIG1H, _FOSC_HS_1H
            ;__CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
            ;__CONFIG    _CONFIG3H, _PBADEN_OFF_3H
            ;__CONFIG    _CONFIG4L, _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L
            NOLIST
        endif
            LIST
    EEPROM_START	EQU	0F00000h
    BLOCK_SIZE	EQU	32
    However, its not the warings that I have problems with, its the errors

Similar Threads

  1. 16F to 18F transition pains
    By lurker in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th December 2008, 01:35
  2. 18F Config fuses
    By Angus Anderson in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 18th December 2007, 15:59
  3. Super easy 18F print strings to UART
    By Bruce in forum Code Examples
    Replies: 0
    Last Post: - 26th August 2007, 23:19
  4. Upgrading 16F to 18F
    By Ron Marcus in forum General
    Replies: 1
    Last Post: - 29th March 2006, 09:44
  5. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30

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