PDA

View Full Version : My board can't start



Sabahan
- 3rd August 2014, 15:42
I am experimenting the 7 segment display on a breadboard,but the circuit just can't start,but when I touches the capacitor that connect the crystal,it start,when my hand left the capacitor,it can hold for a few second and it stop again,what happem?

the schematic and program is in the melab example page

http://melabs.com/samples/PBP-mixed/7segment.htm

AvionicsMaster1
- 3rd August 2014, 17:03
Well, if you're using MELABS program and have it hooked up correctly I'd say your cap is either shorting something out or not connected to breadboard properly. Breadboards are the worst when it comes to mechanical connections.

Try replicating the circuit at a different spot on the breadboard. When you do be sure your connections are correct and no leads are touching that should be separated. More than likely it's just a poor mechanical connection.

Sabahan
- 3rd August 2014, 18:10
I changed the capacitor to a 56pF cap and it works,but switching back to a 22 pF capacitor the circuit just stop,does this something to do with the load capacitance of the crystal?

aerostar
- 3rd August 2014, 19:12
You speak of capacitor - you should have 2 capacitors, one on each leg of the crystal to ground, they are shown on the schematic.

Sabahan
- 4th August 2014, 01:37
Yes I am using two capacitor connector each to the crystal

Bartchou
- 6th August 2014, 03:15
It is probably because the crystal and 22PF capacitor mismatch.
So you hand touches a short time changed your capacitor, so a short time is OK
the others reason:
one of your 22p capacitor is bad.
the wire connect to crystal oscillator is too long.
the capacitors is not connect GND.

Sabahan
- 7th August 2014, 00:47
I was using a 16Mhz crstal for my project,when I switch the crstal to a 4Mhz crystal,everything fine,I wonder why?i found on the internet for calculating the capacitance,it give this fomular

C = 2 x ( CL - C s)
Where C is the capacitor to be connect to the crystal
CL is the crystal load capacitance
Cs is the capacitance of the crystal casing plus the circuitry capacitance
My 16Mhz crystal have a load capacitance of 30pF,the Cs is assume to be 5pF,then my capacitor will be 2x(30-5) = 50pF,but the MCU Datasheet specify that for a 16Mhz crystal,the capacitor should between 10-22pF,so which one is correct?

Bartchou
- 7th August 2014, 02:35
in the PIC programmer ,there is option for oscillation mode.
Are you set the option correct?
-------------------------------------
F0SC1 F0SC0 oscillation mode
0 0 LP(Low Power)
0 1 XT(Crystal/Resonator)
1 0 HS (High Speed)
1 1 RC(Resistor/Capacitor)

the HS > 4M 1M<XT<=4M

Archangel
- 7th August 2014, 18:25
Are you working on a breadboard or PCB ?
Breadboards, especially OLD ones often suffer from stray capacitance and poor connections. Darrel once told me he ONLY used brand new boards. I have disassembled several OLD breadboards to find a surprising amount of corrosion in the fingers.

Archangel
- 7th August 2014, 18:27
in the PIC programmer ,there is option for oscillation mode.
Are you set the option correct?
-------------------------------------
F0SC1 F0SC0 oscillation mode
0 0 LP(Low Power)
0 1 XT(Crystal/Resonator)
1 0 HS (High Speed)
1 1 RC(Resistor/Capacitor)

the HS > 4M 1M<XT<=4M
Always use HS OSC when using 3 wire resonators. This setting allows OSC more current.

Sabahan
- 8th August 2014, 04:15
It is probably because the crystal and 22PF capacitor mismatch.
So you hand touches a short time changed your capacitor, so a short time is OK
the others reason:
one of your 22p capacitor is bad.
the wire connect to crystal oscillator is too long.
the capacitors is not connect GND.

I like to know how to check weather the capacitor is good or bad,I have a ESR meter but it only test capacitor smallest to 1 uF

My crystal is mounted next to the MCU,the capacitor is just next to the crystal

I have used the capacitor ground to test the voltage of the board,its works



I switch the capacitor from 16MHz to 4 MHz and reconfigure the program,it works fine

I google the crystal selection and found that the crystal calculation is as follow

C = (CL - Cstray)* 2
where CL is the load capacitance of the crystal
Cstray is the capacitance of the PCB lead and and crystal casing,maximum around 5 pF

So for my 16MHz crystal,datasheet shows that the load capacitance is 12pF,plug the figure into the equation , the capacitor should be 2 * (12-5) = 14pF,is that correct?

Bartchou
- 8th August 2014, 06:29
Are you working on a breadboard or PCB ?
Breadboards, especially OLD ones often suffer from stray capacitance and poor connections. Darrel once told me he ONLY used brand new boards. I have disassembled several OLD breadboards to find a surprising amount of corrosion in the fingers.
Hello,Archangel
Yes ,I'm work at Nexpcb--PCB fabrication, PCB Assembly, PCB Turnkey Service.
For breadboard, this situation is common occurrence, especially wet environment.
It would be better if covered the Conformal coating on the new assembly board.

Sabahan
- 9th August 2014, 00:24
Are you working on a breadboard or PCB ?
Breadboards, especially OLD ones often suffer from stray capacitance and poor connections. Darrel once told me he ONLY used brand new boards. I have disassembled several OLD breadboards to find a surprising amount of corrosion in the fingers.

After I started this discussion,I made a pcb board,is the same results.


I didn't notice there is a FOSC in the PBP command,upon checking the reference manual,it didn't have much info on the command,only shows in a example program with no explanation on the FOSC command,may I know where you got your info on the command?

Archangel
- 9th August 2014, 04:06
I usually turn off FOSC ( which if memory serves ) is FAIL Safe Oscillator, but specifically I learned the HS_OSC trick from Mackracket who linked to a data sheet which stated that, I will look for that post and add link if I can find it.
You might check that crystal for integrity too.

EDIT: My Bad, I turn off FSCM (Fail safe clock monitor).

Question: What PIC are you using and how is your config statement written?