Power problems


Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 40 of 51

Thread: Power problems

  1. #1
    Join Date
    Jun 2008
    Posts
    84

    Default Power problems

    this is mostly hardware related, but maybe someone can help.

    I'm using PIC16F877A as described in this circuit :
    http://dj-gil.com/PIC/posts/SCHEMATIC4.pdf

    When I use the programmer to power the circuit everything is ok.
    But when I use the the 7805 to power the circuit I get junk on my LCD and nothing works.
    Any ideas ?

    BTW, the transformer is standard adjustable DC adaptor so it aleady has diode bridge inside.


    Thanks.
    Last edited by menta; - 27th July 2008 at 18:55.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by menta View Post
    BTW, the transformer is standard adjustable DC adaptor so it aleady has diode bridge inside.
    What is the voltage out of the transformer?
    May not be high enough.
    What is the 7805 voltage when circuit is on (LCD)
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    transformer output without load is ~16V.
    7805 output is 4.95 while its on.

    I have another circuit usining the same parts, with one change, I use the PIC Kit2 demo board with 16f887 which works ok.
    When I use its 5V power for the second circuit I get the same results.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Menta, 4.95V is good. Whats the current rating on the transformer? I can see maybe over an amp of current straight off without studying the schematic for longer than a few minutes. Perhaps there is just not enough current to power the LCD? Failing that, what is the current rating for your 7805? Depending on the package they're good for between 250mA and about 500mA. Try putting 2 in parallel (If the tranny has an output of greater than 1500mA)

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    In that schematic, I don't see anything connected to MCLR. If MCLR is floating, or worse grounded, the program might not get the chance to start.
    Try adding a +5v line to the MCLR pin on the '887 and see what happens.
    The program may already have the MCLR pin configured as an I/O, but we won't know without seeing the actual program itself.

    Also, are you using an 887 or 877A? Because there is no 887A...

  6. #6
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Yes, its 16f877A, my mistake.
    I tried connecting the MCLR pin to the +5v but it didn't help.
    It also didn't help using 2x 7805.
    Its very strange because I have another circuit just exact to this one but using a 887 on a demo board.
    BTW, if I use the programmer voltage output (just + and - ) and connect them to the circuit its also working ok.

  7. #7


    Did you find this post helpful? Yes | No

    Default

    You don't have enough current. Can't be anything else then. Do you have a multimeter? whats the current drain on the circuit?

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by menta View Post
    Yes, its 16f877A, my mistake.
    I tried connecting the MCLR pin to the +5v but it didn't help.
    It also didn't help using 2x 7805.
    Its very strange because I have another circuit just exact to this one but using a 887 on a demo board.
    BTW, if I use the programmer voltage output (just + and - ) and connect them to the circuit its also working ok.
    Are you using the same program between the 887 on the demo board and the 877A in the circuit? If so, it won't work.

  9. #9
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    The program is working when I use the programmer as power supply.
    I of course compiled the program differently for each controller.
    I have multimeter, What is the best way to check the current ?
    serially to the + ?

  10. #10
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by menta View Post
    The program is working when I use the programmer as power supply.
    I of course compiled the program differently for each controller.
    I have multimeter, What is the best way to check the current ?
    serially to the + ?
    That's practically the only way to measure it (short of using a series resistor).
    Connect the meter in-line with the positive supply and the positive on the circuit.
    Make SURE your meter can handle an amp or more.
    If it can't handle that, you'll either smoke your meter or just blow a fuse.

  11. #11
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    I will.
    If I use the second circuit 7805 output and connect it to the first circuit (with the 16f887) it is working ok. (it has same parts including the LCD)

  12. #12
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    i'm using a code to print 1,2,3... to the LCD
    I see that it prints the numbers but also print junk,
    So I guess something is making noise on the LCD input.
    Tried with a resistor to the ground and some 22pF capacitors, but it doesnt help.

  13. #13


    Did you find this post helpful? Yes | No

    Default

    Yes, serially connect the meter to +, set it to 10 Amps. Why not do the following. Use 1 7805 for the display and another 7805 for the PIC. you can place the circuits in parallel if you so wish. you will need a third 7805 (maybe) for the 2803. Keep us informed if you can

  14. #14
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Guys,
    I have a another circuit with 1 7805 that push the PIC16f887 and the same LCD type.
    I think its something else.

  15. #15
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Post some code!!!

  16. #16
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    You should have the MCLR set per the 16F877A datasheet. Note that the 16F887 "has a noise filter in the MCLR Reset path. The filter will detect and ignore small pulses.". This along with the different clock circuits on the 887 makes enough of a difference.

    A simple test code which works on both the 877A and 887, as previously suggested, will also provide some insight.

  17. #17
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    languar I didn't get you point.
    Code:
    DEFINE OSC 8
    a var byte
    a=0
    TRISB=$0
    test:
    SEROUT PORTB.0,4,[254,128,#a]
    a=a+1
    pause 1000
    goto test
    
    end
    Last edited by menta; - 28th July 2008 at 09:07.

  18. #18
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    What I am trying to say is that the 887 and 877A are not exactly identical. The MCLR input (something that can be associated with such problems) are quite different on both devices. My suggestion is to connect the MCLR to Vdd on the 877A using the R-C-R circuitry in the datacheet.

    Also, the OSC input circuitry are not the same on both devices. Do both circuits you have (i.e. working 887 and non-working 877A) use the same external crystal circuit, or does the 887 uses the internal oscillator?

    The code you have posted works on the 887, but not on the 877A? Is this correct?

  19. #19
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    I tried to connect the MCLR stright to the +5V. Didnt help. Will try with RCR.
    887 use internal OSC while the 877A use an external.
    The code works perfect on both devices when using the USB programmer to power up the circuit.
    When I use the 7805 to power the 877A, it fails. 887 is running with the same 7805 with no problems.
    I see that the program run, I see it print something every 1 second, It start to print 1,2 and then it print junk every 1 sec. Thats why I think the LCD get some noise. I tried with R-C to the ground, but it doesn't help.

  20. #20


    Did you find this post helpful? Yes | No

    Default

    With regard to this circuit, take the 2803 out of the circuit and try it. If it still doesn't work, it's not power related, then we can look at noise somewhere. Have you got a photo of this setup?

  21. #21
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hi Menta,
    You know, the schematic you posted has 1 rather serious omission, in that it is sending AC and not DC to the regulators. Did you install a bridge between the transformer and the regulators? Cause ME-THINKS AC ain't going to work.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  22. #22
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    From my first post
    Quote Originally Posted by menta View Post
    BTW, the transformer is a standard adjustable DC adaptor so it already has diode bridge inside.
    I'm not using anything beside the PIC and the LCD.

  23. #23


    Did you find this post helpful? Yes | No

    Default

    noise my friend, seems the only option at this stage.

  24. #24


    Did you find this post helpful? Yes | No

    Default

    or your display is messed up. Checked the leads into the display?

    Just out of curiosity, what is the rating on the tranny? and what was the total current draw on the circuit?

  25. #25
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    And once again, it sounds like it's time to go back to the drawing board with a 'blinky led'...
    Yes I know it supposedly works fine on the '887 demo board, that's great.
    Add an LED to the 877A board and get that working, then build back up to a clone of the 887 demo board.

  26. #26
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Guys,
    Everything is working perfect when I use the programmer power.
    A ~700 lines code.
    The problem is very simple when connecting outside power source.

  27. #27
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    I build a temporary new board and it works ok.
    Maybe something is wrong with the other board.
    I might build it fro scratch again.
    Thanks.

  28. #28
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by menta View Post
    Guys,
    Everything is working perfect when I use the programmer power.
    A ~700 lines code.
    The problem is very simple when connecting outside power source.
    Does it run if you manually RESET (pull MCLR to ground) it after power up?
    If so, put a capacitor across MCLR and ground, and a resistor between Vdd and MCLR.
    The problem might be that MCLR is coming up faster than Vdd.
    An R/C across MCLR might slow it up just enough to meet the chip's MCLR timings.

  29. #29
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    On the temporary board the led was blinking very fast (suppose to have 1 sec pause)
    Only when I set MCLR to +5v it started to run ok.

  30. #30


    Did you find this post helpful? Yes | No

    Default

    Sounds like bad soldering or bad connections. Glad you have it sorted though. External power source making it work points to sever current loss accross your tranny/7805 circuit. Could it be your bridge rectifier is shot in the tranny? low power output?

  31. #31
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by menta View Post
    On the temporary board the led was blinking very fast (suppose to have 1 sec pause)
    Only when I set MCLR to +5v it started to run ok.
    The LED was probably dumping your +5v line repeatedly causing a brown out causing your PIC to reset making it look like it was blinking really fast (which it probably was). If your MCLR was floating (i.e. not connected), same thing may happen (i.e. brown out triggers MCLR just by chance). Connecting MCLR to Vdd might've help alleviate the situation, but sounds to me like a temporary fix.
    Not a good practice to leave MCLR floating, unless you are absolutely sure it's tied internally (which I'm not sure the 16F877A has that exact option).
    Add an extra resistor inline with your LED (make it really dim), pull the +5v off of MCLR and see what happens (less current flow across the LED, less load on the main +5v rail, etc).
    Then maybe try adding another capacitor between Vdd and Vss...can never have too much of that...

  32. #32
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    Never mind

  33. #33


    Did you find this post helpful? Yes | No

    Talking

    Dammit!!!! Didn't spot the MCLR pin wasn't connected in the schematic. Maybe need new glasses!!!!!!

  34. #34
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Well, I really dont know what do more.
    On the test board everything was ok. The LED was blinking, the LCD shows the numbers.
    Now I wrap it again and it aint work, unless I touch the 8Mhz crystal with my hand ;-0

  35. #35
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    And ofcourse, if using the programmer power , everything is ok (with MCLR stright to the +5v)

  36. #36
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by menta View Post
    Well, I really dont know what do more.
    On the test board everything was ok. The LED was blinking, the LCD shows the numbers.
    Now I wrap it again and it aint work, unless I touch the 8Mhz crystal with my hand ;-0
    That usually indicates a missing ground and/or pullup or pulldown somewhere, likely on MCLR, or missing cap's between Vdd and Vss (both pairs and across the pairs).

  37. #37
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    Look at the grounds. Make sure they are very nice, short, and fat traces (or wires). The traces (or wires) from the crystal to the PIC should be as short as possible. The capacitors on the crystal should also be as close as possible to the PIC, with direct connection to GND. Pay good attention to the MCLR connection (follow the datasheet, they did not went through all that trouble for no reason).

    This is what I tried to explain before. The 877A has external MCLR and external oscillator (the 887 has the capability to run both of them internally - not good comparison).

  38. #38
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    How do you explain that when using the power from the programmer, everything is OK ?

  39. #39
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by menta View Post
    How do you explain that when using the power from the programmer, everything is OK ?
    The programmer may hold MCLR low while Vdd comes up and release MCLR after a few milliseconds. Put a 'scope on it and see if you can see anything.

  40. #40
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    I'm not using all programmer legs, just + and -

Similar Threads

  1. Battery powered applications
    By NavMicroSystems in forum Off Topic
    Replies: 7
    Last Post: - 22nd June 2009, 07:12
  2. Pic getting part power from Analog Port
    By ShaneMichael in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 22nd April 2009, 10:34
  3. HSerin problems on power up
    By Luckyborg in forum Serial
    Replies: 8
    Last Post: - 21st April 2009, 19:49
  4. 12 Servo's together does not seem to work, Power problem
    By macx75 in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 13th December 2006, 19:30
  5. problems on power up of PIC
    By dmairspotter in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 13th June 2006, 14:11

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts