20M2 stops when programming cable disconnected

dworboys

New Member
High, just wondering if someone can shed any light on this one ...

I successfully program a 20M2 and it runs fine until I disconnect the programming cable. The 10K/22K resistors are still in circuit after the cable is removed. I'm using the standard 10K/22K resistor setup and have used this for years on all sorts of picaxe projects without any issues. I noticed that shorting the 22K resistor fixes the problem. I measured the dc voltage (using a high impedance DVM) on the serial input pin and noticed it was sitting at about 2V (22k un shorted) and less than 1V (22k shorted). Seems like the chip is pulling the serial input pin high. I think I have a dud chip but seems funny that it still works with the programming cable connected. Any similar experiences ?
 

PaulRB

Senior Member
Hi dworboys.

You will get more of a response if you give the forum more to go on, such as a picture or schematic. Are you testing on breadboard, or some other picaxe board (axe-xyz) for example? Have you tested or replaced both resistors? Is the ground side of the 10k definitely grounded? What if you remove the 20m2 and measure the voltage at that pin's socket?

Paul
 

dworboys

New Member
I did a bit more experimenting with this and the problem seems to relate to the pullup on command. My code (for use with an Xbee module) is as follows :-

init:
dirsb=%00000000
dirsc=%10111111
pullup on

b0=0
start:
b1=pinsb
if b1=b0 then goto start
toggle c.0
serout c.7,T2400,("ABC",b1)
b0=b1
toggle c.0
goto start

I replaced the pullup on with pullup %1111111111111111 and everything works OK when the programming cable is disconnected. Is there a difference between pullup on and pullup %1111111111111111 ? The manual implies not.

David
 

hippy

Ex-Staff (retired)
Turning internal pull-up on for Serial In can cause it to enter its bootstrap / download mode. A DISCONNECT command before the PULLUP should prevent that.

I don't have an answer to hand as to an explicit "PULLUP %..." and "PULLUP ON" behaving differently.
 

Technical

Technical Support
Staff member
Is there a difference between pullup on and pullup %1111111111111111 ? The manual implies not.
There shouldn't be, but there is indeed an obscure compiler bug here which we have corrected for the next compiler release, only affects the 20M2 and 'on' keyword. Sorry about that - use the bit mask instead for now as that will work as expected.
 

dmaxben

Member
Turning internal pull-up on for Serial In can cause it to enter its bootstrap / download mode. A DISCONNECT command before the PULLUP should prevent that.

I don't have an answer to hand as to an explicit "PULLUP %..." and "PULLUP ON" behaving differently.
Ahh I did not know the pullup command worked on the serial-in on the M2 chips...good to know! Although if using the pullup command on the serial-in (after first using DISCONNECT of course) ...I assume we have to first take the standard download circuit out of the equation/off the board for the pullup command to work properly?
 

dworboys

New Member
There shouldn't be, but there is indeed an obscure compiler bug here which we have corrected for the next compiler release, only affects the 20M2 and 'on' keyword. Sorry about that - use the bit mask instead for now as that will work as expected.
thanks for the swift response on this. I had tried a second chip and got the same result so was beginning to suspect a problem like this.
 
Top