18M2+ download - hardware error - resistance values

amdunn

New Member
Very odd quirk and a new one for me.

Wired up a brand new 18M2+ with the precise download hardware I've always used... Prolific USB to serial converter, and standard serial download circuit -- GND, RxD from pin 2, TxD to the two resistors... 10K to ground, 22K to pin 3.

Neither LinAxePad or the command line Linux compiler would recognize the hardware.

I knew the receive (serial OUT) side was good, because I got the scrolling "Hello" message on the terminal.

So clearly a problem on the transmit (serial IN) side.

Put an LED and dropping resistor on pin 3, and could clearly see the signal attempt show up when initiating a download... but still, hardware not found.

So on a hunch, I reduced the current limiting resister from 22K to 10K and behold, it worked like a charm. I know everybody swears by the 10K/22K combination across the board, and it has worked for me before, but this change is what enabled the download to work in this case.

Reproduced the exact behavior with another brand new 18M2+ as well.

Anyone else ever experience this?
 

westaust55

Moderator
Certainly not come across such a situation.
In the absence of a photo to consider,
1. Have you measured the actual value of the 22 kOhm resistor – is it definitely 22 kOhm ?
2. Have you measured the value of the 10 kOhm resistor - is it definitely 10 kOhm ?
3. Does the original 22/10 kOhm resistor pair where you had grief still work with an older 18M2+ part?
4. 4. You definitely got the two resistors around the right way (ie you do not accidentally have the 10 Kohm from pin 3 to ground). Your description above is correct.
 

BeanieBots

Moderator
Please check and double check all the points that Westy has made.
The 10k/22k REALLY IS the correct combination and it WILL work if it is correctly built.
The most common error is that people have created a potential divider with the two resistors.
 

amdunn

New Member
Please check and double check all the points that Westy has made.
The 10k/22k REALLY IS the correct combination and it WILL work if it is correctly built.
The most common error is that people have created a potential divider with the two resistors.
Have double and triple checked it, that's what's bothering me!

The 22K resistor measures 22194 ohms per my multimeter. The 10K is 9987 ohms.

The circuit is wired correctly. The 10K to ground is on the RS-232 side of the 22K, not the PICAXE side.

I have not used 18M2+ before so there is no answer to that question. But I have used the exact same circuit and same connection to the PC with 28X, 08M, 14M2, for years, with no issues. It has always worked... except in this case.
 

BeanieBots

Moderator
This is long shot but it might to do with how you have wired the power to the 18M2+ (or the power supply).
It is possible to power a PICAXE parasitically if a signal is applied to an input pin with nothing on the power pin.
Current from the signal goes to the power rail via the internal protection diodes. I've had a circuit run for years with such an error without ever knowing that the supply pin was actually floating!
I'm sure you have, but make sure you have removed the LED. That would definitely cause it to fail if it's on the PICAXE side of the 22k.
Measure the voltage on the chip itself. Maybe one of the pins has folded under and is not actually in the socket.
If this was my circuit, I would not be happy until it downloaded OK with the traditional circuit because it means something somewhere is wrong.
The 22k value is not critical but it should be fine even if you INCREASE it to say 47k.
Are these download components right up close to the PICAXE?
If they are at the other end of a long wire then that might account for what you are experiencing.
 

amdunn

New Member
Ruled all those out as well. PICAXE definitely powered correctly because the program runs if I remove the serial cable entirely... so it must be powered from the 5V bench supply!

The LED was only on for test, to see if I could see any serial input reaching the PICAXE (and it did show that, as I could see it light up when attempting the download). I was just ruling out a cable problem of SerTXD not reaching the Serial IN ... once that was confirmed, I removed the LED.

Relatively close wiring... USB/Serial plugged into laptop, then about 1 foot of wire from the DB9 connector to the leads connected to the resistors.
 

hippy

Technical Support
Staff member
Have you checked what the voltage is on the jack and the Download Serial In pin, and also on the PICAXE supply ?

Serial voltages closer to the supply ( eg 0V/5V ) rather than RS232 (-10V/+10V) should however still work as that's what the AXE027 will put out.

