View previous topic :: View next topic |
Author |
Message |
filipe.oliveira
Joined: 17 Apr 2008 Posts: 12 Location: Portugal
|
|
|
Matro Guest
|
|
Posted: Mon Apr 21, 2008 4:11 am |
|
|
- Add a 100nF capacitor between Vdd and GND as close to the PIC as possible
- Same thing between MCLR and GND
- Check that the "NOLVP" fuse is present in you code.
Matro. |
|
|
Ttelmah Guest
|
|
Posted: Mon Apr 21, 2008 4:34 am |
|
|
Are the motors being run off the 5v, or 12v (this seems to be controllable by SW3)?. What current do the motors draw?. What is the 'battery' feeding the circuit (Ah rating, how thick are the wires etc.). How is the ground connection made to the PIC, and the motors?.
The capacitance shown on the 12v rail that I can see, is the 2*0.33uF by the input side of the regulator, and the 0.1uF by SW3. Depending on the source impedance of the supply, and the load of the motors, this may be much too small.
Best Wishes |
|
|
filipe.oliveira
Joined: 17 Apr 2008 Posts: 12 Location: Portugal
|
|
Posted: Mon Apr 21, 2008 5:00 am |
|
|
thansk for yours replys
the motors are run at 12V and the batery is 2000mAh..
i will change the capacitors..
and out the capacitor between Vdd and GND and MCLR and GND..
thks |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Mon Apr 21, 2008 5:33 am |
|
|
I think that the scheme used as main oscillator should not work properly. An external oscillator
needs a buffered front end. Without a positive feedback, the generated crystal signal is too weak
to drive the oscillator input.
Humberto |
|
|
Matro Guest
|
|
Posted: Mon Apr 21, 2008 5:38 am |
|
|
Humberto wrote: | I think that the scheme used as main oscillator should not work properly. An external oscillator
needs a buffered front end. Without a positive feedback, the generated crystal signal is too weak
to drive the oscillator input.
Humberto |
The Xtal connection is "standard".
Did you see the connection to OSC1 done by netname "Cristal"?
Matro. |
|
|
filipe.oliveira
Joined: 17 Apr 2008 Posts: 12 Location: Portugal
|
|
Posted: Mon Apr 21, 2008 6:00 am |
|
|
thks Matro,
Humberto you can see the netname "Cristal" that connect the crystal to the pin 9 ("OSC1")
and i have more information:
when i put on my circuit but unconnect the motors the program works fine.. everything works very well.. but when i connect the motors is the problem... sometimes program restart and sometimes the program make things very strange... like the motors blocks in the same way and i have shutdown the circuit to stop the motors |
|
|
Matro Guest
|
|
Posted: Mon Apr 21, 2008 6:01 am |
|
|
Did you check the #FUSES NOLVP in your code?
Matro. |
|
|
filipe.oliveira
Joined: 17 Apr 2008 Posts: 12 Location: Portugal
|
|
Posted: Mon Apr 21, 2008 6:52 am |
|
|
no.. i don't have... at the moment i'am in work but when i arrives at home i try this...
but what this line made? |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Mon Apr 21, 2008 7:06 am |
|
|
Matro wrote:
Quote: |
The Xtal connection is "standard".
Did you see the connection to OSC1 done by netname "Cristal"?
|
The posted oscillator scheme it is not "standard" as you say.
ALL the Microchip 16/17 MCU family devices use the Pierce parallel resonant oscillator circuit.
The basic principle of this oscillator is that the output of an inverting amplifier is feed back to
its input creating an "unstable" loop. When the inverter output is high and fed back to the input,
output goes low, reversing the process as long as the power is present.
All the crystal oscillator modes needs a crystal connected across OSC1/OSC2.
Humberto |
|
|
Matro Guest
|
|
Posted: Mon Apr 21, 2008 7:11 am |
|
|
filipe.oliveira wrote: | no.. i don't have... at the moment i'am in work but when i arrives at home i try this...
but what this line made? |
This line disable Low Voltage Programming (that is enable by default)/
This feature (that almost nobody uses) can lock the MCU simply because of a high voltage on the LVP pin. The MCU then switches in programming mode and wait for flash to be programmed.
Matro. |
|
|
Matro Guest
|
|
Posted: Mon Apr 21, 2008 7:13 am |
|
|
Humberto wrote: | Matro wrote:
Quote: |
The Xtal connection is "standard".
Did you see the connection to OSC1 done by netname "Cristal"?
|
The posted oscillator scheme it is not "standard" as you say.
ALL the Microchip 16/17 MCU family devices use the Pierce parallel resonant oscillator circuit.
The basic principle of this oscillator is that the output of an inverting amplifier is feed back to
its input creating an "unstable" loop. When the inverter output is high and fed back to the input,
output goes low, reversing the process as long as the power is present.
All the crystal oscillator modes needs a crystal connected across OSC1/OSC2.
Humberto |
That's what is done here... Definitely. ;-)
Matro. |
|
|
horkesley
Joined: 20 Feb 2007 Posts: 48 Location: Essex UK
|
OSC |
Posted: Mon Apr 21, 2008 7:20 am |
|
|
There is nothing wrong with the osc circuit. Look at the netname.
The problem is almost certainly to do with voltage spikes from the motor.
Regards _________________ Horkesley Electronics Limited |
|
|
Guest
|
|
Posted: Mon Apr 21, 2008 7:28 am |
|
|
i also think it's everything ok with oscilator!!
i will try use: #FUSES NOLVP
and i said something..
thanks |
|
|
filipe.oliveira
Joined: 17 Apr 2008 Posts: 12 Location: Portugal
|
|
Posted: Mon Apr 21, 2008 7:42 am |
|
|
Anonymous wrote: | i also think it's everything ok with oscilator!!
i will try use: #FUSES NOLVP
and i said something..
thanks |
i'me sorry i wrote this as guest.. i forgot log in.. :P |
|
|
|