Menu

12HV615

Help
2008-03-20
2013-05-30
  • Nobody/Anonymous

    Could there be a problem with the way gc basic compiles for the 12HV615 and the 12F615?  I have code that works fine in a 12F683 but will not work with both the devices mentioned.  I want to use the 12HV615 so I can remove the voltage regulator from the circuit.

     
    • kent_twt4

      kent_twt4 - 2008-04-09

      Check your chipdata folder to see if the 12HV615 is in there.  My version, albeit not the latest version, does not have it.  Have programed the 12HV616 with no problems, although not used in a project yet.

      Going from the 12f683 to the 12f615/12HV615 could be a problem because you only have half the variables/stack to work with.  Check for that, and optimize your code to fit the smaller 12HV615.  Or, you could upgrade (and reconfigure your port pins) to the 12HV616 if necessary.

       
    • Nobody/Anonymous

      Thanks for your thoughts Kent.

      I have the latest chip data files and it includes both the 12HV615 and the 12F615.  I can get gc basic to compile for both chips but neither one will run the programs.  I have even tried simple programs setting a pin on and off and nothing happens.  This is why I think there must be something wrong.  I have also tried two different programmers and the chips program fine but just won't do anything.  I have written programs for many PIC chips using gc basic without a problem hence I think there may be something specific to these chips.  I have not tried the 16HV616.  I am not too concerned about program and variable space since the program has only about 20 lines of code and only two variables.

      I will send you a couple of chips if you would like to see if you can figure it out?

       
    • kent_twt4

      kent_twt4 - 2008-04-10

      No need to send the chips, as the debugging can be done right here.  Just post your sample code and assembly file.

      Generally when troubleshooting a program and chip I would look at:
      1)  Syntax errors, spelling, punctuation etc.
      2)  Osc and other configuration settings, are they compatible with the new device and your setup?
      3)  Do the Port/Pin assignments match the data sheet?
      4)  Check the copiled assembly file, does the time stamp reflect your latest compilation?
      Also, are the Port/Pins, Subs, functions etc. what you expect?
      5)  Does the Port assignments and registers of the data sheet and chipdata file match?
      6)  Perhaps the last thing to look at is if the correct registers are being set.  This can be time consuming, a hassle, and only a last resort.  This usually means checking the devices data sheet registers against the GCBasic system.h file (Oh joy!).  GCBasic makes certain assumptions during compilation that may conflict with your device (although rarely in my experience).

      On more lengthy programs sprinkling of LCD Print statements (or light an led) will find out where your program stops.

      As a seperate issue, there are the hardware/setup problems. 

      Of course, if you are plain stuck, then post your code and/or error messages at any time for the forum's help.

       
    • Nobody/Anonymous

      The following code runs fine on a 12F629 or a 12F683 however, on a 12F615 GPIO.0 is on and doesn't blink.  Same with a 12HV615.

      #CHIP 12F615, 4

      #config OSC = Int, MCLR = OFF

      #define Pin0 GPIO.0

      DIR GPIO.0 OUT

      Do
          Set Pin0 On
          Wait 2 sec
          Set Pin0 Off
          Wait 2 sec
      Loop

      The following is the assembly code:

      ;Program compiled by Great Cow BASIC (0.9 8/3/2008)
      ;Need help? See the GCBASIC forums at http://sourceforge.net/forum/?group_id=169286,
      ;check the documentation or email hconsidine@bigpond.com.

      ;********************************************************************************

      ;Set up the assembler options (Chip type, clock source, other bits and pieces)
      LIST p=12F615, r=DEC
      #include <P12F615.inc>
      __CONFIG _INTRC_OSC_NOCLKOUT & _MCLRE_OFF & _WDT_OFF & _MCLRE_OFF

      ;********************************************************************************

      ;Set aside memory locations for variables
      DELAYTEMP    equ    32
      DELAYTEMP2    equ    33
      SysWaitTempMS    equ    34
      SysWaitTempMS_H    equ    35
      SysWaitTempS    equ    36

      ;********************************************************************************

      ;Jump to initialisation code when PIC is reset
          ORG    0
          call    INITSYS
          goto    SystemInitialise

      ;********************************************************************************

      ;Interrupt vector
          ORG    4
      ;Various initialisation routines, automatically called by GCBASIC
      SystemInitialise

      ;********************************************************************************

      ;Start of the main program
          banksel    TRISIO
          bcf    TRISIO,0
      SysDoLoop_S1
          banksel    GPIO
          bsf    GPIO,0
          movlw    2
          movwf    SysWaitTempS
          call    Delay_S
          bcf    GPIO,0
          movlw    2
          movwf    SysWaitTempS
          call    Delay_S
          goto    SysDoLoop_S1
      SysDoLoop_E1
      BASPROGRAMEND
          sleep
          goto    $

      ;********************************************************************************
      ;Subroutines included in program
      ;********************************************************************************

      Delay_MS
          incf    SysWaitTempMS_H, F
      DMS_START
          movlw    10

      Thanks

       
    • kent_twt4

      kent_twt4 - 2008-04-11

      Skip trying to set MCLR = Off as this device has MCLRE and GCBasic will put it in there for you anyway.  Having the two MCLR's in the configuration is odd.

      You should use a Main: or Start: label to enclose your main program. 

      The data sheet for the 12f615 has a little different comparator register.  They don't address the comparator register when making the I/O port digital.  So maybe comment out those lines from the INITSYS subroutine in the compiled assembly file, and re-program that....just a hunch.  Of course there's no PORTA either, but probably no harm.

      INITSYS
          bcf    ADCON0,ADON
          bcf    ADCON0,ADFM
          banksel    ANSEL
          clrf    ANSEL
          'movlw    7
          'banksel CMCON0
          'movwf    CMCON0
          clrf    GPIO
          clrf    PORTA
          return

       

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.