Power Supply Integration

Ed Straker

Active member
Taking the plunge into MCU's....finally, and the old grey cells aren't as sharp as they used to be. I'm very much an analog guy.
This is actually a 2 part question:

1) On page 26 of Manual1 the diagram indicates the setup for the >5v supply which I plan to use on my custom programing board. It shows 4 decoupling/noise suppression caps (I assume). However...

2) On page 27, 28, 31, and 33 of Manual1 it shows the basic operating circuit of the PICAXE which also includes a decoupling cap on the 5v supply pins.

The question is if the >5v supply circuit is used, is the 100uF cap on the operating circuit still required? If so why? (just curious)

Thanks in advance for any help on this.
 

oracacle

Senior Member
you need noise supression the microcontroller side as all the switching can cause noise on its own power rails.
The other side is to deal with both noise and voltage droop. Batteries aren't great at delivering a when a suden current draw appears on the system. Say you start a motor (via a transiostor or mosfet) that takes power from the supply side of the regulator it causes enough of a voltge sag to drop below the minimum voltage of the regulator and the picaxe will reset.
As far as i understand its standard practice when build digital circuit. Just wait till you find yourself in the world of switch mode power supplies.
 

Technoman

Senior Member
A decoupling capacitor should be placed as close to the pins of the MCU as possible. Page 26 only concerns the regulator where capacitors should be also placed as close as possible to it.
 

hippy

Technical Support
Staff member
Should I still leave the 100nF cap across the power pins on the MCU if using the greater than 5v supply circuit diagram on page 26
My recommendation would be yes. The point of reservoir and decoupling caps are to keep the voltage rails stable and noise free and, except in extreme or particular cases you can't have too much of a good thing., the more the better.

100nF across the power rails close to every chip is always recommended . That's regardless of what other capacitors may be used with a supply.

Code:
                       _____
                      |     |
+V >--|>|--.-----.--->| REG |---.-----.-- - - --.----------.--------> 5V
           |     |    |_____|   |     |         }-----.    }-----.
         __|__ __|__     |    __|__ __|__     __|__   |  __|__   |
         --.-- =====     |    --.-- =====     --.--   |  --.--   |
           |     |       |      |     |         }---. |    }---. |
           |     |       |      |     |         |   | |    |   | |
0V >-------^-----^-------^------^-----^-- - - --^---|-|----^---|-|--> 0V
         100nF 100uF          100nF 100uF     100nF | |  100nF | |
                                                    | |        | |
                                                   IC #1      IC #2
Whether one should add a 100uF across the right-side rails is a matter for debate or preference, may depend on how far away the power supply is from the main circuit. In most cases adding an additional 100uF on the right won't do any harm, may help, so might be fitted.
 
Last edited:

rq3

Senior Member
It's important to note the series diode on the regulator input of these schematics. When using a large (greater than 10uF) output capacitor on most small linear regulators (7805 and the like), if you short the regulator input, the large cap will discharge in reverse through the regulator, usually destroying it.

The diode can also be placed directly across the regulator input and output in reverse bias, thus eliminating the diode drop while still affording protection for the regulator from an input short.
 

kfjl

Member
The answer to your original question is: it's up to you.
To counterbalance all the sensible things that have already been said, a bit of heresy: I don't use decoupling capacitors at all and I don't tie unused pins to ground or +5V (whichever it is).
If you're breadboarding, why not try with and without the capacitor and keep it in the circuit if it makes a difference? My guess is it won't.
My power supply can be anything from a phone charger to 3 AA batteries or a power bank or , more often than not, my computer's USB port. My USB cable is an ordinary external drive cable with an FTDI board attached. It has a jumper to swap between 3.3V and 5V which avoids having to use a voltage adapter when connecting to 3.3V tolerant stuff.
 

Ed Straker

Active member
That's kind of what I figured, was looking for conformation of my thinking is that "it can't hurt". Most of the electronics I do / have done were strictly the analog variety and in most cases continue to be. I plan on being able to power the programing board from a bench supply which also has a 5v USB power port on it as well. There are some things an MCU can do better. But for whatever reason I am having difficulty learning the language. Not so much in the what, but the why and how relationship to certain commands and variables.

