Menu

pic12f15313, pic12f18313

JANIS
2023-07-19
2023-07-22
  • JANIS

    JANIS - 2023-07-19

    Hello!
    Is it the case that pic12f15313 and pic12f18313 are not included in the database? I wanted to compile my program, but Error: No chip data file found for 12F18313 :(

     
  • Anobium

    Anobium - 2023-07-19

    They are 16F parts. If you change to 16fxxxxx then all should be OK.

     
  • JANIS

    JANIS - 2023-07-21

    Thanks Anobium , when configuring the chip should be written #chip 16f15313 and that's it?

     
    • Anobium

      Anobium - 2023-07-22

      Yes. Nice andeasy.

       
  • JANIS

    JANIS - 2023-07-21

    I have another question also , it has been discussed, but the answer is not clear to me.
    https://sourceforge.net/p/gcbasic/discussion/579126/thread/db74453b/
    I am programming the chip 12f675 and suddenly a message appears for the pickit 3 programmer: OSCAL: Invalid value 3FFF.
    I didn't know what to do, I took the other chip. But now twice in two days this problem. 2 chips became unusable.

     
  • Anobium

    Anobium - 2023-07-22

    The quick fix, when using a PK3 programmer, is to set the OSCCAL value using the PK3 GUI. I cannot remember the range but the GUI will help you.

    The value sets the OSCILLATOR caliberation. It was one of the bad things that Microchip have done... any failure of the chip programming ( as an end to end process ) can mean the OSCCAL value 8s not restored.

    A PK2 programmer can automatically recalc this value. A PK3 cannot recall the value.

     
  • Geoffrey Younger

    Hi,
    I ADD these 2 lines of ASM in any 12F675 running on INTOSC
    ;at the Start of program.
    ;----------------------------
    CALL 0x3ff
    movwf osccal
    ;----------------------------
    Cheers,
    Geoff

     
    • Anobium

      Anobium - 2023-07-22

      The compiler does this for you. Any chip that requires the call has it added automatically.

       
      • Anobium

        Anobium - 2023-07-22

        Just checked... it does add autoimatically.

        ;Program compiled by Great Cow BASIC (1.00.00 2023-05-31 (Windows 64 bit) : Build 1249) for Microchip MPASM/MPLAB-X Assembler using FreeBASIC 1.07.1/2023-06-18 CRC29
        ;Need help? 
        ;  See the GCBASIC forums at http://sourceforge.net/projects/gcbasic/forums,
        ;  Check the documentation and Help at http://gcbasic.sourceforge.net/help/,
        ;or, email us:
        ;   w_cholmondeley at users dot sourceforge dot net
        ;   evanvennn at users dot sourceforge dot net
        
        ;********************************************************************************
        
        ;Set up the assembler options (Chip type, clock source, other bits and pieces)
         LIST p=12F675, r=DEC
        #include <P12F675.inc>
         __CONFIG _CPD_OFF & _CP_OFF & _MCLRE_OFF & _WDTE_OFF & _INTRC_OSC_NOCLKOUT
        
        .... 
        
        ;********************************************************************************
        
        ;Source: system.h (173)
        INITSYS
        ;This loads the saved calibration data from the last flash memory location at POR or any time the chip is reset.
        ;CALL 0x3ff
            call    1023
        ;movwf osccal
            banksel OSCCAL
            movwf   OSCCAL
        ;asm showdebug This code block sets the internal oscillator to ChipMHz
        ;asm showdebug _Complete_the_chip_setup_of_BSR,ADCs,ANSEL_and_other_key_setup_registers_or_register_bits
        ;Ensure all ports are set for digital I/O and, turn off A/D
        ;SET ADFM OFF
            banksel ADCON0
            bcf ADCON0,ADFM
        ;Switch off A/D Var(ADCON0)
        ;SET ADCON0.ADON OFF
            bcf ADCON0,ADON
        ;ANSEL = 0
            banksel ANSEL
            clrf    ANSEL
        ;Turn off comparator - this is the default setting
        ;CMCON = 7
            movlw   7
            banksel CMCON
            movwf   CMCON
        ;
        ;'Turn off all ports
        ;GPIO = 0
            clrf    GPIO
            return
        
        ;********************************************************************************
        
        
         END
        

        INITSYS#

        ;This loads the saved calibration data from the last flash memory location at POR or any time the chip is reset.
        ;CALL 0x3ff
        call 1023
        ;movwf osccal
        banksel OSCCAL
        movwf OSCCAL

         
  • JANIS

    JANIS - 2023-07-22

    Thans. I didn't get to revive those 2 chips. thrown out.

     
    • Anobium

      Anobium - 2023-07-22

      Sorry to hear that.

      To all reading this in the future. An OSCAL error when programming is repairable. I post a detailed method using a PK2 and a PK3 programmer. See my YouTube channel.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.