+ Post New Thread
Results 1 to 11 of 11
  1. #1
    Full Member level 1
    Points: 1,721, Level: 9
    dhakeparag81's Avatar
    Join Date
    Jun 2012
    Location
    INDIA
    Posts
    115
    Helped
    1 / 1
    Points
    1,721
    Level
    9

    fPic32mx795f512L Start probleml

    Hello,

    Recently im facing weird problem with my pic32mx795f512l project.

    Controller wont start until i touch to it with bare finger. I know its not recommended to touch it.
    I have interface LCD, LED's to it, when i power on everything i blank lcd not initialized power on led which is on port pin is OFF, as soon as i touch to controller everything start to work.

    Im using external crystal of 20Mhz with 33PF cap, i try change it but wont work.
    I also checked the basic minimum ckt which looks fine, means cap to vdd and gnd, vcap capacitor of 10uf 16v i try 1uf as well.

    this is my current configuration
    Code:
    #pragma config FPLLMUL = MUL_20, FPLLIDIV = DIV_5, FPLLODIV = DIV_1, FWDTEN = ON
    #pragma config POSCMOD = HS, FNOSC = PRIPLL, FPBDIV = DIV_2
    #pragma config FSOSCEN = OFF
    #pragma config FUSBIDIO = OFF           // USB USID Selection (Controlled by Port Function)
    #pragma config FVBUSONIO = OFF          // USB VBUS ON Selection (Controlled by Port Function)
    #pragma config DEBUG = ON               // Background Debugger Enable (Debugger is enabled)
    #pragma config WDTPS = PS4096
    #pragma config CP = ON
    i have also tried on internal crystal with this config
    Code:
    #pragma config FPLLMUL = MUL_20, FPLLIDIV = DIV_2, FPLLODIV = DIV_1, FWDTEN = ON
    #pragma config POSCMOD = HS, FNOSC = FRCPLL, FPBDIV = DIV_2
    #pragma config FSOSCEN = OFF
    #pragma config FUSBIDIO = OFF           // USB USID Selection (Controlled by Port Function)
    #pragma config FVBUSONIO = OFF          // USB VBUS ON Selection (Controlled by Port Function)
    #pragma config DEBUG = ON               // Background Debugger Enable (Debugger is enabled)
    #pragma config WDTPS = PS4096
    #pragma config CP = ON

    •   AltAdvertisment

        
       

  2. #2
    Super Moderator
    Points: 69,598, Level: 64
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,224
    Helped
    3250 / 3250
    Points
    69,598
    Level
    64

    Re: Pic32mx Start problem

    Hi,

    33pF for a 20MHz seems (to me) a bit high capacitance.

    What does the XTAL datasheet say?
    And how much I/O capacitance has the clock inverter of the PIC.

    Hopefully it's no breadboard.. --> Show us the PCB layout. Additionally you may show us your schematic.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  3. #3
    Full Member level 1
    Points: 1,721, Level: 9
    dhakeparag81's Avatar
    Join Date
    Jun 2012
    Location
    INDIA
    Posts
    115
    Helped
    1 / 1
    Points
    1,721
    Level
    9

    Re: Pic32mx Start problem

    no its not a bread board,
    i didnt find the proper values for crystal but in datasheet its 22-33pf.

    i dont understand what u mean by how much I/O capacitance has the clock inverter of the PIC??

    - - - Updated - - -

    here is the schematiccontrolller card(3).pdf



    •   AltAdvertisment

        
       

  4. #4
    Super Moderator
    Points: 69,598, Level: 64
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,224
    Helped
    3250 / 3250
    Points
    69,598
    Level
    64

    Re: Pic32mx Start problem

    Hi,

    i didn' t find the proper values for crystal but in datasheet its 22-33pf.
    The problem is: we can not know what XTAL you use. We can not read the datasheet as long as you don't give (a link to) it.

    i dont understand what u mean by how much I/O capacitance has the clock inverter of the PIC??
    Each pin of an IC (combined with it's internal circuitry) acts like a capacitance.
    This capacitance usually is specified in the datasheet.

    When verifying an application because there is an error, I try to go step by step, from source to destination.
    Source: clock generating circuitry
    Destination: (not running) software

    Xtal --> capacitors--> oscillator/inverter --> hardware setup --> software setup

    Without knowing about the XTAL (datasheet), you can not know the (overall) capacitor value
    Without knowing the stray capacitance (PCB layout, I/O capacitance) you can not calculate the values for the external capacitors.
    Without the PCB layout one can no verify proper oscillator/inverter operation.
    Without hardware setup (in many cases the oscillator/inverter of a microcontroller may be configured by fuses or other ways) one can not guarantee proper inverter/oscillator operation.
    And so on...

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  5. #5
    Super Moderator
    Points: 76,741, Level: 67
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    12,551
    Helped
    4185 / 4185
    Points
    76,741
    Level
    67

    Re: Pic32mx Start problem

    The capacitors sound a bit big to me too but the 'finger' effect can be things other than the clock. Are all the peripherals connected when the power is applied? I have seen situations where the micro starts up and initializes a peripheral before it is ready to accept commands and the PIC then sits forever waiting for a response from it. A floating input + finger might mimic a 'ready' signal for example and allow the software to continue running.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  6. #6
    Advanced Member level 1
    Points: 2,189, Level: 10
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    422
    Helped
    42 / 42
    Points
    2,189
    Level
    10

    Re: fPic32mx795f512L Start probleml

    Change

    Code:
    #pragma config DEBUG = ON
    to

    Code:
    #pragma config DEBUG = OFF
    Also turn off analog functions on pins if you are not using ADC.

    Disable JTAGEN_bit and try.



  7. #7
    Full Member level 1
    Points: 1,721, Level: 9
    dhakeparag81's Avatar
    Join Date
    Jun 2012
    Location
    INDIA
    Posts
    115
    Helped
    1 / 1
    Points
    1,721
    Level
    9

    Re: Pic32mx Start problem

    Nice point, all peripheral are connected, there are lcd, key facia with led and so many things,
    from your point i thing there might be a possibility it stuck in i2c eeprom which is before the lcd initialization i confirm it and let u know.
    thank you.

    there are some other observation if i change the osc capacitor to 22pf then it work sometimes lets say 8 times out of 10.



  8. #8
    Super Moderator
    Points: 251,556, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    43,808
    Helped
    13322 / 13322
    Points
    251,556
    Level
    100

    Re: Pic32mx Start problem

    Do I understand right that the problem also occurs with FRC clock source. Then it's surely no crystal oscillator problem.

    If you are already considering a software problem, why don't you start debugging your system with MPLAB debug adapter?



  9. #9
    Advanced Member level 1
    Points: 2,189, Level: 10
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    422
    Helped
    42 / 42
    Points
    2,189
    Level
    10

    Re: Pic32mx Start problem

    If you can use 8 MHz crystal and test the circuit then here is a working circuit. It is the schematic of MCU card provided with EasyPIC Fusion v7 board.

    https://download.mikroe.com/document...anual-v100.pdf

    https://www.mikroe.com/easypic-fusion

    If the code works wih 8 MHz crystal and 22pf capacitors then the issue might be with your crystal circuit (20 MHz, 33pf).



  10. #10
    Full Member level 1
    Points: 1,721, Level: 9
    dhakeparag81's Avatar
    Join Date
    Jun 2012
    Location
    INDIA
    Posts
    115
    Helped
    1 / 1
    Points
    1,721
    Level
    9

    Re: Pic32mx Start problem

    it can be a software problem, but after going through the code i don't think its in software.
    Using debugger, according to my observation when you debug using pickit 3 clocking and other things are given by the pickit i don't know what it doing exactly but i don't see that problem when using debugger, in-fact most of the problem not visible using debugger according to my experience.
    Im trying 8 Mhz crystal with 22pf lets see.



    •   AltAdvertisment

        
       

  11. #11
    Advanced Member level 4
    Points: 7,187, Level: 20

    Join Date
    Jan 2015
    Posts
    1,004
    Helped
    320 / 320
    Points
    7,187
    Level
    20

    Re: Pic32mx Start problem

    Further to ballychic's comment in post #6, the rule is that you should NEVER specify the DEBUG config setting in your code. The IDE will set this for you depending on whether you are doing a 'release' or 'debug' build.
    You shoudl always set the analog/digital setting for all pins that have analog capability. The reason is that the POR setting is for such pins to be 'analog' BUT when you do a 'debug' build, the debug kernel that is loaded with your code will default all such pins to 'digital' mode (there are reasons why this is done). So to be on the safe side, you should always set the ANSEL (or whatever) registers.
    The PicKit3 provides the clock ONLY for the programming phase. Once the program starts to run then whatever clock source you have selected in the config settings and your code will be used.
    Susan



--[[ ]]--