Announcement

Collapse
No announcement yet.

Help 18f26k22 and icd no work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Hello

    No... No work

    Comment


    • #17
      my code and icd model
      Code:
      '****************************************************************
      '*  Name    : UNTITLED.BAS                                      *
      '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
      '*  Notice  : Copyright (c) 2012 [select VIEW...EDITOR OPTIONS] *
      '*          : All Rights Reserved                               *
      '*  Date    : 12/21/2012                                        *
      '*  Version : 1.0                                               *
      '*  Notes   :                                                   *
      '*          :                                                   *
      '****************************************************************
      #CONFIG
        CONFIG  FOSC = INTIO67
        CONFIG  PLLCFG = ON
        CONFIG  PRICLKEN = OFF
        CONFIG  FCMEN = OFF
        CONFIG  IESO = OFF
        CONFIG  PWRTEN = OFF
        CONFIG  BOREN = SBORDIS
        CONFIG  BORV = 190
        CONFIG  WDTEN = ON
        CONFIG  WDTPS = 32768
        CONFIG  CCP2MX = PORTC1
        CONFIG  PBADEN = OFF
        CONFIG  CCP3MX = PORTB5
        CONFIG  HFOFST = ON
        CONFIG  T3CMX = PORTC0
        CONFIG  P2BMX = PORTB5
        CONFIG  MCLRE = EXTMCLR
        CONFIG  STVREN = ON
        CONFIG  LVP = OFF
        CONFIG  XINST = OFF
        CONFIG  DEBUG = OFF
        CONFIG  CP0 = OFF
        CONFIG  CP1 = OFF
        CONFIG  CP2 = OFF
        CONFIG  CP3 = OFF
        CONFIG  CPB = OFF
        CONFIG  CPD = OFF
        CONFIG  WRT0 = OFF
        CONFIG  WRT1 = OFF
        CONFIG  WRT2 = OFF
        CONFIG  WRT3 = OFF
        CONFIG  WRTC = OFF
        CONFIG  WRTB = OFF
        CONFIG  WRTD = OFF
        CONFIG  EBTR0 = OFF
        CONFIG  EBTR1 = OFF
        CONFIG  EBTR2 = OFF
        CONFIG  EBTR3 = OFF
        CONFIG  EBTRB = OFF
      #ENDCONFIG
              ANSELB=0
               ANSELC=0
               DEFINE OSC 64 
               OSCCON=$70
               OSCTUNE.6=1
              TRISB = %01011111
              TRISC = %11111111  
              led var latb.5
         main:
         led=!led
         pause 1000
         goto main
      Attached Files

      Comment


      • #18
        hello

        Well I do not understand, I copied everything as is, and continues with the same error.

        Also transfer the program with the boot loader?

        Comment


        • #19
          i'm not using a bootloader

          here is my icd file
          Attached Files

          Comment


          • #20
            Ok, now it works. but I have had to record with the programmer, not the
            UMC boot loader.
            Last edited by FRAN2000; 07-04-2016, 04:05 AM.

            Comment


            • #21
              UMC boot loader does not work properly.

              Comment


              • #22
                You know how I can configure the boot loader UMC. correctly so that
                work with this pic

                Comment


                • #23
                  the configuration file take it from
                  *
                  http://www.mecanique-web.co.uk/downl.../build-config/

                  It is a problem of boot loader'll have to contact mecanique,
                  program the device but then the icd not start.
                  Last edited by FRAN2000; 07-04-2016, 04:38 AM.

                  Comment


                  • #24
                    if this is your bootloader ini file then there are some conflicts and unnecessary stuff and some stuff missing like
                    osccon=0x70 etc

                    [USERCODE]
                    movlb 0x0F ; MANDATORY: BSR set to SFR bank
                    movlw b'00000000'
                    movwf ANSELC ; MANDATORY: analog off on port C
                    movlw 0x70
                    movwf OSCCON
                    bsf OSCTUNE,6

                    Code:
                    ; optional path information - default output folder is 
                    ; user documents -> umcbuild... 
                    [PATH] 
                    Output=$app\firmware 
                    ; source code files... 
                    [TEMPLATE] 
                    PIC16=..\src\16F\umc_loader.asm 
                    PIC18=..\src\18F\umc_loader.asm 
                    [USART] BAUDRATE=19200 BRGH=1 BRG16=1 
                    ; device name and OSC... 
                    [MCU] Device=18F26K22[COLOR="#FF0000"] OSC=20000000 [/COLOR]; device configuration settings... 
                    [CONFIG] 
                    config FOSC = HSHP ; HS oscillator (high power > 16 MHz) 
                    config [COLOR="#FF0000"]PLLCFG = OFF ; 4xPLL Disabled (direct oscillator)[/COLOR] 
                    config PRICLKEN = ON ; Primary clock Enabled 
                    config FCMEN = OFF ; Fail-Safe Clock Disabled 
                    config IESO = OFF ; Oscillator Switchover Disabled 
                    config PWRTEN = ON ; Powerup Timer Enabled 
                    config HFOFST = OFF ; HFINTOSC delayed until oscillator stable 
                    config BOREN = ON ; Brown Out Detector Enabled 
                    config BORV = 250 ; VBOR set to 2.50 V nominal 
                    config WDTEN = ON ; WDT Enabled; SWDTEN bit has no effect 
                    config WDTPS = 512 ; WDT = 1:512 = 2048 ms 
                    config CCP2MX = PORTB3 ; CCP2 i/o is multiplexed with RB3 (not RC1) 
                    config CCP3MX = PORTB5 ; P3A/CCP3 i/o is multiplexed with RB5 (not RC6) 
                    config T3CMX = PORTB5 ; T3CKI is on RB5 (not RC0) 
                    config P2BMX = PORTC0 ; ECCP2 P2B is on RC0 (not RB5) 
                    config PBADEN = OFF ; PORTB<5:0> pins configured as digital i/o (not analog) 
                    config MCLRE = INTMCLR config STVREN = ON ; Stack Overflow Reset Enabled 
                    config XINST = OFF ; Extended Instructions Disabled 
                    config LVP = OFF ; Low-Voltage-Programming Disabled 
                    config CP0 = OFF ;Code Protect 00800-03FFF 
                    config CP1 = OFF ;Code Protect 04000-07FFF 
                    config CP2 = OFF ;Code Protect 08000-0BFFF 
                    config CP3 = OFF ;Code Protect 0C000-0FFFF 
                    config CPB = OFF ;Code Protect Boot 
                    config CPD = OFF ;Data EE Read Protect 
                    config WRT0 = OFF ;Table Write Protect 00800-03FFF 
                    config WRT1 = OFF ;Table Write Protect 04000-07FFF 
                    config WRT2 = OFF ;Table Write Protect 08000-0BFFF 
                    config WRT3 = OFF ;Table Write Protect 0C000-0FFFF 
                    config WRTC = OFF ;Config. Write Protect 
                    config WRTB = OFF ;Table Write Protect Boot 
                    config WRTD = OFF ;Data EE Write Protect 
                    config EBTR0 = OFF ;Table Read Protect 00800-03FFF 
                    config EBTR1 = OFF ;Table Read Protect 04000-07FFF 
                    config EBTR2 = OFF ;Table Read Protect 08000-0BFFF 
                    config EBTR3 = OFF ;Table Read Protect 0C000-0FFFF 
                    config EBTRB = OFF ;Table Read Protect Boot 
                    ; place startup code in here... 
                    [USERCODE] 
                    movlb 0x0F ; MANDATORY: BSR set to SFR bank 
                    movlw b'00000000' 
                    movwf ANSELC ; MANDATORY: analog off on port C 
                    [COLOR="#FFFF00"][/COLOR][COLOR="#FF0000"]movlw b'00000000' 
                    movwf ADCON0 ; not necessary, but adc off [/COLOR]
                    [COLOR="#FF0000"]movlw b'10111111' 
                    movwf TRISC ; not necessary, but tx pin RC6 as output[/COLOR]
                    Last edited by richard; 07-04-2016, 06:00 AM.

                    Comment


                    • #25
                      Hello

                      Hello, are two files involved in creating boot:

                      1 umcbuild.ini
                      2 umc_loader.asm


                      It would stay like that.

                      It is right?



                      1 umcbuild.ini ------------------------------------------

                      [USART]
                      BAUDRATE=19200
                      BRGH=1
                      BRG16=1

                      ; device name and OSC...
                      [MCU]
                      Device=18F26K22
                      OSC=20000000


                      ; device configuration settings...
                      [CONFIG]
                      config FOSC = HSHP ; HS oscillator (high power > 16 MHz)
                      config PLLCFG = OFF ; 4xPLL Disabled (direct oscillator)
                      config PRICLKEN = ON ; Primary clock Enabled
                      config FCMEN = OFF ; Fail-Safe Clock Disabled
                      config IESO = OFF ; Oscillator Switchover Disabled
                      config PWRTEN = ON ; Powerup Timer Enabled
                      config HFOFST = OFF ; HFINTOSC delayed until oscillator stable
                      config BOREN = ON ; Brown Out Detector Enabled
                      config BORV = 250 ; VBOR set to 2.50 V nominal
                      config WDTEN = ON ; WDT Enabled; SWDTEN bit has no effect
                      config WDTPS = 512 ; WDT = 1:512 = 2048 ms
                      config CCP2MX = PORTB3 ; CCP2 i/o is multiplexed with RB3 (not RC1)
                      config CCP3MX = PORTB5 ; P3A/CCP3 i/o is multiplexed with RB5 (not RC6)
                      config T3CMX = PORTB5 ; T3CKI is on RB5 (not RC0)
                      config P2BMX = PORTC0 ; ECCP2 P2B is on RC0 (not RB5)
                      config PBADEN = OFF ; PORTB<5:0> pins configured as digital i/o (not analog)
                      config MCLRE = INTMCLR
                      config STVREN = ON ; Stack Overflow Reset Enabled
                      config XINST = OFF ; Extended Instructions Disabled
                      config LVP = OFF ; Low-Voltage-Programming Disabled
                      config CP0 = OFF ;Code Protect 00800-03FFF
                      config CP1 = OFF ;Code Protect 04000-07FFF
                      config CP2 = OFF ;Code Protect 08000-0BFFF
                      config CP3 = OFF ;Code Protect 0C000-0FFFF
                      config CPB = OFF ;Code Protect Boot
                      config CPD = OFF ;Data EE Read Protect
                      config WRT0 = OFF ;Table Write Protect 00800-03FFF
                      config WRT1 = OFF ;Table Write Protect 04000-07FFF
                      config WRT2 = OFF ;Table Write Protect 08000-0BFFF
                      config WRT3 = OFF ;Table Write Protect 0C000-0FFFF
                      config WRTC = OFF ;Config. Write Protect
                      config WRTB = OFF ;Table Write Protect Boot
                      config WRTD = OFF ;Data EE Write Protect
                      config EBTR0 = OFF ;Table Read Protect 00800-03FFF
                      config EBTR1 = OFF ;Table Read Protect 04000-07FFF
                      config EBTR2 = OFF ;Table Read Protect 08000-0BFFF
                      config EBTR3 = OFF ;Table Read Protect 0C000-0FFFF
                      config EBTRB = OFF ;Table Read Protect Boot

                      ; place startup code in here...
                      [USERCODE]
                      movlb 0x0F ; MANDATORY: BSR set to SFR bank
                      movlw b'00000000'
                      movwf ANSELC ; MANDATORY: analog off on port C
                      movlw 0x70
                      movwf OSCCON
                      bsf OSCTUNE,6







                      2 umc_loader.asm ------------------------------------------------------------------------------------------------

                      This is attached in zip
                      Attached Files

                      Comment


                      • #26
                        Works for me , bootloader config must match program config and the actual hardware

                        config.ini

                        Code:
                        ; optional path information - default output folder is 
                        ; user documents -> umcbuild... 
                        [PATH] 
                        Output=C:\MYBOOTLOADER
                        ; source code files... 
                        [TEMPLATE] 
                        PIC16=..\src\16F\umc_loader.asm 
                        PIC18=..\src\18F\umc_loader.asm 
                        [USART] 
                        BAUDRATE=115200 BRGH=1 BRG16=1 
                        ; device name and OSC... 
                        [MCU] 
                        Device=18F26K22 
                        OSC=64000000 
                        ; device configuration settings... 
                        [CONFIG] 
                        config FOSC = INTIO67
                        config PLLCFG = ON
                        config PRICLKEN = ON ; Primary clock Enabled 
                        config FCMEN = OFF ; Fail-Safe Clock Disabled 
                        config IESO = OFF ; Oscillator Switchover Disabled 
                        config PWRTEN = ON ; Powerup Timer Enabled 
                        config HFOFST = OFF ; HFINTOSC delayed until oscillator stable 
                        config BOREN = ON ; Brown Out Detector Enabled 
                        config BORV = 250 ; VBOR set to 2.50 V nominal 
                        config WDTEN = ON ; WDT Enabled; SWDTEN bit has no effect 
                        config WDTPS = 512 ; WDT = 1:512 = 2048 ms 
                        config CCP2MX = PORTB3 ; CCP2 i/o is multiplexed with RB3 (not RC1) 
                        config CCP3MX = PORTB5 ; P3A/CCP3 i/o is multiplexed with RB5 (not RC6) 
                        config T3CMX = PORTB5 ; T3CKI is on RB5 (not RC0) 
                        config P2BMX = PORTC0 ; ECCP2 P2B is on RC0 (not RB5) 
                        config PBADEN = OFF ; PORTB<5:0> pins configured as digital i/o (not analog) 
                        config MCLRE = INTMCLR 
                        config STVREN = ON ; Stack Overflow Reset Enabled 
                        config XINST = OFF ; Extended Instructions Disabled 
                        config LVP = OFF ; Low-Voltage-Programming Disabled 
                        config CP0 = OFF ;Code Protect 00800-03FFF 
                        config CP1 = OFF ;Code Protect 04000-07FFF 
                        config CP2 = OFF ;Code Protect 08000-0BFFF 
                        config CP3 = OFF ;Code Protect 0C000-0FFFF 
                        config CPB = OFF ;Code Protect Boot 
                        config CPD = OFF ;Data EE Read Protect 
                        config WRT0 = OFF ;Table Write Protect 00800-03FFF 
                        config WRT1 = OFF ;Table Write Protect 04000-07FFF 
                        config WRT2 = OFF ;Table Write Protect 08000-0BFFF 
                        config WRT3 = OFF ;Table Write Protect 0C000-0FFFF 
                        config WRTC = OFF ;Config. Write Protect 
                        config WRTB = OFF ;Table Write Protect Boot 
                        config WRTD = OFF ;Data EE Write Protect 
                        config EBTR0 = OFF ;Table Read Protect 00800-03FFF 
                        config EBTR1 = OFF ;Table Read Protect 04000-07FFF 
                        config EBTR2 = OFF ;Table Read Protect 08000-0BFFF 
                        config EBTR3 = OFF ;Table Read Protect 0C000-0FFFF 
                        config EBTRB = OFF ;Table Read Protect Boot 
                        ; place startup code in here... 
                        [USERCODE] 
                        movlb 0x0F ; MANDATORY: BSR set to SFR bank 
                        movlw b'00000000' 
                        movwf ANSELC ; MANDATORY: analog off on port C 
                        movlw 0x70 
                        movwf OSCCON
                        bsf   OSCTUNE,6

                        Comment


                        • #27
                          Hello

                          And in the file umc_loader.asm must also match the settings


                          I modified or not.





                          ;*****************************************************************************
                          ;* Name : umc_loader.asm *
                          ;* Author : David John Barker *
                          ;* Date : 04/08/2011 *
                          ;* Version : 1.0 - Initial release *
                          ;* : BETA CHANGES *
                          ;* : 26-08-2011 - check for TXSTA1 rather than TXSTA *
                          ;* : 26-08-2011 - added SPBRG_ and SPBRGH_ *
                          ;* : 17-08-2011 - check for EEPGD *
                          ;* - added #ifdef ENABLE_EEPROM_READ *
                          ;* : 10-08-2011 - BAUDCON_, BRG16 *
                          ;* : - TXSTA_, TRMT *
                          ;* : 15-08-2011 - clrf TBLPTRU *
                          ;* Notes : Parts of this code based around the Tiny Bootloader *
                          ;* : [email protected] *
                          ;* : http://www.etc.ugal.ro/cchiculita/so...bootloader.htm *
                          ;*****************************************************************************
                          radix DEC ; default radix is DECIMAL

                          ;=============================================================================
                          ; USER CONFIGURATION SECTION
                          ;=============================================================================
                          processor 18F26K22
                          #define DEVICE_CLOCK 20000000 <---------------------------------------------------------------------64000000?
                          #define BAUDRATE 19200 <---------------------------------------------------------------------115200?

                          ; insert any device specific information inside here - for example, some
                          ; devices (such as the 18F1220) the USART pins default to analog and so must be
                          ; set to digital for comms to work - insert any device configuration data here...
                          UserConfig macro
                          ANSELC=0
                          endm

                          ; set your configuration fuses here - this will change
                          ; from device to device... HS
                          config OSC = HS <--------------------------------------------------------------INTIO67??
                          config OSCS = OFF
                          config PWRT = ON
                          config BOR = ON
                          config BORV = 20
                          config WDT = OFF
                          config LVP = OFF
                          config DEBUG = OFF

                          ; it's not recommended you change these options unless you know what you
                          ; are doing...
                          #define DEFAULT_BAUDRATE 19200 ; initial startup baudrate (default is 19200)
                          #define USE_BRGH 1 ; high baudrate select (default is ON)
                          #define USE_BRGH16 0 ; 16 bit SPBRG support (default is OFF)

                          ; import the device information file - you may need to add devices
                          ; to this file...
                          #include devices.inc
                          ;=============================================================================
                          ; END USER CONFIGURATION SECTION
                          ;=============================================================================

                          ; BRG16 BRGH USARTMODE FORMULA
                          ; 0 0 8 Bit (OSC / BAUDRATE / 64) - 1
                          #if (USE_BRGH16 == 0) && (USE_BRGH == 0)
                          #define MULT 64
                          #define TXSTA_VALUE 0x20
                          #endif

                          ; BRG16 BRGH USARTMODE FORMULA
                          ; 0 1 8 Bit (OSC / BAUDRATE / 16) - 1
                          #if (USE_BRGH16 == 0) && (USE_BRGH == 1)
                          #define MULT 16
                          #define TXSTA_VALUE 0x24
                          #endif

                          ; BRG16 BRGH USARTMODE FORMULA
                          ; 1 0 16 Bit (OSC / BAUDRATE / 4) - 1
                          #if (USE_BRGH16 == 1) && (USE_BRGH == 0)
                          #define MULT 4
                          #define TXSTA_VALUE 0x20
                          #endif

                          ; BRG16 BRGH USARTMODE FORMULA
                          ; 1 1 16 Bit (OSC / BAUDRATE / 4) - 1
                          #if (USE_BRGH16 == 1) && (USE_BRGH == 1)
                          #define MULT 4
                          #define TXSTA_VALUE 0x24
                          #endif

                          ; formula is (OSC / BAUDRATE / MULT) - 1. However, we need to round the result
                          ; so that the SPBRG value is correct
                          #define MULT_DIV_2 MULT / 2
                          #define DEFAULT_SPBRG_VALUE ((DEVICE_CLOCK / DEFAULT_BAUDRATE + MULT_DIV_2) / MULT - 1)
                          #define USER_SPBRG_VALUE ((DEVICE_CLOCK / BAUDRATE + MULT_DIV_2) / MULT - 1)
                          #define PIR_ PIR1
                          #define RCIF_ RCIF
                          #define TXIF_ TXIF

                          ; alias USART registers - names will change if the device
                          ; has more than one USART...
                          #ifdef TXSTA1 ; (26-08-2011)
                          #define TXSTA_ TXSTA1
                          #define RCSTA_ RCSTA1
                          #define SPBRG_ SPBRG1
                          #define SPBRGH_ SPBRGH1
                          #define TXREG_ TXREG1
                          #define RCREG_ RCREG1
                          #define BAUDCON_ BAUDCON1
                          #else
                          #define TXSTA_ TXSTA
                          #define RCSTA_ RCSTA
                          #define SPBRG_ SPBRG
                          #define SPBRGH_ SPBRGH
                          #define TXREG_ TXREG
                          #define RCREG_ RCREG
                          #define BAUDCON_ BAUDCON
                          #endif

                          ; set the minimum loader size...
                          #define LOADER_SIZE_MIN 384
                          #define LOADER_SIZE LOADER_SIZE_MIN

                          ; if the loader size is not an integer multiple of the erase block size, we
                          ; need to set the loader size so it falls on an erase block boundary. For example
                          ; EraseBlock == 64, LoaderSize := 384 (6 * 64) - no change needed
                          ; EraseBlock == 128, LoaderSize := 384 (3 * 128) - change needed
                          ; EraseBlock == 1024, LoaderSize := 1024 (1 * 1024) - change needed
                          #if DEVICE_BLOCK_ERASE > 0 ; if zero, then ignore
                          #if LOADER_SIZE % DEVICE_BLOCK_ERASE > 0 ; if modulus not zero, we need a new loader size
                          #undefine LOADER_SIZE
                          #define LOADER_SIZE DEVICE_BLOCK_ERASE * (LOADER_SIZE_MIN / DEVICE_BLOCK_ERASE + 1)
                          #endif
                          #endif

                          ; now create the loader and user code origin...
                          #define ORG_LOADER DEVICE_ROM - LOADER_SIZE
                          #define ORG_LOADER_USER ORG_LOADER - 8

                          ; loader commands - these are bit field identifiers
                          ; data input values are shown in comments
                          #define CMD_EEPROM_READ 0x00 ; 0x01
                          #define CMD_EEPROM_WRITE 0x01 ; 0x02
                          #define CMD_ROM_ERASE 0x02 ; 0x04
                          #define CMD_ROM_READ 0x03 ; 0x08
                          #define CMD_ROM_WRITE 0x04 ; 0x10
                          #define CMD_BAUDRATE 0x05 ; 0x20

                          ; addition information and commands...
                          #define FIRMWARE_VERSION 0x10
                          #define LOADER_CONNECT 0x80
                          #define LOADER_ACK LOADER_CONNECT
                          #define LOADER_GO 0x81
                          #define LOADER_ERROR_CRC 0x8A
                          #define LOADER_ERROR_VERIFY 0x8B

                          ; EEPROM and flash control (EECON1)
                          #ifdef EEPGD
                          #define ROM_ERASE 0x94 ; EEPGD = 1, FREE = 1, WREN = 1
                          #else
                          #define ROM_ERASE 0x14 ; FREE = 1, WREN = 1
                          #endif

                          .
                          .
                          ....


                          .
                          .
                          .
                          .

                          .
                          .
                          ................

                          It is very big to put....

                          Comment


                          • #28
                            Originally posted by FRAN2000 View Post
                            And in the file umc_loader.asm must also match the settings
                            THE ASM file is created by the "umcbuild.exe" using the config.ini there is nothing to be gained by editing it

                            Comment


                            • #29
                              hello

                              I programmed, the resulting file to build the boot loader with UMC as you described and does not work.

                              If you give the information button, or gives you the version of the loader

                              it works for you?
                              Last edited by FRAN2000; 07-05-2016, 12:59 AM.

                              Comment


                              • #30
                                Originally posted by FRAN2000 View Post

                                it works for you?
                                SOMETIMES , its pretty unreliable . I'm going back to the pickit2 and no icd , no bootloader it's not worth the effort.

                                good luck with your efforts , if you find a good method let me know

                                richard

                                Comment

                                Working...
                                X