08M2 without download socket not working

jensmith25

Senior Member
I needed a very small PCB for a commercial project.

I have started designing my own PCB's and have a few successful ones incl the download socket but this one without it isn't working. I have included the decoupling capacitor and the minimum pulldown resistor on the serial in pin (33K).

I've attached the schematic. View attachment Schematic.pdf

I've tried searching the manuals and also the forum and tried a simple program with the "disconnect" command but I'm still getting nothing. I've checked and there doesn't seem to be any shorts and power is going through there's just nothing happening with the LEDs.

Any ideas? Have I made a fundamental error?
 

grim_reaper

Senior Member
Why are you using 33K? The standard programming interface circuit uses a 10K pull-down, not a 33K?

I've never tried it with just a 10K (or any other value to be honest) I just included the recommended 10K pull-down and the in-line 22K protection resistor.

Can't hurt to try it with a 10K!
 

jensmith25

Senior Member
I read on the forum a couple of posts, one suggesting a 33K resistor (adding the two together I think) and another saying anything between 10k and 47k should be fine. I wasn't sure if it could "just" be the resistor or if something else was wrong.
 

lbenson

Senior Member
Can you check that the circuit works on a breadboard, and then plug the working picaxe into your socket? In addition to the .1uF decoupling capacitor, a bulk capacitor of at least 10uF is commonly added. There is so little cost in the way of board space and component cost to adding a 3-pin programming header that I do it for every PCB. It makes debugging easier.

The 33k resistor is not likely to be a problem.
 

jensmith25

Senior Member
I'll try that tomorrow. The problem is that there's no info on using the capacitors in the Picaxe manuals and only the standard one is used in the usual circuits. Why is an additional one required if you don't have the download circuit compared to the standard 08m2 Picaxe boards which do have the socket but only one capacitor?
 

hippy

Technical Support
Staff member
Have I made a fundamental error?
There doesn't seem to be anything fundamentally wrong with the circuit design.

What will be / is connected to H1 through H4 ?

If you can describe what it is doing and what it should be doing that may give some indication of what the issue may be.
 

jensmith25

Senior Member
There doesn't seem to be anything fundamentally wrong with the circuit design.

What will be / is connected to H1 through H4 ?

If you can describe what it is doing and what it should be doing that may give some indication of what the issue may be.
H1-H4 are simply 2 header connections for LEDs. H1-H3 have 2 LEDs on each pin. H4 has 1 LED.

It's simply an LED output PCB to make flashing, flickering and glowing effects.

At present if I insert the test LED into the spare power header it lights up, but when I insert it into any of the outputs nothing happens so power is going through the PCB okay but something is stopping the H1-H4 sockets working.

I've made variations of this using the tiny 08m2 surface mount module and the darlington driver with LED headers on a bit of stripboard and this was a means to make it all look neat and professional. I know the program and the fundamentals work but something in the PCB isn't right so it's either something in the circuit I've missed or there's a fault in the PCB but the connections seemed to check out with my multi-meter.

I could try soldering up another board to see if it's just that PCB if nothing else looks wrong?
 

rq3

Senior Member
I needed a very small PCB for a commercial project.

I have started designing my own PCB's and have a few successful ones incl the download socket but this one without it isn't working. I have included the decoupling capacitor and the minimum pulldown resistor on the serial in pin (33K).

I've attached the schematic. View attachment 21380

I've tried searching the manuals and also the forum and tried a simple program with the "disconnect" command but I'm still getting nothing. I've checked and there doesn't seem to be any shorts and power is going through there's just nothing happening with the LEDs.

Any ideas? Have I made a fundamental error?
LED's? I don't see any on the schematic. Also, I am assuming that the 08M2 is pre-programmed before it is soldered the right way around onto the board, since there is no way to program it ON the board. Also, you mention using the "disconnect" command, which will keep the Picaxe from accepting any further downloads unless you do a hard reset.
 

jensmith25

Senior Member
LED's? I don't see any on the schematic. Also, I am assuming that the 08M2 is pre-programmed before it is soldered the right way around onto the board, since there is no way to program it ON the board. Also, you mention using the "disconnect" command, which will keep the Picaxe from accepting any further downloads unless you do a hard reset.
The LEDs are inserted into header sockets as I need to be able to disconnect them, so no, they're not in the schematic.

