Wierd 20X2 behavior

mikkelbg

New Member
Hi,

I'm having some trouble with the picaxe 20X2. Under certain conditions when setting B.2 and B.3 high the chip resets. See following code:

Code:
init:
	low C.7, C.2, C.1, C.0
	low B.1, B.2, B.3, B.4
	pause 1000

main:
	sertxd("This is sent",10,13);
	high B.1, B.2, B.3, B.4
	sertxd("But this isn't!",10,13);
	goto main
After downloading the code this is what I recieve in the terminal:
This is sent

This is sent

This is sent

...
What am I missing?
Thanks!
Mikkel
 

MartinM57

Moderator
What am I missing?
No idea really...this is what I get..
Code:
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
But this isn't!
This is sent
 

MartinM57

Moderator
What happens if you have
Code:
init:
	low C.7, C.2, C.1, C.0
	low B.1, B.2, B.3, B.4
	pause 1000
       sertxd("I have been reset",13,10);

main:
	sertxd("This is sent",13,10);
	high B.1, B.2, B.3, B.4
	sertxd("But this isn't!",13,10);
	goto main
I've turned round the 13's and 10's so they give real line feeds in the Terminal window...
 

hippy

Ex-Staff (retired)
Also works for me.

This points to something resetting the 20X2, a hardware problem. Either a line shorted to Serial In going high or an output ( which is connected ultimately to 0V or another output pin ) going high and drawing too much current, either collapsing the power supply or causing incorrect chip operation.

Check you're not setting a pin used for input as an output then isolate which pin causes the problem then check the hardware connections to that pin.
 

Dippy

Moderator
Might be a good idea to post your circuit EXACTLY as you have it.
Including component values and precisely the power supply you are using.
If batteries, are the batteries OK?

Double-check your connections to make sure the circuit used is EXACTLY as you have designed.

Double-check your component values.

Breadboard, stripboard or PCB?

If using breadboard post a schematic (drawn circuit diagram) please and not a breadboard image.
 

hippy

Ex-Staff (retired)
One cheap 'tool' which can be useful in cases like this is a 20-pin DIL socket with all legs pulled out except for power and serial communications. Plug that socket into the board's socket, then the PICAXE into that. You can then test operation of the chip itself.

For a more sturdy, easier to use, setup, three stacked DIL sockets with the pins removed only on the middle socket, all glued together.
 

mikkelbg

New Member
Dippy: It is a PCB. I have tested all the connections - seems to be as drawn. I have uploaded a schematic here.

Hippy: I got it working on a breadboard too - so you are probaly right that its something with the circuit. When I remove all of the 4511 chips (see schematic) the code works with the 20X2 on PCB.

What should I try next?
- btw, it is an alarm clock i'm trying to make.

Thanks for your help!
Mikkel
 

lanternfish

Senior Member
A couple of fault finding tips.

Check for any solder bridges between pads and tracks.

With all the IC's removed, test each pin to OV and 5V to check for a short.

Do a track by track trace to ensure pin to pin tracks are going where they are meant to.

Cheers
 

Dippy

Moderator
I don't know specifically which version of 4511 or LED module you are using, so (with caveats)...

1. You are using standard schematic devices; make sure the power lines are correct.
2. In the 2 Data Sheets I read for MC14511B and HEF4511B it needed limiting resistors for the LED driving.... does yours? (EXactly which version of xxx4511 are you using?).

If it does need limiting resistors then that could be a problem.

A reset is typically due to a power glitch, noise or droop , or a transient or overload on a pin.

Other than that just check the PCB as described above by others.
Check differences between working breadboard and PCB with a multimeter and magnifying glass. Double-Check component values and orientation.
(Tedious work but necessary ... we all have had to do it at sometime :) )
 

Dippy

Moderator
Data Sheet link for HEF4511 not working for me , so I went to 'old reliable' Farnell.
I hope this is the same?
http://www.farnell.com/datasheets/7571.pdf

Sometimes, and I know it's horrible, you have to dig out the calculator :)


"How do you find in datasheet if limiting resistors are needed?"
- by looking and reading :)
First, look at figures 9 & 10 as the examples.
Then look at page 5 to see a max rating of 25mA.



Your LED displays are common cathode and have no limiting resistors. All segments except DP are 2 x series LEDs.
I know it says "I.C. Compatible" - very ambiguous and very typical :(

Approx calc I = (Vsupply - LEDVfdrop) / R.

The LEDVfdrop is the forward voltage drop of the LED(s).
It's in the Data Sheet you linked to. 3.6V @ 20mA for segment and 1.8V for Decimal Point (@20mA).

I can't get your original schematic, something wrong with nerdynet, but I don't think you have ANY resistors.
Obv the current won't be infinity, but it's not good.
Things may be overloading with funny effects and/or your power supply may be drooping.

ALL the info you needed is in the Data Sheet.
In addition a bit of Ohm's Law and a calculator and some button pressing.

Ask your teacher at school about Ohm's Law - he/she should be ableto give you some insight.

The above is merely a suggestion for something to investigate - along with the previous suggestions.
 
Last edited:
Top