question with a 14m2


New Member
here is my code. I have tried to do the
 thing but can't get to work

main:  do
    do : loop until pinc.1 = 0 ' loop until the pin goes low
    pinc.1 = 1 'pin b.1 goes low via push button switch 1
    toggle b.3  'energizes a led1
    pause 75 '   led is 0n for 75ms
    toggle b.3 
    gosub tr2a 
tr2a: do
do : loop until pinc.2 = 0' loop until the pin goes low
    pinc.2 = 1 ' goes low via push button switch 2 
    toggle b.5  'energizes  led2    
    pause 75    'led is on for 75 ms
    toggle b.5
    gosub main

This is just part of larger code that i am working with.   I wired the entire project on a bread board and it works perfectly.
there is no problem with the code.

Now i want to make a permanent circuit on  a prototype board.   

 here is how it is wired.   chip is powered, pin c.2 has a 1k ohm resister to 5v, 0v to the switch and the other side to pin c.2.   pinc.3 is wired similarly .   b.5 is wired to an led, b.3 is wired to a second led.   when wired to a bread board it works great. plug in the Same chip on the prototype board and it won't  work.   I have 5 v going to pin c.2 and c.3,  when i push the switch the volts drop to 0.   I do not get any reading on pins b.5 or b.3.  rework it on the bread board, it works perfect.
both are wired the same.  why


Senior Member

I think we need a bit more to go on.

Please post your full code, and some photos of your boards.

The code you posted doesn't run properly in the simulator.


To post code, select all your lines ( use cntrl-a ), then right-click and choose 'copy for forum'.
Then paste into your post.




Since you project works as desired on the breadboard but not on the final PCB that tends to rule out the programme and highlight a circuit problem with the PCB.
Please post your schematic/circuit diagram and clear photos of both sides of the Permanent PCB project.

Incorrect trace or bad/dry solder joint are likely reasons.
The typical question is also whether you have decoupling capacitors. Do you have one fitted across the PICAXE power pins?

Are you using the same power source for the breadboard and permanent PCB versions.


Technical Support
Staff member
Does you proto board have the download circuit? If not the serin pin may be, incorrectly, left unconnected?


Senior Member

it works perfectly. there is no problem with the code.
Hmm, it may appear to work and may not be the immediate cause of your problems, but it's nearly the same code that you posted in this thread. As explained there (posts #7 - #8), the RETURN will never be executed (because it follows an unconditional loop), and you're calling (i.e. GOSUB) main: as if it were a subroutine.

Cheers, Alan.