Help with pic 12f629 - Page 2


Closed Thread
Page 2 of 2 FirstFirst 12
Results 41 to 53 of 53
  1. #41
    Join Date
    Sep 2010
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    Hello All,

    I have put the voltage regulator, configured as a corrent regulator, allowing to pass only 250 mmA to the pic.

    Still does not work....if i put the finger on any conection...no problem, it works. But as soon as i remove my finger fron the conection, it goes dead.

    Why?...i thoght it was because the current, but this experiment has proved that it is not that. Hence, i am starting to believe that it may be because configuration in the pic.

    After having a closer look at the code, i notive pull ups where enable, should not that option be of sice i have pull up resistors in the circuit as shown, ?/...or is it the other way around?..

    Any body please?

    Ace?...

    Best regards.

  2. #42
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Sounds like you need a capacitor across VDD/VSS.
    You posted a schematic earlier but said this is what I have with this and that exception and you also said your were using the software to set the configs.

    If we knew what the configs are set to and how the chip is connected it may help.
    Dave
    Always wear safety glasses while programming.

  3. #43
    Join Date
    Sep 2010
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    Hello Dave,

    thanks for your reply.

    I will post later a capture of the configuration bits.

    About the capacitor across, I have allready tried, but nothing.

    Regards.
    Thanks for your help.

  4. #44
    Join Date
    Sep 2010
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    HERE ARE THE CONFIG BITS



    Thanks.

  5. #45
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I never liked setting the fuses with the programing software, always seemed to give trouble. So set the fuses in the *.inc or code space.

    Some things to try.
    Turn BODEN to OFF

    From the schematic posted the resistance at MCLR may be a little to high. Test by turning MCLRE to OFF.
    Dave
    Always wear safety glasses while programming.

  6. #46
    Join Date
    Sep 2010
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    hi Dave,

    Excuse my ignorance, what lines do i put in the code exactly?

    thanks.

    Best regards.

  7. #47
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Code:
    DEFINE OSC 4
     @ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _BODEN_OFF & _CP_OFF
    I think that is correct, I am not in the shop...
    And comment out the *.inc file int your PBP directory.

    Now when you look at the configs in MPLAB check the box set fuses in code. That dialog box will now tell you what the fuses are set for after you compile. This is a good way to make sure things are like you want.
    Dave
    Always wear safety glasses while programming.

  8. #48
    Join Date
    Sep 2010
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    Hi there,

    Thanks Dave for your reply, I am a bit lost, sorry for my incompetence.

    Please find the *inc file, below. Could you please tell me which ones I have to ";"?

    Also, Dont i have to reference in the code, like, list p=12f629 or something like that?

    Thanks.

    Best regards.
    Frank.

  9. #49
    Join Date
    Sep 2010
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    if i attache the code it will help i know....

    Code:
            LIST
    ; P12F629.INC  Standard Header File, Version 1.04    Microchip Technology, Inc.
            NOLIST
    
    ; This header file defines configurations, registers, and other useful bits of
    ; information for the PIC12F629 microcontroller.  These names are taken to match 
    ; the data sheets as closely as possible.  
    
    ; Note that the processor must be selected before this file is 
    ; included.  The processor may be selected the following ways:
    
    ;       1. Command line switch:
    ;               C:\ MPASM MYFILE.ASM /PIC12F629
    ;       2. LIST directive in the source file
    ;               LIST   P=PIC12F629
    ;       3. Processor Type entry in the MPASM full-screen interface
    
    ;==========================================================================
    ;
    ;       Revision History
    ;
    ;==========================================================================
    ;1.04    07/01/02 Updated configuration bit names
    ;1.03    05/10/02 Added IOC register
    ;1.02    02/28/02 Updated per datasheet
    ;1.01    01/31/02 Updated per datasheet
    ;1.00   08/24/01 Original
    
    ;==========================================================================
    ;
    ;       Verify Processor
    ;
    ;==========================================================================
    
            IFNDEF __12F629
               MESSG "Processor-header file mismatch.  Verify selected processor."
            ENDIF
    
    ;==========================================================================
    ;
    ;       Register Definitions
    ;
    ;==========================================================================
    
    W                            EQU     H'0000'
    F                            EQU     H'0001'
    
    ;----- Register Files------------------------------------------------------
    
    INDF                         EQU     H'0000'
    TMR0                         EQU     H'0001'
    PCL                          EQU     H'0002'
    STATUS                       EQU     H'0003'
    FSR                          EQU     H'0004'
    GPIO                         EQU     H'0005'
    
    PCLATH                       EQU     H'000A'
    INTCON                       EQU     H'000B'
    PIR1                 EQU     H'000C'
    
    TMR1L                 EQU     H'000E'        
    TMR1H                 EQU     H'000F'        
    T1CON                 EQU     H'0010'        
    
    CMCON                 EQU     H'0019'        
    
    OPTION_REG                 EQU     H'0081'
    
    TRISIO                 EQU     H'0085'
    
    PIE1                 EQU     H'008C'
    
    PCON                 EQU     H'008E'
    
    OSCCAL                 EQU     H'0090'
    
    WPU                 EQU     H'0095'
    IOCB                 EQU     H'0096'
    IOC                 EQU     H'0096'
    
    VRCON                 EQU     H'0099'
    EEDATA                 EQU     H'009A'    
    EEDAT                 EQU     H'009A'    
    EEADR                 EQU     H'009B'    
    EECON1                 EQU     H'009C'
    EECON2                 EQU     H'009D'
    
    ;----- STATUS Bits --------------------------------------------------------
    
    IRP                          EQU     H'0007'
    RP1                          EQU     H'0006'
    RP0                          EQU     H'0005'
    NOT_TO                       EQU     H'0004'
    NOT_PD                       EQU     H'0003'
    Z                            EQU     H'0002'
    DC                           EQU     H'0001'
    C                            EQU     H'0000'
    
    ;----- GPIO Bits --------------------------------------------------------
    
    GP5                 EQU     H'0005'
    GPIO5                 EQU     H'0005'
    GP4                 EQU     H'0004'
    GPIO4                 EQU     H'0004'
    GP3                 EQU     H'0003'
    GPIO3                 EQU     H'0003'
    GP2                 EQU     H'0002'
    GPIO2                 EQU     H'0002'
    GP1                 EQU     H'0001'
    GPIO1                 EQU     H'0001'
    GP0                 EQU     H'0000'
    GPIO0                 EQU     H'0000'
    
    
    
    ;----- INTCON Bits --------------------------------------------------------
    
    GIE                          EQU     H'0007'
    PEIE                         EQU     H'0006'
    T0IE                         EQU     H'0005'
    INTE                         EQU     H'0004'
    GPIE                         EQU     H'0003'
    T0IF                         EQU     H'0002'
    INTF                         EQU     H'0001'
    GPIF                         EQU     H'0000'
    
    ;----- PIR1 Bits ----------------------------------------------------------
    
    EEIF                         EQU     H'0007'
    ADIF                         EQU     H'0006'
    CMIF                         EQU     H'0003'
    T1IF                         EQU     H'0000'
    TMR1IF                       EQU     H'0000'
    
    ;----- T1CON Bits ---------------------------------------------------------
    
    TMR1GE                       EQU     H'0006'
    T1CKPS1                      EQU     H'0005'
    T1CKPS0                      EQU     H'0004'
    T1OSCEN                      EQU     H'0003'
    NOT_T1SYNC                   EQU     H'0002'
    TMR1CS                       EQU     H'0001'
    TMR1ON                       EQU     H'0000'
    
    ;----- COMCON Bits --------------------------------------------------------
    
    COUT                         EQU     H'0006'
    CINV                         EQU     H'0004'
    CIS                          EQU     H'0003'
    CM2                          EQU     H'0002'
    CM1                          EQU     H'0001'
    CM0                          EQU     H'0000'
    
    ;----- OPTION Bits --------------------------------------------------------
    
    NOT_GPPU             EQU     H'0007'
    INTEDG                       EQU     H'0006'
    T0CS                         EQU     H'0005'
    T0SE                         EQU     H'0004'
    PSA                          EQU     H'0003'
    PS2                          EQU     H'0002'
    PS1                          EQU     H'0001'
    PS0                          EQU     H'0000'
    
    ;----- PIE1 Bits ----------------------------------------------------------
    
    EEIE                         EQU     H'0007'
    ADIE                         EQU     H'0006'
    CMIE                         EQU     H'0003'
    T1IE                         EQU     H'0000'
    TMR1IE                       EQU     H'0000'
    
    ;----- PCON Bits ----------------------------------------------------------
    
    NOT_POR                      EQU     H'0001'
    NOT_BOD                      EQU     H'0000'
    
    ;----- OSCCAL Bits --------------------------------------------------------
    
    CAL5                         EQU     H'0007'
    CAL4                         EQU     H'0006'
    CAL3                         EQU     H'0005'
    CAL2                         EQU     H'0004'
    CAL1                         EQU     H'0003'
    CAL0                         EQU     H'0002'
    
    ;----- IOCB Bits --------------------------------------------------------
    
    IOCB5                         EQU     H'0005'
    IOCB4                         EQU     H'0004'
    IOCB3                         EQU     H'0003'
    IOCB2                         EQU     H'0002'
    IOCB1                         EQU     H'0001'
    IOCB0                         EQU     H'0000'
    
    ;----- IOC Bits --------------------------------------------------------
    
    IOC5                         EQU     H'0005'
    IOC4                         EQU     H'0004'
    IOC3                         EQU     H'0003'
    IOC2                         EQU     H'0002'
    IOC1                         EQU     H'0001'
    IOC0                         EQU     H'0000'
    
    ;----- VRCON Bits ---------------------------------------------------------
    
    VREN                         EQU     H'0007'
    VRR                          EQU     H'0005'
    VR3                          EQU     H'0003'
    VR2                          EQU     H'0002'
    VR1                          EQU     H'0001'
    VR0                          EQU     H'0000'
    
    ;----- EECON1 Bits --------------------------------------------------------
    
    WRERR                        EQU     H'0003'
    WREN                         EQU     H'0002'
    WR                           EQU     H'0001'
    RD                           EQU     H'0000'
    
    ;==========================================================================
    ;
    ;       RAM Definition
    ;
    ;==========================================================================
    
            __MAXRAM H'FF'
            __BADRAM H'06'-H'09', H'0D', H'11'-H'18', H'1A'-H'1F', H'60'-H'7F'
            __BADRAM H'86'-H'89', H'8D', H'8F', H'91'-H'94', H'97'-H'98', H'9E'-H'9F', H'E0'-H'FF'
    
    ;==========================================================================
    ;
    ;       Configuration Bits
    ;
    ;==========================================================================
    
    _CPD_ON                      EQU     H'3EFF'
    _CPD_OFF                     EQU     H'3FFF'
    _CP_ON                       EQU     H'3F7F'
    _CP_OFF                      EQU     H'3FFF'
    _BODEN_ON                    EQU     H'3FFF'
    _BODEN_OFF                   EQU     H'3FBF'
    _MCLRE_ON                    EQU     H'3FFF'
    _MCLRE_OFF                   EQU     H'3FDF'
    _PWRTE_OFF                   EQU     H'3FFF'
    _PWRTE_ON                    EQU     H'3FEF'
    _WDT_ON                      EQU     H'3FFF'
    _WDT_OFF                     EQU     H'3FF7'
    _LP_OSC                      EQU     H'3FF8'
    _XT_OSC                      EQU     H'3FF9'
    _HS_OSC                      EQU     H'3FFA'
    _EC_OSC                      EQU     H'3FFB'
    _INTRC_OSC_NOCLKOUT          EQU     H'3FFC'
    _INTRC_OSC_CLKOUT            EQU     H'3FFD'
    _EXTRC_OSC_NOCLKOUT          EQU     H'3FFE'
    _EXTRC_OSC_CLKOUT            EQU     H'3FFF'
    
            LIST

  10. #50
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    The file you have posted DO NOT modify. That is the MPASM file that has all the chip details. At the bottom of the file all of the config options are listed.

    The file you need to modify is in the PBP directory.
    Make it look like this.
    Code:
    ;****************************************************************
    ;*  12F629.INC                                                  *
    ;*                                                              *
    ;*  By        : Leonard Zerman, Jeff Schmoyer                   *
    ;*  Notice    : Copyright (c) 2005 microEngineering Labs, Inc.  *
    ;*              All Rights Reserved                             *
    ;*  Date      : 08/31/05                                        *
    ;*  Version   : 2.46a                                           *
    ;*  Notes     :                                                 *
    ;****************************************************************
            NOLIST
        ifdef PM_USED
            LIST
            include 'M12F629.INC'	; PM header
            device  pic12F629, intrc_osc_noclkout, wdt_on, mclr_on, protect_off
            XALL
            NOLIST
        else
            LIST
            LIST p = 12F629, r = dec, w = -302
            INCLUDE "P12F629.INC"	; MPASM  Header
            __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _BODEN_OFF & _CP_OFF
            NOLIST
        endif
            LIST
    Also, Dont i have to reference in the code, like, list p=12f629 or something like that?
    No, PBP does that for you at compile time when it reads the above file.
    Dave
    Always wear safety glasses while programming.

  11. #51
    Join Date
    Sep 2010
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    Hi Dave,

    Thanks for your help.

    I have tried and it gives me compiling error.

    So i commented out the line in the pbp directory as follow, but still gives me error:
    Code:
     else
            LIST
            LIST p = 12F629, r = dec, w = -302
            INCLUDE "P12F629.INC"    ; MPASM  Header
            ;__config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _BODEN_OFF & _CP_OFF
            NOLIST
        endif
            LIST
    Also, this is the message i get when compiling:
    Executing: "C:\PBP\PBPMPLAB.BAT" -ampasmwin -k# -p12F629 "3basic.bas"
    Executing: "C:\PBP\PBPW.EXE" -ampasmwin -k# -p12F629 "3basic.bas"
    PICBASIC PRO(TM) Compiler 2.60, (c) 1998, 2009 microEngineering Labs, Inc.
    All Rights Reserved.

    ERROR: Unable to execute mpasmwin.Error[118] C:\USERS\SHAN-MONICA-SHISHAN\DOCUMENTS\PICPROYECTS\PIC12F629\3BASIC.ASM 90 : Overwriting previous address contents (2007)
    Halting build on first failure as requested.
    BUILD FAILED: Fri Oct 22 17:58:18 2010

    Best regards.

  12. #52
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Overwriting error is when you set the configs in code space and do not comment the PBP *.inc file.... But you have done that.

    Long directory paths cause problems also, yours is very long.
    C:\USERS\SHAN-MONICA-SHISHAN\DOCUMENTS\PICPROYECTS\PIC12F629\3BASIC.ASM 90
    Try moving your project directory closer to the root of the drive
    C:\PICPROYECTS
    In my opinion, it is a bad idea to store any user created content in "C:\USERS\".
    Dave
    Always wear safety glasses while programming.

  13. #53
    Join Date
    Sep 2010
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    Hi Dave,

    It didnt work, still gives me the same error.

    I am just worried that my header it is not correct, it looks like this:

    Code:
    DEFINE OSC 4
     @ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF  
     
        cnt VAR BYTE
        delay var byte
    etc....
    But It looks something is missing.....

    I dont know....anyway, thanks all for you help.

    Best regards.
    Frank.

Members who have read this thread : 1

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