The 08m2 is being programmed on a separate PCB and transferred into an 8pin DIP socket. I don't need to download to the chip once it's programmed. Using the disconnect command was mearly a test to see if that worked once my usual program didn't, having read about using the command on the forum if no download socket is present.

I also tried a very simple "high" "low" programme but nothing is happening at the H1-H4 outputs.
 

stevesmythe

Senior Member
It looks like you are connecting the LEDs between the Darlington output and 0v. I thought the load should be connected between the Darlington output and V+?
 

Circuit

Senior Member
It looks like you are connecting the LEDs between the Darlington output and 0v. I thought the load should be connected between the Darlington output and V+?
Yes, that is my reading as well. The ULN2803 outputs are NPN Darlingtons; they switch to ground, not to +ve. Therefore you are effectively connecting both leads of your LEDs to ground.
 

westaust55

Moderator
Correct, the 2-way headers for the LEDs need +V connected to terminal 2.
Unless the LEDs are of the "resistive" type (with inbuilt resistor) you will also need a series resistor, say 1 kOhm, to control/limit the current through the LEDs.
 

lbenson

Senior Member
Why is an additional one [capacitor] required
If the capacitor you have on your pcb is the .1uF decoupling capacitor (which is used to prevent spikes generated by the picaxe or other parts of the circuit from disrupting the picaxe), then the other capacitor is the "bulk" capacitor of 10uF or more as needed. It is intended to provide reserve capacity in case the circuit briefly draws enough current to lower the voltage to the point where the picaxe ceases to work properly.

In many small circuits, this is not needed, but in circuits like yours in particular, where the (unknown to us) LEDs connected to the ULN2008A could significantly draw down the 5V line, this capacitor or a larger one might be called for.
 

SteveDee

Senior Member
...I have started designing my own PCB's...
If you are going to the trouble of making your own PCBs for what looks like a general purpose board, I'd try to make use of the 3 unused ULN200x darlingtons.

For example you could create a serial port for use with simple computers like the Pi. Here is an example in this post: https://captainbodgit.blogspot.co.uk/2016/01/robobuggy-and-me.html

As the ULN200x series has open collector outputs, they should not interfere with other inputs if they are "high" (not conducting) in the default state. But for pin 2 (serial in) you would probably need the driver output "low" so pull the input of this driver high with a pull-up resistor.
 

jensmith25

Senior Member
Correct, the 2-way headers for the LEDs need +V connected to terminal 2.
Unless the LEDs are of the "resistive" type (with inbuilt resistor) you will also need a series resistor, say 1 kOhm, to control/limit the current through the LEDs.
The resistors are on the LED leads. Since there are 2 LEDs on each output and they're wired in parallel they go on the wire.
 

jensmith25

Senior Member
If the capacitor you have on your pcb is the .1uF decoupling capacitor (which is used to prevent spikes generated by the picaxe or other parts of the circuit from disrupting the picaxe), then the other capacitor is the "bulk" capacitor of 10uF or more as needed. It is intended to provide reserve capacity in case the circuit briefly draws enough current to lower the voltage to the point where the picaxe ceases to work properly.

In many small circuits, this is not needed, but in circuits like yours in particular, where the (unknown to us) LEDs connected to the ULN2008A could significantly draw down the 5V line, this capacitor or a larger one might be called for.
Okay, understood, but if this is the case, why is it not included on all the standard 08m2 / 14m2 etc Picaxe project boards? LEDs are the most likely outputs for typical simple programs.

It needs to be as small as possible hence not wanting to add components that might not be necessary.

The LEDs will draw 10-15mA each so possible 70-90mA total current at 4.5v.
 

jensmith25

Senior Member
If you are going to the trouble of making your own PCBs for what looks like a general purpose board, I'd try to make use of the 3 unused ULN200x darlingtons.

For example you could create a serial port for use with simple computers like the Pi. Here is an example in this post: https://captainbodgit.blogspot.co.uk/2016/01/robobuggy-and-me.html

As the ULN200x series has open collector outputs, they should not interfere with other inputs if they are "high" (not conducting) in the default state. But for pin 2 (serial in) you would probably need the driver output "low" so pull the input of this driver high with a pull-up resistor.
This isn't a general purpose board, even though it looks like it. I need it to be very small hence emitting the download socket in the first place. If I don't need to connect the other pins of the darlington driver then I don't have room to add more connections and resistors.
 

hippy