Even breadboarding certain circuits in the past have produced different behavior between the Breadboard version vs final PCB. I chalked it up to possible internal breadboard impedance causing weirdness with CMOS components.

My power supply can be anything from a phone charger to 3 AA batteries or a power bank or , more often than not, my computer's USB port
That was first thing that came to me when I saw the USB download circuit in the manual was "why use a 3.5mm stereo plug and jack when the USB cable has access to 5v right there". 🤷‍♂️

Thanks to all for the response.
 

hippy

Technical Support
Staff member
My power supply can be anything from a phone charger to 3 AA batteries or a power bank or , more often than not, my computer's USB port
That was first thing that came to me when I saw the USB download circuit in the manual was "why use a 3.5mm stereo plug and jack when the USB cable has access to 5v right there". 🤷‍♂️
The PICAXE system was designed in the days before USB when everything was RS232 serial and PC's did not supply power for circuits and add-ons. The main way of getting power out of a PC back then was to use a plug-in pass-through adapter for the keyboard DIN connector which could extract 5V from that. But its capabilities were rarely well defined.

Initially the PICAXE used a 3-way Molex connector for programming and we sold a 9-way serial to Molex plug cable (AXE025+CON038). That evolved into using a stereo jack and 9-way to jack cable (AXE026) when digital cameras emerged and cheap cables for those arrived. That also explains why the jack is wired as it is, not how audio jacks would be - we needed the jack to match the cable wiring for such cameras.

The PICAXE system has stayed with using a three-pole jack to maintain compatibility with boards and projects from that era when USB came along. First as an extension for USB-to-9-way serial converters (USB010+AXE026) then as the dedicated all-in-one AXE027 cable.

Using USB to power projects is something which is possible but does have issues. Some USB sockets on some PC's supplied straight from the PSU, some fused, some not. This meant a wiring fault on a circuit board could potentially destroy a very expensive PC, even be a fire hazard. Some schools and other educational establishments won't allow connection to USB for that reason, sometimes won't even allow the use of mains power supplies, require the use of battery packs, only allow standard chemical batteries, not rechargeables.

USB battery packs are an option these days but many will turn off after a short while if the PICAXE circuit isn't drawing enough current, and can also be less than ideal if allowing high current when there is a wiring fault on the board.

We could make a USB PICAXE board, put the AXE027 interface on the board along with a PSU which ensures powering via USB as safe as it can be but that would push up the price of such boards, and they wouldn't be bought or used by those who don't allow USB connections, and many will see it as an additional cost not worth paying.

There has never really been a business case for doing that so we have stuck with the, now well established, tried and tested, jack socket for download, leaving the end-user to decide how they will power the boards.
 

Goeytex

Senior Member
These breadboard Power Supplies are very nice and produce clean outputs of both 3.3V and 5V.

However the on/off switches tend to have a high failure rate ( from my personal experience). The latching mechanism fails , where the switch will not stay in the on position . Sometimes cleaning the switch with iso or electronics component cleaner will resolve this. Sometimes not.

Another issue that I have had is poor connections in the socket center pin to the external plug. Some plugs SEEM to fit ok, but there can be a center pin diameter mismatch that causes intermittent connection. So make sure that the plug you use matches the diameter of the center pin on the breadboard supply socket.

Another thing to be aware of. These fit very nicely on the cheap $5 breadboards that will barely hold a component in place. But if you are using a Jameco Value Pro you will need to bend the pins a bit to get it to plug in ( this is a Jameco issue). In either case I usually either use double sided tape or a bit of hot glue to hold the power supply in place as they can rock out of the breadboard ( especially on really cheap breadboards with weak grip)

But even with these issues I highly recommend these for bread boarding. I have about 5 of these in use now for various development boards.

On another note: I know of no modern PC ( Made since 2000? ) where the USB 5V is unfused/unprotected or comes directly from the Power Supply. USB 5V is generally safe, is highly protected, and is used to supply dev boards by most all other microcontroller manufacturers without issue. If you are still ( unnecessarily) worried about damaging your PC or Laptop by using USB 5V to power a dev board, then just get an external powered USB Hub an use that instead.
 
Last edited:

Ed Straker

Active member
Thanks for the tops. I'm not worried about faulty switches these days, seems to be common on the cheat stuff. Should be easy enough to replace with a quality latching keyswitch if it goes south.
 
Top