Configuration bits
+ Reply to Thread
Results 1 to 19 of 19
  1. #1
    Join Date
    May 2011
    Posts
    17

    Default Configuration bits

    Hello

    I was wondering is there any tool that generates configuration bits code for picbasic pro ?

    In mplab there is option under windows-->configuration bits, then you can select what you need and automaticly generates code for you.


    Thx

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    1,603

    Default Re: Configuration bits


  3. #3
    Join Date
    May 2011
    Posts
    17

    Default Re: Configuration bits

    thank you very much this is what I've been looking for but couldnt find

    thx

  4. #4

    Default Re: Configuration bits

    Dear all,

    i would like your help if possible.

    I'm trying to configure the PIC16F1939 with clock internal speed at 32Mhz

    The code is as follows but i have a small problem.

    First the OSCSTAT.5 as you can see it is set to 0

    Code:
    ;bit 5 OSTS: Oscillator Start-up Time-out Status bit
                ;1 = Running from the clock defined by the FOSC<2:0> bits of the Configuration Words
                ;0 = Running from an internal oscillator (FOSC<2:0> = 100)
    and second the OSCCON bit 1-0 are set to 00

    Code:
    ;bit 1-0 SCS<1:0>: System Clock Select bits
            ;1x = Internal oscillator block
            ;01 = Timer1 oscillator
            ;00 = Clock determined by FOSC<2:0> in Configuration Words.
    Any other configuration do not let me use the
    Code:
    define OSC 32
    , but works when i change it to OSC 8.

    The following code works with
    Code:
    define OSC 32
    but it works much faster when i place it with OSC 8 .

    Could you please advise if the following code is the right one to run the internal OSC at 32 Mhz? thanks a lot.

    Code:
    #IF __PROCESSOR__ = "16F1939"
    
    #CONFIG
        __config _CONFIG1, _FOSC_INTOSC & _CP_OFF & _CPD_OFF & _WDTE_OFF & _MCLRE_ON & _PWRTE_ON & _CLKOUTEN_OFF & _BOREN_OFF & _FCMEN_OFF  
        __config _CONFIG2, _PLLEN_OFF & _LVP_OFF & _WRT_OFF	
    
      #ENDCONFIG
    
    #ELSE
        #MSG "Wrong Processor selected!"
    #ENDIF
    
    
    define OSC 32
            
            ;DEFINE NO_CLRWDT 1   ' PBP doesn't clear WDT automatically
            'DEFINE USE_LOWPRIORITY 1
            INCLUDE "modedefs.bas"
            INCLUDE "ALLDIGITAL.pbp"
            INCLUDE "DT_INTS-14.bas"        ; Base Interrupt System
            INCLUDE "ReEnterPBP.bas"        ; Include if using PBP interrupts
    
    
    ;------------------------------------------------------------------------------|
    ;                      OSCCON: OSCILLATOR CONTROL REGISTER                     |
    ;------------------------------------------------------------------------------|
            
    OSCCON    = %11110000   ; 32Mhz
    
        ;bit 7 SPLLEN: Software PLL Enable bit
            ;If PLLEN in Configuration Words = 1:
            ;SPLLEN bit is ignored. 4x PLL is always enabled (subject to oscillator requirements)
            ;If PLLEN in Configuration Words = 0:
            ;1 = 4x PLL Is enabled
            ;0 = 4x PLL is disabled
        ;bit 6-3 IRCF<3:0>: Internal Oscillator Frequency Select bits
            ;1111 = 16 MHz HF
            ;1110 = 8 MHz or 32 MHz HF (see Section 5.2.2.1 “HFINTOSC”)
            ;1101 = 4 MHz HF
            ;1100 = 2 MHz HF
            ;1011 = 1 MHz HF
            ;1010 = 500 kHz HF(1)
            ;1001 = 250 kHz HF(1)
            ;1000 = 125 kHz HF(1)
            ;0111 = 500 kHz MF (default upon Reset)
            ;0110 = 250 kHz MF
            ;0101 = 125 kHz MF
            ;0100 = 62.5 kHz MF
            ;0011 = 31.25 kHz HF(1)
            ;0010 = 31.25 kHz MF
            ;000x = 31 kHz LF
        ;bit 2 Unimplemented: Read as ‘0’
        ;bit 1-0 SCS<1:0>: System Clock Select bits
            ;1x = Internal oscillator block
            ;01 = Timer1 oscillator
            ;00 = Clock determined by FOSC<2:0> in Configuration Words.
    
    OSCSTAT.7 = 1
    OSCSTAT.6 = 1
    OSCSTAT.5 = 0
    OSCSTAT.4 = 1
    OSCSTAT.3 = 1
    OSCSTAT.2 = 0
    OSCSTAT.1 = 0
    OSCSTAT.0 = 1
    
    ;bit 7 T1OSCR: Timer1 Oscillator Ready bit
                ;If T1OSCEN = 1:
                ;1 = Timer1 oscillator is ready
                ;0 = Timer1 oscillator is not ready
                ;If T1OSCEN = 0:
                ;1 = Timer1 clock source is always ready
    ;bit 6 PLLR 4x PLL Ready bit
                ;1 = 4x PLL is ready
                ;0 = 4x PLL is not ready
    ;bit 5 OSTS: Oscillator Start-up Time-out Status bit
                ;1 = Running from the clock defined by the FOSC<2:0> bits of the Configuration Words
                ;0 = Running from an internal oscillator (FOSC<2:0> = 100)
    ;bit 4 HFIOFR: High-Frequency Internal Oscillator Ready bit
                ;1 = HFINTOSC is ready
                ;0 = HFINTOSC is not ready
    ;bit 3 HFIOFL: High-Frequency Internal Oscillator Locked bit
                ;1 = HFINTOSC is at least 2% accurate
                ;0 = HFINTOSC is not 2% accurate
    ;bit 2 MFIOFR: Medium-Frequency Internal Oscillator Ready bit
                ;1 = MFINTOSC is ready
                ;0 = MFINTOSC is not ready
    ;bit 1 LFIOFR: Low-Frequency Internal Oscillator Ready bit
                ;1 = LFINTOSC is ready
                ;0 = LFINTOSC is not ready
    ;bit 0 HFIOFS: High-Frequency Internal Oscillator Stable bit
                ;1 = HFINTOSC is at least 0.5% accurate
                ;0 = HFINTOSC is not 0.5% accurate
    
    OSCTUNE = %00011111     ; 100000 = Minimum frequency
                            ; 011111 = Maximum frequency

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,155

    Default Re: Configuration bits

    change this line :
    __config _CONFIG2, _PLLEN_OFF & _LVP_OFF & _WRT_OFF

    to:
    __config _CONFIG2, _PLLEN_ON & _LVP_OFF & _WRT_OFF

    and that should do it to run @ 32 Mhz.
    Dave Purola,
    N8NTA
    EN82fn

  6. #6

    Default Re: Configuration bits

    Quote Originally Posted by Dave View Post
    change this line :
    __config _CONFIG2, _PLLEN_OFF & _LVP_OFF & _WRT_OFF

    to:
    __config _CONFIG2, _PLLEN_ON & _LVP_OFF & _WRT_OFF

    and that should do it to run @ 32 Mhz.
    Hi Dave,

    thanks a lot for your reply.

    The code i have uploaded on my previous post was with the PLLEN_OFF and worked.

    Now i did changed the PLLEN_ON and it is working the same way.

    In my main program i have asked the series of LEDs to turn on every 0.5 sec and then to turn off every 0.5 sec.


    The program works fine even if the PLLEN is on or off.

    Please have a look at the following code.

    Code:
    #IF __PROCESSOR__ = "16F1939"
    
    #CONFIG
        __config _CONFIG1, _FOSC_INTOSC & _CP_OFF & _CPD_OFF & _WDTE_OFF & _MCLRE_ON & _PWRTE_ON & _CLKOUTEN_OFF & _BOREN_OFF & _FCMEN_OFF  
        __config _CONFIG2, _PLLEN_ON & _LVP_OFF & _WRT_OFF	
    
      #ENDCONFIG
    
    #ELSE
        #MSG "Wrong Processor selected!"
    #ENDIF
    
    
    define OSC 32
            
            ;DEFINE NO_CLRWDT 1   ' PBP doesn't clear WDT automatically
            'DEFINE USE_LOWPRIORITY 1
            INCLUDE "modedefs.bas"
            INCLUDE "ALLDIGITAL.pbp"
            INCLUDE "DT_INTS-14.bas"        ; Base Interrupt System
            INCLUDE "ReEnterPBP.bas"        ; Include if using PBP interrupts
    
    
    ;------------------------------------------------------------------------------|
    ;                      OSCCON: OSCILLATOR CONTROL REGISTER                     |
    ;------------------------------------------------------------------------------|
            
    OSCCON    = %11110000   ; 32Mhz
    
        ;bit 7 SPLLEN: Software PLL Enable bit
            ;If PLLEN in Configuration Words = 1:
            ;SPLLEN bit is ignored. 4x PLL is always enabled (subject to oscillator requirements)
            ;If PLLEN in Configuration Words = 0:
            ;1 = 4x PLL Is enabled
            ;0 = 4x PLL is disabled
        ;bit 6-3 IRCF<3:0>: Internal Oscillator Frequency Select bits
            ;1111 = 16 MHz HF
            ;1110 = 8 MHz or 32 MHz HF (see Section 5.2.2.1 “HFINTOSC”)
            ;1101 = 4 MHz HF
            ;1100 = 2 MHz HF
            ;1011 = 1 MHz HF
            ;1010 = 500 kHz HF(1)
            ;1001 = 250 kHz HF(1)
            ;1000 = 125 kHz HF(1)
            ;0111 = 500 kHz MF (default upon Reset)
            ;0110 = 250 kHz MF
            ;0101 = 125 kHz MF
            ;0100 = 62.5 kHz MF
            ;0011 = 31.25 kHz HF(1)
            ;0010 = 31.25 kHz MF
            ;000x = 31 kHz LF
        ;bit 2 Unimplemented: Read as ‘0’
        ;bit 1-0 SCS<1:0>: System Clock Select bits
            ;1x = Internal oscillator block
            ;01 = Timer1 oscillator
            ;00 = Clock determined by FOSC<2:0> in Configuration Words.
    
    OSCSTAT.7 = 1
    OSCSTAT.6 = 1
    OSCSTAT.5 = 0
    OSCSTAT.4 = 1
    OSCSTAT.3 = 1
    OSCSTAT.2 = 0
    OSCSTAT.1 = 0
    OSCSTAT.0 = 1
    
    ;bit 7 T1OSCR: Timer1 Oscillator Ready bit
                ;If T1OSCEN = 1:
                ;1 = Timer1 oscillator is ready
                ;0 = Timer1 oscillator is not ready
                ;If T1OSCEN = 0:
                ;1 = Timer1 clock source is always ready
    ;bit 6 PLLR 4x PLL Ready bit
                ;1 = 4x PLL is ready
                ;0 = 4x PLL is not ready
    ;bit 5 OSTS: Oscillator Start-up Time-out Status bit
                ;1 = Running from the clock defined by the FOSC<2:0> bits of the Configuration Words
                ;0 = Running from an internal oscillator (FOSC<2:0> = 100)
    ;bit 4 HFIOFR: High-Frequency Internal Oscillator Ready bit
                ;1 = HFINTOSC is ready
                ;0 = HFINTOSC is not ready
    ;bit 3 HFIOFL: High-Frequency Internal Oscillator Locked bit
                ;1 = HFINTOSC is at least 2% accurate
                ;0 = HFINTOSC is not 2% accurate
    ;bit 2 MFIOFR: Medium-Frequency Internal Oscillator Ready bit
                ;1 = MFINTOSC is ready
                ;0 = MFINTOSC is not ready
    ;bit 1 LFIOFR: Low-Frequency Internal Oscillator Ready bit
                ;1 = LFINTOSC is ready
                ;0 = LFINTOSC is not ready
    ;bit 0 HFIOFS: High-Frequency Internal Oscillator Stable bit
                ;1 = HFINTOSC is at least 0.5% accurate
                ;0 = HFINTOSC is not 0.5% accurate
    
    OSCTUNE = %00011111     ; 100000 = Minimum frequency
                            ; 011111 = Maximum frequency
    
    while ! OSCSTAT.6 = 1 :WEND
    while ! OSCSTAT.4 = 1 :WEND ; to make sure the pll has stabilised before you run any other code
    
    
    '------------------------------------------------------------------------------|
    '                            INITIALIZE RAM                                    |
    '------------------------------------------------------------------------------|
    initialize:
    	CLEAR 
    	
    TRISA = %00000000   'use TRISA to specify which pin is (1 = input) and which (0 = output)  (ALL pins are output)
    TRISB = %00000111   'use TRISB to specify which pin is (1 = input) and which (0 = output)  (ALL pins are output)
    TRISC = %00000000   'use TRISC to specify which pin is (1 = input) and which (0 = output)  (ALL pins are output)
    TRISD = %00000000   'use TRISC to specify which pin is (1 = input) and which (0 = output)  (ALL pins are output)
    TRISE = %00000000   'use TRISC to specify which pin is (1 = input) and which (0 = output)  (ALL pins are output)
    '------------------------------------------------------------------------|
    '--------------------------- TRIS A B C D E -----------------------------|
    '------------------------------------------------------------------------|
    ' PORTA.7  PORTA.6  PORTA.5  PORTA.4  PORTA.3  PORTA.2  PORTA.1  PORTA.0 |
    '  bit7     bit6     bit5     bit4     bit3     bit2     bit1     bit0   |
    '   0        0        0        0        0        0        0        0     |
    '------------------------------------------------------------------------|
    '------------------------------------------------------------------------|
    ' PORTB.7  PORTB.6  PORTB.5  PORTB.4  PORTB.3  PORTB.2  PORTB.1  PORTB.0 |
    '  bit7     bit6     bit5     bit4     bit3     bit2     bit1     bit0   |
    '   0        0        0        0        0        1        1        1     |
    '------------------------------------------------------------------------|
    '------------------------------------------------------------------------|
    ' PORTC.7  PORTC.6  PORTC.5  PORTC.4  PORTC.3  PORTC.2  PORTC.1  PORTC.0 |
    '  bit7     bit6     bit5     bit4     bit3     bit2     bit1     bit0   |
    '   0        0        0        0        0        0        0        0     |
    '------------------------------------------------------------------------|
    '------------------------------------------------------------------------|
    ' PORTD.7  PORTD.6  PORTD.5  PORTD.4  PORTD.3  PORTD.2  PORTD.1  PORTD.0 |
    '  bit7     bit6     bit5     bit4     bit3     bit2     bit1     bit0   |
    '   0        0        0        0        0        0        0        0     |
    '------------------------------------------------------------------------|
    '------------------------------------------------------------------------|
    ' PORTE.-  PORTE.-  PORTE.-  PORTE.-  PORTE.3  PORTE.2  PORTE.1  PORTE.0 |
    '  bit7     bit6     bit5     bit4     bit3     bit2     bit1     bit0   |
    '   -        -        -        -        0        0        0        0     |
    '------------------------------------------------------------------------|
    
    '------------------------------------------------------------------------|
    '----------------------- At start all PORTS LOW -------------------------|
    '------------------------------------------------------------------------|
    PORTA = 0            'make low all ports at A range                      |
    PORTB = 0            'make low all ports at B range                      |
    PORTC = 0            'make low all ports at C range                      |
    PORTD = 0            'make low all ports at D range                      |
    PORTE = 0            'make low all ports at E range                      |
    '------------------------------------------------------------------------|
    
    '------------------------------------------------------------------------|
    '-------------------------- COMPARATORS OFF -----------------------------|
    '------------------------------------------------------------------------|
    CM1CON0.7 = 0 'Disable comparator1                                       |
    CM2CON0.7 = 0 'Disable comparator2                                       |
    '------------------------------------------------------------------------|
    
    
    REDLED  var PORTB.4 ' power led GREEN lights up when everything is ok
    GREENLED  Var PORTA.1 ' together with Power Green Led. Normally used for failure notifcation
    
    UVLED1  var PORTB.5
    UVLED2  Var PORTA.0
    
    '------------------------------------------------------------------------------|
    '                              //  RGB LED  //                                 |
    '------------------------------------------------------------------------------|
    
    BLUE    var PORTE.0 ' indicates that PIC is working on port C.4
    RED     var PORTE.1
    GREEN   VAR PORTE.2
    
    UVRight var PORTC.2
    BUZZLED var PORTC.0
    
    '------------------------------------------------------------------------------|
    '                           //INTERRUPT BUTTONS //                             |
    '------------------------------------------------------------------------------|
    
    BUTT1   var PORTB.0
    BUTT2   VAR PORTB.1
    BUTT3   var PORTB.2
    
    '------------------------------------------------------------------------------|
    '                           Setting the Power Led                              |
    '------------------------------------------------------------------------------|
    
    ' -----------------------------------------------------------------------------|  
    '                        [ CPU SPEED TEST with LEDs ]                          |
    '------------------------------------------------------------------------------|
                                 ' FIRST TIME BOOTUP '
    goSUB PWRUP
    
    
    'high GREENLED ' this is the GREEN power led.
    'high redled ' this is an option here just to test the code
    
    
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler   TMR1_INT,  _ToggleLED1,   PBP,  yes
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    
    T1CON = %00111001                ; Prescaler= 1:8, TMR1ON
    ;OPTION_REG = %10000111           ; Prescaler= 1:256 TMR0
    @ INT_ENABLE  TMR1_INT     ; enable Timer 1 interrupts
    
    
    Main:
    
        high PORTD.7     
        pause 500
        
        high PORTD.6     
        pause 500
        high PORTC.7     
        pause 500
        high PORTC.6     
        pause 500
        high PORTC.5     
        pause 500
        high PORTC.4     
        pause 500
        high PORTD.3     
        pause 500
        high PORTD.1     
        pause 500
        high PORTD.0     
        pause 500
        high PORTC.3     
        pause 500
        high PORTD.4     
        pause 500
        high PORTA.5     
        pause 500
        
        LOW PORTD.7     
        pause 500
        LOW PORTD.6     
        pause 500
        LOW PORTC.7     
        pause 500
        LOW PORTC.6     
        pause 500
        LOW PORTC.5     
        pause 500
        LOW PORTC.4     
        pause 500
        LOW PORTD.3     
        pause 500
        LOW PORTD.1     
        pause 500
        LOW PORTD.0     
        pause 500
        LOW PORTC.3     
        pause 500
        LOW PORTD.4     
        pause 500
        LOW PORTA.5     
        pause 500
    goto main 
    
    end
    '-------------------------------------------------------------------------------|
    '                                POWER UP LEDs                                  |
    '-------------------------------------------------------------------------------|
    
    PWRUP:
    high RED
    high BLUE
    high GREEN
    pause 1000
    low RED
    LOW BLUE
    LOW GREEN
    Pause 100
    
    high blue
    Pause 10
    low blue 
    pause 100 
    high blue
    Pause 10
    low blue 
    pause 100
    high blue
    Pause 10
    low blue 
    pause 100
    
    high red
    Pause 10
    low red 
    pause 100
    high red
    Pause 10
    low red 
    pause 100
    high red
    Pause 10
    low red 
    pause 100
    
    high green
    Pause 10
    low green 
    pause 100
    high green
    Pause 10
    low green 
    pause 100
    high green
    Pause 10
    low green 
    pause 100
    
    return
    
    
    '---[TMR1 - interrupt handler]--------------------------------------------------
    ToggleLED1:
    
        toggle uvled2 : toggle uvled1 : TOGGLE red 
         
    @ INT_RETURN

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    1,603

    Default Re: Configuration bits

    Code:
    OSCSTAT.7 = 1
    OSCSTAT.6 = 1
    OSCSTAT.5 = 0
    OSCSTAT.4 = 1
    OSCSTAT.3 = 1
    OSCSTAT.2 = 0
    OSCSTAT.1 = 0
    OSCSTAT.0 = 1
    a complete waste of effort , the OSCSTAT reg is read only
    Code:
    OSCTUNE = %00011111     ; 100000 = Minimum frequency
                            ; 011111 = Maximum frequency
    not a good idea , the OSCTUNE reg should be left at 0 to run intosc at the factory calibrated freq. you would only alter it if the chip needs to be re-calibrated


    to run chip @32mhz from int osc you have two options
    1 . with config fuse PLLEN_OFF, set osccon to %11110000 ; spllen =1 ,ircf=%1110
    2 . with config fuse PLLEN_ON set osccon to %01110000 ; Ircf=%1110 [the spllen bit is ignored]

    In both cases you should monitor OSCSTAT.6 to make sure the pll is ready before time sensitive functions are executed
    This is more entertaining than Free to Air TV

  8. #8

    Default Re: Configuration bits

    Hi Richard thanks a lot once again.

    Now it makes sense. I will try it tonight.

  9. #9
    Join Date
    Apr 2014
    Location
    Northeast
    Posts
    271

    Default Re: Configuration bits

    A few more notes, to run at 32 MHz you will need PLL enabled. Set OSC at 8 MHz (8 * 4 PLL = 32). Lastly, Bits 1:0 of the OSCCON should reflect 0:0; Clock determined by FOSC<2:0> in Configuration Words. I remember fighting this very same battle.
    I don't need the world to know my name, but I want to live a life so all my great-grandchildren proudly remember me.

  10. #10

    Default Re: Configuration bits

    Based on what Richard adviced, i did the following.

    Code:
    #CONFIG
        __config _CONFIG1, _FOSC_INTOSC & _CP_OFF & _CPD_OFF & _WDTE_OFF & _MCLRE_ON & _PWRTE_ON & _CLKOUTEN_OFF & _BOREN_OFF & _FCMEN_OFF  
        __config _CONFIG2, _PLLEN_ON & _LVP_OFF & _WRT_OFF	
    
      #ENDCONFIG
    then i told the compiler to

    Code:
    DEFINE OSC 32
    and i only configure the OSCCON

    Code:
    OSCCON    = %01110000   ; 32Mhz
    Then i run the program and it looked like it worked fine.

    mpgmike
    Re: Configuration bits

    A few more notes, to run at 32 MHz you will need PLL enabled. Set OSC at 8 MHz (8 * 4 PLL = 32). Lastly, Bits 1:0 of the OSCCON should reflect 0:0; Clock determined by FOSC<2:0> in Configuration Words. I remember fighting this very same battle.
    mpgmike, when you mention to set OSC at 8Mhz (8*4PLL =32) where do you refer to?

    Do you mean instead of DEFINE OSC 32, to change it to DEFINE OSC 8?

  11. #11
    Join Date
    May 2013
    Location
    australia
    Posts
    1,603

    Default Re: Configuration bits

    ircf=%1110 sets int osc to 8mhz
    int osc *4 pll = 32mhz , and becomes the system clock when pll on ,with no pll the system clock would stay at 8mhz

    define OSC 32 [is the system clock ,the int osc is not relevent when pll on ]
    Attached Images Attached Images
    This is more entertaining than Free to Air TV

  12. #12
    Join Date
    Apr 2014
    Location
    Northeast
    Posts
    271

    Default Re: Configuration bits

    The "DEFINE OSC x" statement merely tells PBP how to calculate timing related commands, it has absolutely no effect on the actual OSC for the PIC; that must be established with the CONFIGs & SFRs. If you are running at 32 MHz, your "DEFINE OSC" should be 32. If you wanted to pull a fast one, you could set the SFRs to deliver a 1 MHz OSC (which PBP does not account for, but many PICs do) and DEFINE OSC 4, then your PAUSE statements would be 4X of what you ask for:

    PAUSE 100 ;would actually deliver 400 ms Pause.

    You may want to run your PIC at a speed slower than 4 MHz. Just account for the math when using timing related commands.
    I don't need the world to know my name, but I want to live a life so all my great-grandchildren proudly remember me.

  13. #13
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,537

    Default Re: Configuration bits

    Hi, Astanapane

    there are two things ...

    1) Hardware :

    you set the internal osc to 8Mhz :

    OSCCON = %01110000 ; 32Mhz
    that is 8 Mhz and not 32 !!!

    AND the x4 PLL ON

    #CONFIG
    __config _CONFIG1, _FOSC_INTOSC & _CP_OFF & _CPD_OFF & _WDTE_OFF & _MCLRE_ON & _PWRTE_ON & _CLKOUTEN_OFF & _BOREN_OFF & _FCMEN_OFF
    __config _CONFIG2, _PLLEN_ON & _LVP_OFF & _WRT_OFF

    #ENDCONFIG
    8 x 4 = 32 Mhz for the Hardware ...


    2) Software: you have to tell the compiler you run @ 32 Mhz ...

    DEFINE OSC 32
    of course, the value for 1) and 2) might be the same ... but that also permit some trickery !!!

    mpgmike, when you mention to set OSC at 8Mhz (8*4PLL =32) where do you refer to?
    As always, you HAVE to read your Databook ... Oscillator Chapter !!!

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  14. #14

    Default Re: Configuration bits

    thanks all of you for these informative answers.

    Now chip is running at 32Mhz under your instructions.

  15. #15
    Join Date
    Apr 2014
    Location
    Northeast
    Posts
    271

    Default Re: Configuration bits

    Got the turbo working on the PIC engine!
    I don't need the world to know my name, but I want to live a life so all my great-grandchildren proudly remember me.

  16. #16

    Default Re: Configuration bits

    Quote Originally Posted by mpgmike View Post
    Got the turbo working on the PIC engine!

    hehehe, i have many things to learn.

    Im trying to design a small development board and i have a problem which occurs in some of the pic's. I solder the pic on the board and when i supply regulated voltage the pin Vdd 28pin smokes or it looks like it shorted with GND 29pin.

    This happens in the chips i tried 3 out of 4. the fourth one works fine. I cant figure our what is going on.
    Attached Images Attached Images

  17. #17
    Join Date
    Apr 2014
    Location
    Northeast
    Posts
    271

    Default Re: Configuration bits

    Trying to solder surface mount stuff like that, the best I could get was to take a jeweler's screw driver and smear just a film of flux on the pads; place the chip, clamp it in place, then just touch each pin & pad with the soldering iron tip. I still get faulty connections more often than I like.
    I don't need the world to know my name, but I want to live a life so all my great-grandchildren proudly remember me.

  18. #18

    Default Re: Configuration bits

    Quote Originally Posted by mpgmike View Post
    Trying to solder surface mount stuff like that, the best I could get was to take a jeweler's screw driver and smear just a film of flux on the pads; place the chip, clamp it in place, then just touch each pin & pad with the soldering iron tip. I still get faulty connections more often than I like.
    I do make the soldering with a tiny small 15watt iron from Weller and Ersa. I also have a hotair station to make it stay there without even touching the chip.

    Then i clean the connections and pads with ISOPROPANOL. But cant undetstand why 3 out of 4 chips i used the got smoked on that 28 Vdd pin, it looked like it got shorted somehow with the 29 GND which is the next pin.

    I did exactly the same procedure on the 4th chip and it worked. Up to now the board works fine.

    For your reference, all the 4 chips i used, were working on the board for at least 4 -5 minutes until i noticed a smoke coming out from that pin.

  19. #19
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,537

    Default Re: Configuration bits

    The only easy way to solder such little components I have found is first to apply solder paste to have tinned pads , melt it with a heat gun ( Bosch 350°C 2 kw !!! ) and THEN, I can build my SMD PCB with a classical iron ...

    but I have to admit dealing with such little components by hand lead to problems.

    don't repeat I change the regulator's 603 resistors aboard my arduino pro mini boards ...

    BTW, you should test your boards with a current limited supply ... or test those pins with an ohm meter before appying the power ...

    Alain
    Last edited by Acetronics2; - 14th March 2019 at 21:33.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. Configuration bits 18F45K20
    By robertg in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th September 2013, 08:31
  2. configuration bits
    By Izone1173 in forum mel PIC BASIC
    Replies: 2
    Last Post: - 18th June 2009, 04:17
  3. Configuration bits
    By Perrin` in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd July 2008, 14:40
  4. Configuration bits
    By DJEE in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th June 2007, 19:20
  5. Configuration bits
    By Armando Herjim in forum General
    Replies: 0
    Last Post: - 5th December 2006, 17:51

Members who have read this thread : 21

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