CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

problems Motor DC
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
filipe.oliveira



Joined: 17 Apr 2008
Posts: 12
Location: Portugal

View user's profile Send private message

problems Motor DC
PostPosted: Mon Apr 21, 2008 4:03 am     Reply with quote

HI!

i've made the project that control motors DC. In the project i have the IC L298 to control the motors but i have the little (big) problem.

but when i control with the PIC16F876 i repair that the program make things very strange and many times restart the program.. i think the problem is with the power but i want your help and advices...

The shecmatic of project is here:

-> http://bp2.blogger.com/_CMdFaSfw7gY/SAxkR4iBQjI/AAAAAAAAABI/LD-vzYUqgDk/s1600-h/PIC.JPG

-> http://bp3.blogger.com/_CMdFaSfw7gY/SAxkNIiBQiI/AAAAAAAAABA/aop30mxO5_M/s1600-h/MOTORS.JPG

I Wait for yours comments!! thanks a lot!
Matro
Guest







PostPosted: Mon Apr 21, 2008 4:11 am     Reply with quote

- 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







PostPosted: Mon Apr 21, 2008 4:34 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Apr 21, 2008 5:00 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Apr 21, 2008 5:33 am     Reply with quote

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







PostPosted: Mon Apr 21, 2008 5:38 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Apr 21, 2008 6:00 am     Reply with quote

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







PostPosted: Mon Apr 21, 2008 6:01 am     Reply with quote

Did you check the #FUSES NOLVP in your code?

Matro.
filipe.oliveira



Joined: 17 Apr 2008
Posts: 12
Location: Portugal

View user's profile Send private message

PostPosted: Mon Apr 21, 2008 6:52 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Apr 21, 2008 7:06 am     Reply with quote

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







PostPosted: Mon Apr 21, 2008 7:11 am     Reply with quote

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







PostPosted: Mon Apr 21, 2008 7:13 am     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website

OSC
PostPosted: Mon Apr 21, 2008 7:20 am     Reply with quote

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








PostPosted: Mon Apr 21, 2008 7:28 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Apr 21, 2008 7:42 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group