Technical Support
Staff member
lbenson said:
the other capacitor is the "bulk" capacitor of 10uF or more as needed.
Okay, understood, but if this is the case, why is it not included on all the standard 08m2 / 14m2 etc Picaxe project boards? LEDs are the most likely outputs for typical simple programs.
Whether a reservoir capacitor is needed depends on what a board is driving and how it is powered. A reservoir capacitor is included on the CHI030 and CHI035 boards because they can be expected to have higher current draws but is not included on others when it is more likely to be an unnecessary component than a required one.

LED's which are driven directly from a PICAXE output pins via resistors will likely be lower current, where loads switched through Darlington Drivers may be a lot higher.
 

jensmith25

Senior Member
Whether a reservoir capacitor is needed depends on what a board is driving and how it is powered. A reservoir capacitor is included on the CHI030 and CHI035 boards because they can be expected to have higher current draws but is not included on others when it is more likely to be an unnecessary component than a required one.

LED's which are driven directly from a PICAXE output pins via resistors will likely be lower current, where loads switched through Darlington Drivers may be a lot higher.
Okay. The 14m2 / 20m2 drive outputs through the darlington driver.

So if I do need one how do you work out what size it needs to be?
 
Last edited:

hippy

Technical Support
Staff member
So if I do need one how do you work out what size it needs to be?
It needs someone more experienced and qualified than me to answer that, but a good starting point is knowing how much current will be drawn per output.
 

westaust55

Moderator
Calculate capacitor uF

So if I do need one how do you work out what size it needs to be?
The following is based on the supply voltage being completely lost.

In terms of a capacitor uF rating:
to support the LED lighting with a constant current of I amps
for duration of t seconds,
knowing the initial voltage and the final permissible/dropout voltage (when the LED will be extinguished or other electronics stops) can be calculated with:
C = t * I / (VINIT – VDROPOUT)
From my past experience that works well enough.

By way of an example:
Say we want a current of 10 mA (0.010 A) for 3 seconds, with an initial voltage of 12 volts and a final voltage of 7.6 volts,
then the capacitor required can be calculated as:
C = 3 x 0.010 / ( 12 – 7.6) = 0.00682 Farad = 6,820 µF.

When the current is not constant there is a slightly more complex formula.
 

AllyCat

Senior Member
Hi,

Quite a fast-moving thread so I stayed out until now, but here is my "advice".

Firstly, yes 33k is a "good" value for the serial input pull-down resistor. It's basically the same as 22k + 10k which is the pull-down provided by the "standard" programming circuit when nothing is actually plugged in. If I'm developing a "custom" circuit, I usually try to get the most "bang (not literally) for my buck", which may avoid the need to design one for another purpose later. Maybe I carry it to an extreme, but:

Personally, I would always include a "Programming Interface", not necessarily the jack socket, but just a 3-pin header (or even just the pads), rather like the "Legacy" programming socket still documented in the original Manual 1. Consider it as a "Test/Debugging Interface", if you really believe (IMHO wrongly) that you will never want to program the chip again. It will also make available a spare "ground" connection (which you no longer have on the LED headers) and the ability to connect an input switch or data, to be read by the Programming input (the only time when a DISCONNECT is required)

It's not even strictly necessary to fit both programming resistors: With a 33k pull-down (or preferably higher) on the pin, you can use an external current-limiting resistor (10k - 22k) if you decide that you do want to program/debug the chip in situ. Then, you could make a tiny "programming adapter" on stripboard that carries just a standard 3.5mm jack socket, a series resistor and a "Molex" (header type) plug.

