Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

ttl switching 12V supply

Status
Not open for further replies.
ptewright said:
eblc1388 said:
Jay.slovak said:
I will make and send you sample code in Assembly, wait... :wink:

I do not want any assembly code. The drawing & code is related to this thread by ptewright. I just wonder about the rb0 and RB1 notation.

Sorry, I changed the output pin to rb1, just to see if the pin was broken. It didn't make a difference.

From my testing, it seems that the PIC is resetting every time it tries to drive the motor, that is why it never turns off.
So then i tried setting rb1=0 first, then rb1=1 second. When tested, the motor is off for 30seconds, then the motor turns on for about 2 seconds, and the whole thing resets, so motor is off for another 30 seconds, then it tries to turn on the motor for like a few seconds, and then automatic reset again........... :twisted:

(and obviously, if i take out the motor, then the PIC does the on/off thing properly)

why is that??? is the PIC not able to drive the mosfet???
is there a way to stop the resetting?
I didn't think that this circuit would be so complicated!!! :shock:
Please try my Code! and make sure your Reset Pin has Pull-up or is disabled, and your power is blocked with 100nF Cap!

AND the Watch-dog timer is disabled!
 
Hi ptewright,

Obviously you have a 12V supply which does not supply enough current for the motor.

Try Jay's code and my hardware connection of adding a diode and a 470uF or higher value capacitor.

Sorry Jay, I don't know you do not speak C because I saw your posting about C compiler.
 

Attachments

  • mycircuity.gif
    mycircuity.gif
    12 KB · Views: 499
eblc1388 said:
Sorry Jay, I don't know you do not speak C because I saw your posting about C compiler.
That's OK, I don't speak it now, but I want to learn it soon, so I was searching for compillers... (I got C18 pretty cheap)
 
eblc1388 said:
Hi ptewright,

Obviously you have a 12V supply which does not supply enough current for the motor.

Try Jay's code and my hardware connection of adding a diode and a 470uF or higher value capacitor..
Also add 100nFcappacitor, it is very important! And check the MCLR and WDT settings!
 
eblc1388 said:
Hi ptewright,

Obviously you have a 12V supply which does not supply enough current for the motor.

Try Jay's code and my hardware connection of adding a diode and a 470uF or higher value capacitor.

Sorry Jay, I don't know you do not speak C because I saw your posting about C compiler.

My ammeter shows that the circuit only consumes 0.5A when the motor is on. My power supply is rated for 3A.
It didn't work.
 
ptewright said:
eblc1388 said:
Hi ptewright,

Obviously you have a 12V supply which does not supply enough current for the motor.

Try Jay's code and my hardware connection of adding a diode and a 470uF or higher value capacitor.

Sorry Jay, I don't know you do not speak C because I saw your posting about C compiler.

My ammeter shows that the circuit only consumes 0.5A when the motor is on. My power supply is rated for 3A.
It didn't work.
Ok, that is not your problem :cry:

Try my code... :roll:
 
ptewright said:
My ammeter shows that the circuit only consumes 0.5A when the motor is on. My power supply is rated for 3A.
It didn't work.

Is it so difficult to try the addition of a diode and a capacitor?

You'll never know until you have tried. I promise you I would not explain to you why it works.
 
Jay.slovak said:
eblc1388 said:
Hi ptewright,

Obviously you have a 12V supply which does not supply enough current for the motor.

Try Jay's code and my hardware connection of adding a diode and a 470uF or higher value capacitor..
Also add 100nFcappacitor, it is very important! And check the MCLR and WDT settings!

Where do I added the 100nF capacitor?
I decided to disable MCLR by setting the config register to 0x2101;
 
eblc1388 said:
ptewright said:
My ammeter shows that the circuit only consumes 0.5A when the motor is on. My power supply is rated for 3A.
It didn't work.

Is it so difficult to try the addition of a diode and a capacitor?

You'll never know until you have tried. I promise you I would not explain to you why it works.
Yep, just try it 8)
 
Jay.slovak said:
eblc1388 said:
ptewright said:
My ammeter shows that the circuit only consumes 0.5A when the motor is on. My power supply is rated for 3A.
It didn't work.

Is it so difficult to try the addition of a diode and a capacitor?

You'll never know until you have tried. I promise you I would not explain to you why it works.
Yep, just try it 8)

Sorry, but adding that didn't help....
 
ptewright said:
eblc1388 said:
Hi ptewright,

Obviously you have a 12V supply which does not supply enough current for the motor.

Try Jay's code and my hardware connection of adding a diode and a 470uF or higher value capacitor.

My ammeter shows that the circuit only consumes 0.5A when the motor is on. My power supply is rated for 3A.
It didn't work.
 
