Trying to migrate to 18F..


Closed Thread
Results 1 to 30 of 30

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    It would really help to know which PIC you're compiling for, and which compiler you're
    using....

    Are you compiling for an 18F2550 or 18F2520?

    Are you actually compiling with PBP 2.50b, 2.47, 2.46...?
    Regards,

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

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


    Did you find this post helpful? Yes | No

    Default

    I probably shouldnt try to do anything serious at the middle of the night

    The pic is a 18F2520, and I have no idea why I choosed to post the include for 2550 ..probably too tired

    PBP is version 2.50b, HOWEVER the include states "Version: 2.47", I GUESS that this is normal however since I did a standard installation, but I installed it over my old installation, which I dont remember what version it was, but it can have been 2.46 or 2.47.

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


    Did you find this post helpful? Yes | No

    Default

    It's porobably 2.5. Not all include files are updated with each new version.

    If you try the example I posted above, with config settings in the code, then you'll need to comment the config settings in your 18F2520.INC file just like you did with your 18F2550.INC file.

    Then get some sleep...
    Regards,

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

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


    Did you find this post helpful? Yes | No

    Default

    Yes, I guess so too, no need for changing the version of the includes if nothing in them have been changed.

    and I comented out everything in the correct include, now it looks like:

    Code:
    ;****************************************************************
    ;*  18F2520.INC                                                 *
    ;*                                                              *
    ;*  By        : Leonard Zerman, Jeff Schmoyer                   *
    ;*  Notice    : Copyright (c) 2006 microEngineering Labs, Inc.  *
    ;*              All Rights Reserved                             *
    ;*  Date      : 06/05/06                                        *
    ;*  Version   : 2.47                                            *
    ;*  Notes     :                                                 *
    ;****************************************************************
            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_INTIO7_1H
    ;        __CONFIG    _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H
    ;        __CONFIG    _CONFIG3H, _PBADEN_OFF_3H
    ;        __CONFIG    _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
            NOLIST
        endif
            LIST
    EEPROM_START	EQU	0F00000h
    BLOCK_SIZE	EQU	64
    ..And the actual code look like:

    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
    ..And it compiled with no errors.

    The setup is just a PIC18F2520 with pin20 connected to +5V, 8/19 to gnd,
    a 10k resistor from pin1 (MCLR) to +5V, and two LED's connected via resistors
    from pin 26 (RB5) and 25 (RB4) I also added two cap's between Vcc and gnd,
    one 1uF and one 100nF.

    I also have a pickit2 connector wired up to usual pins.

    ..And now I'm going to the bed

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


    Did you find this post helpful? Yes | No

    Default

    I'm starting to suspect that this PIC is broken.. but its a bit strange that it's possible to program and verify it anyway.

    I'll see if I can buy another one tomorrow, but I dont think my local supplier have it in stock..

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