18X project problems

temple

New Member
I am an amatuer needing help!

My son and I have designed a small project using an 18X. This is the first time we've used this pic, normally we've used the 08M. We have leds, buzzer, push button and LDR. The serial cable does not connect up to our project, I have been transferring the chip each time after writing the code. We have soldered up the project and written code, however the project is acting very eratically. I wrote code to test each output, to see if I can limit the problem. I still can't figure out what's wrong. The outputs work, but then others come on that shouldn't. I've checked my soldering, and it looks fine. I'm not sure if I'm missing something.

I have a reset pin pulled up to 5V using a 4K7 resistor. The serial input is pulled down to ground with a 22K resistor.

I would be glad for anyone's help

Amateur dad
 

inglewoodpete

Senior Member
You say you've used the 08M previously, and you've attended to the needs of the Serial In and Reset pins. These are the most likely cause on problems.

The next would be the other input connections. Do the inputs have pullup or pulldown resistors as well as the switch/ldr etc?

Build the software step-by-step. Try writing some test code to just flash each LED in turn. Does this behave as expected? Then add the switch input to the code etc etc. This could get a bit tedious if you have to move the 18X between circuits, but its the method I'd use.

Also, is the buzzer a piezo or electromagnetic one? EM buzzers are a sure fire way to introiduce interference.
 

temple

New Member
18X problem

Thanks, I need to check the buzzer, I thought it was a piezo, but maybe not.

I have 10K pulldowns on the inputs (LDR and pushbutton).

One other thing. Does the serout pin need to be pulled up or down? I didn't think it needed to!
 

Dippy

Moderator
"I'm not sure if I'm missing something."
- well, if the chip is OK and the power supply is OK and your code is OK then, yes, something is missing/wrong.

We can't check your soldering or that your ic socket isn't muggered or if your power supply is OK or if all your components are OK from here but you may be able to get some help if:
1. You post your code
2. You post your schematic.
3. That you can confirm that your soldered version (PCB or vero/strip board??) is exactly asyour schematic.
4. What power supply? And have you checked it right up to the PICAXE ic pins with a good multimeter?

For simple flashing things have you tried running it in the simulator?
Hopefully you can sort it before sonny-jim does, or else he will never let you forget it :)
 

Technical

Technical Support
Staff member
It sounds more likely to be a software issue than hardware. Try posting the final program here.
 

marcos.placona

Senior Member
I'll second Technical here. Just yesterday I was having some very weird problems with a fairly simple 08M circuit, to find later that the problem was with my brain :D
 

lbenson

Senior Member
>The serial input is pulled down to ground with a 22K resistor.

Is this what you meant to say? The standard download connection has Serial in pulled to ground with a 10K resistor, and then a 22K resistor inline, with 0V from the download cable tied to 0V on the picaxe circuit.
Code:
TX  to  PC  <-------------------------------| SO       |
                             ___            |          |
RX from PC  >----.----------|___|---------->| SI       |
                 |           22K            |          |
                .|.                         |          |
            10K | |                         `----------.
                |_|                            PICAXE
                 |                    
0V from PC ______|_ 0V
 

hippy

Ex-Staff (retired)
@ lbenson : If I read it right, it is a 22K straight to 0V but the PICAXE is programmed out of circuit then inserted. That should work. I'd have used 10K but wouldn't expect a problem with 22K, but maybe someone knows differently ?
 

BCJKiwi

Senior Member
Hmm...
Always assumed that a 33k resistor from SI to 0V was what was required if not programming on board.

Reasoning is that if the programming cable is removed, then the standard download circuit places 32k between SI and 0V. Have a 33k resistor on an 08M circuit recently built with chip programmed off-board and it works fine.
 

hippy

Ex-Staff (retired)
That's good logic. The R is only there to stop the input floating high, it could be a direct short to 0V but an R is better.
 

stocky

Senior Member
I've used anything from a few 4k7 to 82k - ie what even i could find at the time! Its not that fussy really :)
 

jmumby

Senior Member
This might sound a bit obviouse but the only time I have had random results from a 18x was when I had no capacitor across 0v and +ve. You say you have solderd it all up I just wonder if you have left out the cap.
 

Dippy

Moderator
That's a good comment jmumby. I must say that, in my apps, it has depended on the circuit/app whether or not a cap is needed, but I do include one or two as a matter of course these days.
I think it would be a useful inclusion in the PICAXE manuals.

Any chance of feedback, schematic and code from the questioner??
 
Top