ptewright said:
ptewright said:
eblc1388 said:
Hi ptewright,

Obviously you have a 12V supply which does not supply enough current for the motor.

Try Jay's code and my hardware connection of adding a diode and a 470uF or higher value capacitor.

My ammeter shows that the circuit only consumes 0.5A when the motor is on. My power supply is rated for 3A.
It didn't work.
Post the picture of the asembled device.
 
Jay.slovak said:
eblc1388 said:
Jay.slovak said:
I will make and send you sample code in Assembly, wait... :wink:

I do not want any assembly code. The drawing & code is related to this thread by ptewright. I just wonder about the rb0 and RB1 notation.
But I already made you one :cry: ...

Give it a try... it's HEX, Internal Oscilator, No MCLR... 16F627, It sets PORTB on and OFF every second.

I couldn't get your code to work with my PIC.
Why is the BOREN bit set. What does the brown-out do?
 
ptewright said:
Jay.slovak said:
eblc1388 said:
Jay.slovak said:
I will make and send you sample code in Assembly, wait... :wink:

I do not want any assembly code. The drawing & code is related to this thread by ptewright. I just wonder about the rb0 and RB1 notation.
But I already made you one :cry: ...

Give it a try... it's HEX, Internal Oscilator, No MCLR... 16F627, It sets PORTB on and OFF every second.

I couldn't get your code to work with my PIC.
Why is the BOREN bit set. What does the brown-out do?
BOREN stands for Brown-out RESET, when there is a power drop below valid operational voltage of the PIC, it will RESET the PIC to ensure that everything will execute correctly.

What's wrong with the Code?
 
Jay.slovak said:
What's wrong with the Code?

Ok the code does work.
when ran without the motor connected, it turns on/off every 5s.
when hooked up to the motor, that varies.
where do i hook up the 100nf capacitor that you mentionned earlier.

About the brown-out. Other then setting the boren bit in the option register, what else do i need to set for it to work (I'm programming it in C)

thanks for all your help
 
ptewright said:
Jay.slovak said:
What's wrong with the Code?

Ok the code does work.
when ran without the motor connected, it turns on/off every 5s.
when hooked up to the motor, that varies.
where do i hook up the 100nf capacitor that you mentionned earlier.

About the brown-out. Other then setting the boren bit in the option register, what else do i need to set for it to work (I'm programming it in C)

thanks for all your help
The Cap goes from +5V to GND, it is important!
Just set the BOREN bit, and that's it. Nothing to set in software.
(Only If you want to know what sort of reset happened, you need to check PD and TO bits in STATUS reg, check Datasheet).
 
Jay.slovak said:
The Cap goes from +5V to GND, it is important!
check PD and TO bits in STATUS reg, check Datasheet).

In my circuit I already have a 1uF between the 5V output from the regulator and ground, is that not ok? should i replace that with a 100nf?
 
ptewright said:
Jay.slovak said:
The Cap goes from +5V to GND, it is important!
check PD and TO bits in STATUS reg, check Datasheet).

In my circuit I already have a 1uF between the 5V output from the regulator and ground, is that not ok? should i replace that with a 100nf?
Just add it there, ceramic 100nF will effectively damp any HF noise (due to high-speed character of the PIC).

I remember that once I forgot to put it there, and the PIC started to oscilate, turn very Hot and almost poped in my face...
 
Jay.slovak said:
ptewright said:
Jay.slovak said:
The Cap goes from +5V to GND, it is important!
check PD and TO bits in STATUS reg, check Datasheet).

In my circuit I already have a 1uF between the 5V output from the regulator and ground, is that not ok? should i replace that with a 100nf?
Just add it there, ceramic 100nF will effectively damp any HF noise (due to high-speed character of the PIC).

I remember that once I forgot to put it there, and the PIC started to oscilate, turn very Hot and almost poped in my face...

Is it possible to write up what you did in your .hex file?
I would like to write that in C.
 
ptewright said:
Jay.slovak said:
ptewright said:
Jay.slovak said:
The Cap goes from +5V to GND, it is important!
check PD and TO bits in STATUS reg, check Datasheet).

In my circuit I already have a 1uF between the 5V output from the regulator and ground, is that not ok? should i replace that with a 100nf?
Just add it there, ceramic 100nF will effectively damp any HF noise (due to high-speed character of the PIC).

I remember that once I forgot to put it there, and the PIC started to oscilate, turn very Hot and almost poped in my face...

Is it possible to write up what you did in your .hex file?
I would like to write that in C.
I can send you the ASM file or I will describe it "oraly"...

So you say, the whole thing works OK?
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top