The pull-down on Leg 4 is not absolutely necessary, particularly if no external connection is being made to the pin, but we can be a little more clever: The "unused" inputs of the Darlington chip actually have pull-down resistors of about 12k to ground. So just connect one of those inputs to Leg 4 to act as a pull-down (personally I'd add a pin/pad as well just in case I wanted an extra input later). There's also the possibility that you can enable/disable the PICaxe's internal "Weak pullup Resistor" on the "Input Only" pin (and even the programming input) to turn on the Darlington transistor, as if it were another output (or two) !

If you don't want to add pins for those "unused" Darlington Outputs, they could be connected to an adjacent output as a "Wired Or" gate. That gives the possibility of "modulating" two outputs, probably one PWM, to dim and flash the LED, or particularly to make interesting sounds.

As for the decoupling/bulk capacitor; one of the main considerations is the parasitic (unwanted) inductance between the power supply and the PICaxe. The effects are worse if the cables are longer, or the current and/or the frequency are higher, so all need to be considered. One of the problems is that the "old" PICaxes (e.g. M or M1) were slower than the M2/X2 chips, so the Original Manuals and "Legacy" boards may not include the capacitors that are now recommended or even essential. In practice, I usually just choose the most convenient "can" size, which will often have an "unnecessarily" high voltage rating, but that does no harm. However, choose the voltage rating immediately above your (maximum) supply voltage, if you think a higher bulk capacitance may be needed.

Cheers, Alan.
 
Last edited:

jensmith25

Senior Member
The following is based on the supply voltage being completely lost.

In terms of a capacitor uF rating:
to support the LED lighting with a constant current of I amps
for duration of t seconds,
knowing the initial voltage and the final permissible/dropout voltage (when the LED will be extinguished or other electronics stops) can be calculated with:
C = t * I / (VINIT – VDROPOUT)
From my past experience that works well enough.

By way of an example:
Say we want a current of 10 mA (0.010 A) for 3 seconds, with an initial voltage of 12 volts and a final voltage of 7.6 volts,
then the capacitor required can be calculated as:
C = 3 x 0.010 / ( 12 – 7.6) = 0.00682 Farad = 6,820 µF.

When the current is not constant there is a slightly more complex formula.
Is it just the current per individual LED ie 10mA or the total current of all LEDs? (there are 6 LEDs)

Is seconds just a random choice or is 3 seconds standard?

The circuit is powered by 4.5v only. I'm sorry, I don't understand what the drop out voltage is. How do you work it out? Is it the vf of the LEDs combined or individually or what?
 

jensmith25

Senior Member
Thanks Alan, that helps a lot.

There shouldn't be any need to re-program the chip on the PCB. I'll test it on another PCB and once the program is downloaded it'll run as is until it conks. I sell what I make so no-one else is programming it. If I can put pin 4 through the darlington I could put a header in that spot rather than the 10K resistor but in reality thats where this other capacitor needs to go and it'll be bigger.
 

grim_reaper

Senior Member
I've always has an interest in 'miniaturising' boards - any chance of a photo of what you've got so far? Maybe we could suggest ways to get that capacitor added without taking up any more space?
 

westaust55

Moderator
Is it just the current per individual LED ie 10mA or the total current of all LEDs? (there are 6 LEDs)

Is seconds just a random choice or is 3 seconds standard?

The circuit is powered by 4.5v only. I'm sorry, I don't understand what the drop out voltage is. How do you work it out? Is it the vf of the LEDs combined or individually or what?
The current (Amps) is the total of you entire load.
The time duration (seconds) is the duration you need to keep the circuit active.
Where you are only protecting against a voltage dip caused by a change in load such as for example starting a toy motor that might be less than 0.5 seconds.
The drop out voltage would be the lower of the PICAXE min volts or the volt needed to keep the LEDs illuminated.
Let's say for the PICAXE Vdropout is 3 volts.
Then for a red LED the forward voltage is 2.1 volts (typical) and another 1.2 volts for the ULN2803 Darlington channels.
Now we need to know the series resistor value and what is the lowest LED current state you want.
For example 470 ohms and 5 mA so the. Opt drop across the resistor is 470 x 0.005 = 2.35 volts.

So the minimum supply voltage is 2.1 + 1.2 + 2.35 = 5.65 volts.

Have put this reply together on my iPhone as an example.
but it is starting to suggest you need a fairly low series resistor or you will not get much current through the LEDs on a 4.5 V or they may not illuminate.

May be worth advising us what the LED Vf voltage is and what series resistor value is being used.
 

premelec

Senior Member
@jensmith25 As has indirectly been alluded to the ULNxxxx may be inappropriate for your use - ordinarily it would be used for switching a higher voltage... Have you had success with identical circuitry and voltages on other units? [some LEDs e.g. white require higher voltage than westaust55's analysis].
 

grim_reaper

Senior Member
May be worth advising us what the LED Vf voltage is and what series resistor value is being used.
You mean a full and complete circuit diagram? They're getting rare these days!

Jen - your PCB seems to have plenty of space at the top left for a standard radial capacitor. I was asking for a photo so we could see how you've connected the components to the board, the space you need to leave around the board, the size of the space it needs to fit into, etc. I'm an engineer, so maybe I'm too used to seeing pages upon pages of drawings... but something non-theoretical would be nice!
If you have vertical space (and I'm guessing you do, since your PICAXE is in a DIL holder and therefore at least 5(6?)mm high - maybe you could mount the resistors vertically instead of horizontally, etc.? There are a dozen little tricks like that to save space where you need to. Then of course the whole SMD enterprise...
 

jensmith25

Senior Member
You mean a full and complete circuit diagram? They're getting rare these days!

Jen - your PCB seems to have plenty of space at the top left for a standard radial capacitor. I was asking for a photo so we could see how you've connected the components to the board, the space you need to leave around the board, the size of the space it needs to fit into, etc. I'm an engineer, so maybe I'm too used to seeing pages upon pages of drawings... but something non-theoretical would be nice!
If you have vertical space (and I'm guessing you do, since your PICAXE is in a DIL holder and therefore at least 5(6?)mm high - maybe you could mount the resistors vertically instead of horizontally, etc.? There are a dozen little tricks like that to save space where you need to. Then of course the whole SMD enterprise...
It's not theoretical. That's the PCB that's been produced! It was just easier to upload that than take a photo, reduce the file size etc etc.
 

AllyCat

Senior Member
Hi,

Well, connecting Leg 4 and Leg 2 directly to two unused inputs of the ULN would be really easy. Only thing to remember is that the PICaxe may keep Resetting if the ULN is not fitted, but I doubt you'd notice if there's no debugging interface and no LED drivers. ;)

Then there should be plenty of room for the capacitor, where the 33k was, 7mm high radials are common, but there could be room for an 11mm laid flat, or an axial (not so common these days).

Personally I'd put pads for a "Legacy" programming/debug header in the place of the 10k. It might need a slightly modified interface with 12k pulldown (inside the ULN), but IMHO well worth it for the debugging capability. Or maybe solder the chips directly into the PCB for an even lower profile?

Cheers, Alan.
 

jensmith25

Senior Member
@jensmith25 As has indirectly been alluded to the ULNxxxx may be inappropriate for your use - ordinarily it would be used for switching a higher voltage... Have you had success with identical circuitry and voltages on other units? [some LEDs e.g. white require higher voltage than westaust55's analysis].
Yes, I've used a similar circuit plenty of times to run LEDs. That doesn't appear to be a problem. It's nice and small compared to using several MOSFETs and simple to route.

It's just standard LEDs, typical Vf 1.8-3.1 Resistors used are 100ohm for white/blue and 180ohm for red/amber. It all works fine.
 

premelec

Senior Member
@jensmith25 - OK it seems we are going around this in circles - specifically what isn't working with this board? What are the symptoms... no lights? Dim Lights? No program function? Looks like you are good on the resistors etc... is there an enable somewhere that isn't... ;-0
Usually it all comes clear at some point and I hope that is soon for you...
 

jensmith25

Senior Member
@jensmith25 - OK it seems we are going around this in circles - specifically what isn't working with this board? What are the symptoms... no lights? Dim Lights? No program function? Looks like you are good on the resistors etc... is there an enable somewhere that isn't... ;-0
Usually it all comes clear at some point and I hope that is soon for you...
I believe that has been resolved. I have put the outputs to 0V rather than +V from the darlington driver and that's why it's not working.
 

premelec

Senior Member
Great - I thought that was just a schematic error you had corrected.... a common mistake with ULN drivers... not too hard to correct on a circuit board with scratch through and soldered jumper wire to V+... I've done it too many times ;-0
 

westaust55

Moderator
I believe that has been resolved. I have put the outputs to 0V rather than +V from the darlington driver and that's why it's not working.
I suggest that you do a trial on a breadboard before sorting out a new PCB.
Check that with the 4.5 volt supply, through the ULN2803 and with the intended resistor in series with each LED that the LEDs are working and as bright as you want.
 

jensmith25

Senior Member
I suggest that you do a trial on a breadboard before sorting out a new PCB.
Check that with the 4.5 volt supply, through the ULN2803 and with the intended resistor in series with each LED that the LEDs are working and as bright as you want.
As I've said previously, I've already done this many times with other circuits and the LEDs work fine. They are certainly bright enough with no noticeable dimming from normal.
This was to make what was previously a bit of a jury rigged circuit into something smaller and only requiring one PCB to do what I required.
 
Top