The 18M2 shouldn't, I'd have thought, require any greater current into the pin than any other M2 but perhaps it does vary from batch to batch or chip to chip. I do recall there have been other cases where reducing the 22K has resolved download problems but cannot recall whether why was ever determined or explained.]

I also recall that not having suitable power rail decoupling has caused some issues in some cases with later PICAXE devices so it may be worth checking you have decoupling capacitors, or adding more.
 

BeanieBots

Moderator
...Relatively close wiring... USB/Serial plugged into laptop, then about 1 foot of wire from the DB9 connector to the leads connected to the resistors.
Aha! So it's not an AXE027 download cable?
Your USB to serial converter might be the culprit.
As hippy has suggested, check the voltages that are coming out of the DB9 connector. Some converters can be as low as 3v which would explain your symptoms.
 

amdunn

New Member
The 18M2 shouldn't, I'd have thought, require any greater current into the pin than any other M2 but perhaps it does vary from batch to batch or chip to chip. I do recall there have been other cases where reducing the 22K has resolved download problems but cannot recall whether why was ever determined or explained.
Interesting. So there is precedent for having to reduce the 22K resistor... wonder if it is something to do with the 18M2 part...


Aha! So it's not an AXE027 download cable?
No, I've never used an AXE027 ... I have been using the same serial cable setup since long before anything had USB ports on it :)
When laptops lost their serial ports, I just added a standard Prolific chipset based USB to serial for those machines without a serial port, with the same serial cable as before.

That's what is puzzling... it is the same setup as before... have used it for years with all sorts of PICAXE chips... and only in this case had the issue of needing to reduce the resistor value.

So the voltage provided to every generation of chip has been the same, and only this one seems to care enough that I need to change the resistor.

Is there a safe minimum value for the resistor? I understand its purpose is current limiting to the Serial IN pin... my math tells me it would limit to sub-milliamp levels at 22K at max 15V per RS-232 standard... even less at 5V TTL levels.
 

BeanieBots

Moderator
Is there a safe minimum value for the resistor?
The 22k came about on the assumption that the RS232 was at +/- 12v.
(PIC datasheet suggesting no more than 0.6mA into internal protection diode)
With AXE027 no resistor is required.
The safest value for your application would depend on what voltage comes out of your serial converter.
If it's direct to the prolific chip, then it's likely to be either 5v or 3.3v.
With PICAXE powered from 5v, then again no resistor required.

I use the AXE027 but always use 330R on both lines just in case.....
 

Technical

Technical Support
Staff member
Our money is still on a hardware / power supply issue somewhere. As BB states 22k was originally for real RS232 voltage, but will still work for 5V - and is in regular use with hundreds of thousands of 18M2's around the planet with all sorts of USB converter cables! If the circuit really is running at 5V there is another issue here somewhere.

We know you have already checked, but this is the exact thing we see time and time again when people have the 10k on the wrong side of the 22k. Or a broken ground connection between the bottom of the 10k and the chip.
 

amdunn

New Member
Just to be sure, checked again... the 10K really is on the RS-232 side of the 22K, not the PICAXE side... so no "voltage divider".

Just for fun last night... rebuilt the project -- simplified as much as possible -- now on a solderless breadboard, consisting of +5, GND, 18M2+ chip, 22K resistor, 10K resistor, one LED from pin 18 (output C.1) to GND via a 1K resistor, and the three wire connection to the DB9.

That's pretty minimal... and reuses NO connections from the previous test board.

Still has precisely the same issue. With 22K resistor, fails to detect the chip. With 10K resistor, it works. Same result with two 18M2+ chips.

Verified power supply +5.03V across the +V and -V pins directly on the chip. Verified that power supply is still there if I disconnect the SerTXD lead coming from the DB9. So no source of other power, no phantom paths, nothing.

Replaced the 18M2+ with an 08M and... guess what... it detects just fine with the 22K.

Have not checked the voltage out of the USB to serial, but maybe that's the issue. Perhaps it is just low enough to drop the current below the threshold the 18M2+ will read. Will check tonight.
 

hippy

Technical Support
Staff member
It might be worth adding decoupling caps and, as it's now on breadboard, adding a diode in series with the serial into the chip to see if that improves things, pointy-end towards PICAXE ....

