CCP pins + Vreg broken?

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

Post Reply
D.Bouchier
Posts: 28
Joined: Tue Sep 28, 2010 12:36 pm
Has thanked: 5 times
Been thanked: 1 time
Contact:

CCP pins + Vreg broken?

Post by D.Bouchier »

Hello,

I think i like to break stuff because i have yet again a fault in my hardware.

i was operating a 12 watt motor 12v/1amp, with pwm ccp1 and after some time the motor kept bieing in the on state.

So i grabed my multimeter and checked the voltages. CCP1/RC2 was +5V, CCP2/RC1 was 0V and the output of my Vreg was 8-9V.

So i programmed to toggle all C and B pins to check if they where still functioning, all pins execpt RC1 & 2, did indeed function normally.

Is there a solution for this, or is it a harware faillure?

What is the best way to prefent this from happening again (I did not place a free-running diode, I should have)?

Howcome RC1 is broken aswell while i didnt use this pin?

RB3 still works, this is the alternative CCP2 pin, configurating it in the ext properties menu of the PWM compoment results in nothing, should i try doing this in C?

And i really dont understand how the Vreg broke aswell, i cant use 12v on my basic board anymore, i need to draw power from usb atm, but I can replace the 7805, but how did it brake?

ps. i already blew up a driver chip from the powerblock earlier and replaced it, but i think that survived this time.

Thanks in advance

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: CCP pins + Vreg broken?

Post by Benj »

Hello,

To move the CCP to the alternate pin you must change the setting in the PWM component property and you must also change the configuration setting which controls the CCP2 output allocation. Once you have done both of these items the pin should be changed.

Do you know how much current you are drawing out of the CCP pin. A I/O pin can normally only sink or source around 20mA. You may also want to check how much current your regulator can source. Adding an electrolytic capacitor and a ceramic capacitor on either side of the regulator should help to stabilise the power rails. If the CCP peripheral has been damaged eg by over current or back EMF then this will probably have taken out the whole CCP module which is probably why your other CCP pin isn't working. Small note that the PWM module uses timer1 so if you are using timer1 in your program then this will cause issues.

A free running diode may help to protect your regulator and the microcontroller itself from any back EMF spikes caused by the motor.

You also may want to add a schottky diode or similar to your USB supply so this doesn't get damaged from any back EMF generated by the motor.

D.Bouchier
Posts: 28
Joined: Tue Sep 28, 2010 12:36 pm
Has thanked: 5 times
Been thanked: 1 time
Contact:

Re: CCP pins + Vreg broken?

Post by D.Bouchier »

Hi,

I don't think I clearly told you my set-up.

I was driving the motor with the power E-block EB011. So I would think the CCP pin did not draw alot of current, just to put the signal to the IC of the EB011.

My regulator is the one on the EB061 (ECIO base board) and considering i was using 12V, it did not have to source alot. The capacitors are already on that board.

So I still have 4 concerns:

1) how did the ccp and Vreg blew up when the ccp signal was only used to drive the powerboard which uses 12V for power?
2) If my CCP module is damaged, would the alternate PWM channel still work?
3) So if my CCP module is damaged, this is the reason RC1&2 don't even work as regular outputs anymore?
4) Im not using 5v to supply any inductive load, do i still need the free running diode to protect the microcontroller and Vreg or is it just for the power board?

ps. the powerboard did survive this time, which was the one that broke a previous time when i switched the motor off/on to frequently

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: CCP pins + Vreg broken?

Post by Benj »

Hello,

Ah thats great I understand now.
What is the best way to prefent this from happening again (I did not place a free-running diode, I should have)?
The L293D chip has the diodes already fitted inside. When you blew up your original L293D did you replace it with a L293D or simply a L293? The non D version does not include the protection diodes. Also how did you blow up the orignal IC?
And i really dont understand how the Vreg broke aswell
We have found that if the voltage present on the output side of the regulator is greater then the input voltage then this can cause the regulator to fail and break possibly cause by a spike travelling from the motor through the L293 and then through the ECIO and finally through the regulator. Seems a bit unlikely to me but can't think of any other reasons. Are you supplying power to the EB011 from the ECIO EB061 terminals or are you using a seperate PSU?
i was operating a 12 watt motor 12v/1amp
The L293D chips are not rated to take this kind of a load. I think each output has a limit of around 600mA. This could be part of the problem. Maybe under voltaging the motor a bit or using a smaller motor would help to keep the current usage down.

There is protection on the EB011 in the form of resettable fuses but these are fairly slow and will not stop fast spikes from a motor. This is why the L293D chip is used so the diodes in the chip can also help to protect the system.
If my CCP module is damaged, would the alternate PWM channel still work?
Probably not but its worth a quick try to see if the PWM peripheral has been damaged.
So if my CCP module is damaged, this is the reason RC1&2 don't even work as regular outputs anymore?
When you were trying to use the regular outputs did you have the PWM output enabled still or did you create a program without any PWM outputs. I think the PWM will override the output signal if the PWM module has been enabled in the program. Alternativly when and if the PWM peripheral was damaged it could have also taken down some of the port functionality. Really is a bit of a guessing game once the devices have been damaged. Good news is that they are quite hard to damage in the first place. Main reason for damage in my experience is over voltage on a I/O pin or prolonged shorting of an output pin.

D.Bouchier
Posts: 28
Joined: Tue Sep 28, 2010 12:36 pm
Has thanked: 5 times
Been thanked: 1 time
Contact:

Re: CCP pins + Vreg broken?

Post by D.Bouchier »

Thanks for the expanded response,

I replaced the L293D in a manner that i can't even tell anymore which one i replaced, so it had exactly the same name, i blew up the original one with the same motor, but switching it on/off too fast and frequently.

I was supplying from the baseboard with the terminals.

I made a mistake, the motor is 500mA at stall, it sounds like an excuse, but the only one i would be cheating is myself.

I tried to get the alternate PWM pin to work, but i failed to enable it, even with an undamaged ECIO40, i used your explination from this topic:
http://www.matrixmultimedia.com/mmforum ... ccp#p15471

With the modified FCD file

When i was trying my c1&2 as regular outputs, pwm was disabled, so i guess those 2 pins are just ruined, ill try bitbanged PWM, thanks for all te help

Post Reply