Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Pic32mx Start problem

Status
Not open for further replies.

dhakeparag81

Full Member level 2
Joined
Jun 6, 2012
Messages
131
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Location
INDIA
Activity points
2,406
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
 

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
 

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 schematicView attachment controlller card(3).pdf
 

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
 

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.
 
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.
 

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.
 

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?
 


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.
 

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
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top