Code:
               ___
)---|>|---.---|___|---> SI
         .|.   22K
         | |
         |_| 10K
          |
)---------^-----------
 

amdunn

New Member
It might be worth adding decoupling caps and, as it's now on breadboard, adding a diode in series with the serial into the chip to see if that improves things, pointy-end towards PICAXE ....

Code:
               ___
)---|>|---.---|___|---> SI
         .|.   22K
         | |
         |_| 10K
          |
)---------^-----------
Your text says "diode in series with the serial into the chip" (so between the 22K and the PICAXE) but your diagram has the diode on the other side of the two resistors (ie. towards the PC SerTxD). Which is the correct way to implement this?
 

Goeytex

Senior Member
Have not checked the voltage out of the USB to serial, but maybe that's the issue. Perhaps it is just low enough to drop the current below the threshold the 18M2+ will read. Will check tonight.
This is one of the first things to check with download issues, especially when using a Prolific or any other non Picaxe Adapter. Use a scope if possible. The voltage/signal must read from Picaxe Gnd (Pin5) to the Picaxe Serin (Pin 3). I suspect you will find the voltage to be too low, at something less than 3.0 V.

This could indicate one of several things.

1. Dodgy Adapter
2. Supply Ground, Picaxe Ground and USB Adapter Ground not correctly tied together.
3. Dodgy Connector/cable ( Ground? )
4. 22K resistor is not really 22K ( measure it ! )
5. Picaxe Ground on wrong Pin (should be Physical Pin 5)

6. Damaged Picaxe. If the Picaxe is damaged it can sometimes be verified by reading the idle current when power is applied to Pins 5 /14 and with a 10K resistor from serin to ground and nothing else connected to the Picaxe ....The current should be no more than about 2 or 3 mA. If the current is (for example 20mA) then the chip is damaged.

These kinds of problems are nearly always related to Power ... ie bad grounds or voltage levels.
 

techElder

Well-known member
Back in the early 1980s, I had a small manufacturing business with one product. The assembly of that product included a 22K resistor. Thinking I'm saving money, I bought boxes of 1000 resistors; 22K included.

Troubleshooting problems after assembly, I revealed that the 22K resistors were really mis-labled 220K resistors! Yes, every damn one of them. The distributor rep ultimately revealed to me that they had millions of them to return! The factory had just screwed up the paint on the band. A bug in the system, no doubt.

To this day I can't pass up measuring a 22K resistor. :D
 

inglewoodpete

Senior Member
Back in the early 1980s, I had a small manufacturing business with one product. The assembly of that product included a 22K resistor. Thinking I'm saving money, I bought boxes of 1000 resistors; 22K included.

Troubleshooting problems after assembly, I revealed that the 22K resistors were really mis-labled 220K resistors! Yes, every damn one of them. The distributor rep ultimately revealed to me that they had millions of them to return! The factory had just screwed up the paint on the band. A bug in the system, no doubt.

To this day I can't pass up measuring a 22K resistor. :D
Hmm. Maybe they were not destroyed and have now resurfaced in the market again? Only joking :). Let's hear from Andy.
 

johnlong

Senior Member
The 22k came about on the assumption that the RS232 was at +/- 12v.
(PIC datasheet suggesting no more than 0.6mA into internal protection diode)
With AXE027 no resistor is required.
The safest value for your application would depend on what voltage comes out of your serial converter.
If it's direct to the prolific chip, then it's likely to be either 5v or 3.3v.
With PICAXE powered from 5v, then again no resistor required.

I use the AXE027 but always use 330R on both lines just in case.....
Hi BeanieBots am I reading your post corretly if you are using the AXE027 cable you do not need to have the 10 and 22k resistors in the down load circuit just connect the 3.5mm stereo socket directly to the respective chip pins.
 

BeanieBots

Moderator
No, you still need the 10k pulldown or serin will float when you disconnect the cable leading to erratic behaviour.
The point I was making is that the AXE027 puts out 5v logic levels, so a PICAXE running on 5v would not require the 22k current limiting resistor.
I would always recommend fitting a resistor anyway, just in case..... (eg plugging in the cable and starting a download when the PICAXE is not powered).
 
Top