Program doesn't work when disconnected from PC

marinosp

New Member
I download and run a program off computer and the hardware/software run OK for as long as the serial cable is connected to the board. As soon as I remove the serail cable the hardware/software don't work anymore. I am using the 22K/10K resistors with a PICAXE 18X micro.

Any help would be greatly appreciated.
 

marinosp

New Member
I am not sure what you arelooking for with your question.
I have built a number of projects with the 8-pin variants and always worked in astand alone mode.
With my latest design usin a -18X variant, the design, both the one built on a protoboard and the one on a PCB I made work fine for as long as the serial cable is left connected between the PC and hardware. I am not sure why this is the case.
I am using the 10K resistor to serial-in and the 4.7K pull up resistor on the reset pin. But to me it looks like I have some issue relating to reseting or something else?
Any comments would be greatly appreciated.

MP
 
What is going wrong ? the working of the programm or isn't anything working ?

Are you using the serial in and output as part of your project ? (communicate with other devices)

If this isn't the case, the only things i can think of right now is a problem with the reset signal or somehow the project uses power from the serial interface.

Can you give us some schematics and/or PCB layout ?
 

ylp88

Senior Member
Have you the the 22K and 10K resistors in the right place? The junction of the two resistors hould be connected to the PC, not to the PICAXE's serial input pin.

ylp88
 

marinosp

New Member
Resistor connection is nearer to the PC than the 18X chip.
All my drawings are hand drawn so give me sometime to get then in a presentable form before I can post them
Thanks for all the suggestions so far.
 

Muzza

New Member
Other that the reistors beng wired incorrectly (as already suggested), could it be that you are powering your circuit (inadvertantly) from the PCs RS232 ?
Do you get +5v at the relevant locations when the PC is unplugged ?
Otherwise, use a CRO and see if there is any noise on the +5v supply once the PC is unplugged.
 

manuka

Senior Member
"Nearer the PC " ??? Is this meaning not with the 18X PCB? This "22k/10k" resistor issue has arisen MANY times before, & the collective forum wisdom is to ALWAYS put them right beside the Picaxe!

Of course other suggestions may be on target too. Ahem -I can't resist (!) a push for breadboard/protoboards at this developmental stage of course. Us colonials seem to have minds that suit this solderless approach.

See the likes of => http://picaxe.orcon.net.nz/keyb18xa.jpg & => http://picaxe.orcon.net.nz/datads18.jpg for 18A/X layouts that have been highly versatile but faultless. Of course,that was so 2003/4,& I'm now a 08M fan, but ...

Stan



Edited by - Stan. Swan on 5/9/2005 7:13:50 AM
 

marinosp

New Member
Stan,
being a colonial myself, I assembled my design on a protoboard which worked OK (never bothered running it without the download cable connected).
Since it worked, it took me very little time to manufacture a PCB and build the circuit up. I identified the issue first time I run the project in a stand alone mode.
Both set-ups included having the resistor network very close to the uP and same applies for the decoupling capacitor.
The statement I used to describe the location of the resistor network node (ie near the Power supply) was in response to a comment by another contributor and I used his phrasaology to do so.
My circuit is reasonably simple. It is a vertically sliding chook door. As you know Australia has a very annoying pest called fox (ie not the poms). After I lost a few chooks to foxes I decided to build an automatic door for the chicken coop.
There are 3 inputs: the door open switch, the door closed switch and a signal from one of those electronic appliance timers which is conditioned to provide a 5 volt signal utilising an op-amp. The 12 volt signal from the other 2 switches is translated into 5 volt (high) and 0 volt levels (low) via transistors tied to 5 volts supply.
There are 4 outputs which drive some automotive type SPST relays via darlingtons and protected by diodes.
I established tonight that as long as the serial cable (download) is connected between the PC and the board, everything works OK. All voltages on the board are at their correct level and the same applies for the voltages at the input pins of the board.
The 10K/22K resistors are OK, the pull up resistor is OK (ie 4k7).
Since I pulled the components off the protoboard, I am thinking of rebuilding the design and fiddle around with resistor values (ie pull-down and reset) as well as the capacitors I am using in order to determine whether they have an effect on reseting.
 

