Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
I see several issues:
* no power supply ceramics caps at the microcontroller and the ULNxxxx
* no RESET circuit at the microcontroller
* no snubber at the relay contacts
* maybe floating pins at the microcontroller
What I don´t see:
* PCB layout
* code, especially port setup, clock setup
* clock circuit
* exact capacitor type and inductor type for the LMxxx
Thanks for be interested.
* i used internal oscillator and turned off MCLR.
* The output of ULN did not need a collector anyway.
* I used a 100nF ceramic capacitor at the PIC supply input.
*I set up the circuit in the datasheet. I used a 100uF electrolyte capacitor at the input, and a 1000uF electrolyte capacitor at the output, its coil is 100uH.
The fail is no surprise. The board is not suitable for switch mode power supply. I´d call it not suitable for a microcontroller, too.
It doesn´t mean that there is no chance to make it running.
What I mean: The behaviour is not predictable, not stable, not reliable.
* ULN: for sure you use the collectors.
* I don´t see a ceramics capacitor in your whole circuit. Neither in the schematic nor in the photo.
* There is more than "1000uF" or "100uH" of a capacitor/coil specification. Otherwise the datasheet would be very short ;-)
* usually it´s impossible to follow the layout guidelines on a strip board
I´m not familiar with PICs, but from your code I don´t see PortA to be defined at all. So I guess there are pins left floating.
I have previously run for a motor with the 7805 IC, but I need to set up the stable circuit required for the LM2576. What kind of additions should I make in the power part?
If you have a scope, a DSO, set it up to one shot trigger on Vcc transient, say
1 V outside its rail. Also look at reset pin, ground bounce on the board, etc..
See if you can capture the transient to get some clues.
Not not all caps equal in ESR for same value cap, choose carefully. Look at bypass
recommendations of the micro as well.
Does micro ground meet motor grounds/relay current at board edge. I see no
ground buss, rather connections with a lot of parasitic L in them that create
transients. Micro bypassing, both ceramic and bulk at Vdd pin.
A schematic shows only that it is connected.
But for a real circuit it is important "how" it is connected.
General rule recommendation:
* Use a solid (really solid, no traces, no copper pour) GND plane (you don´t have)
* connect the microcontroller_gnd with very short connection to the GND plane
* place the capacitor close to microcontroller_vcc pin
* connect capacitor to microcontroller_VCC with very short trace
* connect the capacitor_gnd with very short connection to the GND plane
--> the same applies to every supply pin of every IC (also the ULNxxx)
Please explain more about what you mean by the MCU "becomes unusable. PIC hangs"?
How do you know it 'hangs'? Is it even running?
Have you put a scope on the output pins to make sure they are switching correctly and at the required times and sequence?
The way you have written your code it is very susceptible to RMW failures.
Susan
thanks for your answer.
* When I tried to program the PIC16F628A, I said something like that because my PICKIT3 programmer did not see the microprocessor.
* I cannot find time to watch the transitions, as I give electricity, my microprocessor is broken.
So to be clear, you have NOT programmed the PIC MCU at all yet!
All of the above hardware-related comments still apply but until you can program the MCU then it is all just guesswork.
I suggest that you concentrate on getting the code to run and then connect the rest of the hardware - solve one problem at a time.
How are you connecting the PicKit3? I note that the MCLR line is shown as disconnected on your schematic (post #1) as are RB6 and RB7. Is the PicKit3 the only thing connected to these lines or are there other parts of the schematic missing?
What IDE are you using? MPLAB X? I assume so as you appear to be using the XC8 compiler.
Have you got the PicKit3 configured to use High-voltage programming (at least after the first programming of the MCU) as you have turned off LVP? (Personally I would not do that yet - you don't appear to be using RA5 [the same pin as \MCLR\] for anything so this just adds a complication as to when the code starts running.)
Are you disconnecting the PicKit3 after programming?
Are you compiling for debug or release?
Susan
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.