BeanieBots

Moderator
Are you using any analog inputs?
If yes, readings can be affected by the download cable.
See "Enhanced download circuit" for more details.
Other than that, very high impedances (~100k) on your transistor input transistors may well be affected in similar manner to analog inputs. The other thing the PC connection does is to ground the 0v. Check that this is not a requirement of your circuit. Common 0v lines ?
 

manuka

Senior Member
OK-I'd look at pullup/down Rs now. However- did you know that a Queensland 08 "chook door" was published in the June 2003 Silicon Chip- it's been very reliable. Suggest you check article, but code is at => www.picaxe.orcon.net.nz/chookfox.bas
Stan


Edited by - Stan. Swan on 5/10/2005 2:37:19 AM
 

pramac

New Member
I have a similar problem. I have a voltage between 0 and 3.5v coming from an op-amp which goes into input1 on an 18X. The ADC value is then displayed on an LCD. When the serial download cable is connected I get a stable reading, as soon as I remove the cable the value is just all over the place. The 18X is wired up on breadboard as it should and includes the download circuit.
Any help would be greatly appreciated.

Here is my code - it uses the lcd routine from the picaxe manual.

Start: Gosub init
b1 = 1
Gosub wrins
b1 = 128
Gosub wrins
Goto Main

init: let pins = 0
let b4 = 0
pause 200
let pins = 48
pulsout 3,1
pause 10
pulsout 3,1
pulsout 3,1
let pins = 32
pulsout 3,1
pulsout 3,1
let pins = 128
pulsout 3,1
let b1 = 14
gosub wrins
return

wrchr: let pins = b1 & 240
high 2
pulsout 3,1
let b2 = b1 * 16
let pins = b2 & 240
high 2
pulsout 3,1
return

wrins: let pins = b1 & 240
pulsout 3,1
let b2 = b1 * 16
let pins = b2 & 240
pulsout 3,1
high 2
return

disp_val: b10 = b6 / 100
b13 = b6 / 10
b11 = b13 //10
b12 = b6 // 10
b1 = 192
Gosub wrins
b1 = b10 + "0"
Gosub wrchr
b1 = b11 + "0"
Gosub wrchr
b1 = b12 + "0"
Gosub wrchr
pause 500

Main: Readadc 1,b6
Goto disp_val
pause 1500
Goto Main

End

 

Technical

Technical Support
Staff member
The only real reason for this behaviour is a fault in the configuration of the circuit. Make sure the PICAXE serial 10/22k resistors are correct and that you have good common grounds between all chips, particularly between the ADC and PICAXE.

On breadboard layouts double check all connections in case of a poor joint.
 

BeanieBots

Moderator
The essence to this issue is that a PIC analog input sinks current when current is drawn from the programming input. This is caused by the -12v serial connection. In many cases it is not a problem because the current small. However, if the source impedance seen by the input is high (>10k) then the effect becomes noticeable.
In your case, you state the input is fed via an op-amp. These are normally low impedance. I would therefore guess that you are running them from a single power rail at close to 0v output. Under these circumstances, the output starts to loose drive and becomes high impedance, hence the problem observed. When the analog input draws current, the op-amp compensates by supplying current and goes low impedance again. Thus, it only works well with the serial cable connected.
If you do indeed have full dual power rails for your op-amp then you either have too large a resistor between op-amp and PICAXE or your circuit has an error somewhere.

If you are concerned that decreasing the op-amp output resistor could source excessive current into the PICAXE input, then place one between the op-amp output and the feedback network. This will decrease the node's ability to source current without increasing it's impedance whilst in normal working limits.

If none of that made any sense, either describe or send me your circuit. I only need the bit around the op-amp that feed the PICAXE input.
 
Top