Picaxe newbie

Innes

Member
Hello all,

I'm completely new to the picaxe (and microcontrollers), so please treat me gently! I have a (very) basic knowledge of electronics, and I am having some trouble fully understanding the outputs on the picaxe project board...

I have done some experimenting and have successfully lit an LED, buzzed a buzzer (also changing the sound of the buzzer using PAUSEs between HIGHs and LOWs for the buzzer pins), and I have also controlled a miniature DC motor using both 'DIY' PWM (i.e. PULSOUT) and also using the PWM command (I put an 18x on the board when testing PWM because the basic 18 doesn't support it). Hopefully that has given you an idea of what <i>does </i> work, and what I am capable of. If nothing else, it proves that the hardware works and that I can download code to the picaxe!

My problem is with driving a 7 segment LED display. I have built a circuit (on a breadboard) based on the CMOS 4026B which is shown on page 21 in the Microcontroller Interfacing Circuits manual. When I connect the 4026B circuit to the picaxe project board, it permanently displays 0 (zero). I am fairly confident that the 4026 circuit works because I have tested it when not connected to the picaxe board, like this...

1) Touch a wire on the 4026 'reset' pin and the display goes to zero.
2) Touch a wire on the 4026 'clock' pin and the numbers rapidly increment; when the wire is no longer touched, a digit is displayed. All the digits display correctly. Doing a reset as in step (1) above resets the display to zero.

I <i>think </i> that the problem may be because the picaxe board outputs are buffered via the ULN2308 Darlington driver IC, but I'm not really sure.

Can anyone advise? Thanks in advance.
 

womai

Senior Member
Hi,

the Darlington driver is most likely the problem. Think of such a Darlington as a switch to ground that can be open or closed. Being a simple switch, it will not source any voltage (other than ground = 0V) to your LED driver chip's inputs. There are two ways to get around this:

(1) instead of going through the Darlington driver, connect the Picaxe outputs directly to the LED driver inputs.

(2) if that is not possible, add a pull-up resistor (anywhere between 1 and 10 kOhm is a good value) between the output of each of the Darlington drivers and your supply voltage (5V). When the Darlington switch is off, then this pull-up resistor supplies high voltage to the input. When the switch is closed, then the output gets pulled hard to ground, overriding the weak pull-up. The disadvantage is that it draws static current when it is low (bad for battery life), and it inverses the signals from the Picaxe (i.e. Picaxe output high means Darlington output low and vice versa).

Wolfgang
 

manuka

Senior Member
Welcome- for someone new to Picaxes you seem well advanced already! Have you checked projects/pages on 7 seg driving such as Dave's <A href='http://dave.fraildream.net/picaxe/px-prj01a.shtml ' Target=_Blank>External Web Link</a> &amp; SiChip's<A href='http://www.siliconchip.com.au/cms/A_103140/article.html ' Target=_Blank>External Web Link</a>. David Lincoln's book <A href='http://www.amazon.com/gp/product/0071457658/104-0710117-5529521?v=glance&amp;n=283155 ' Target=_Blank>External Web Link</a> is considered the standard for Picaxe insights.

I'm in fact wary of the current demands of 7 seg LEDs (&quot; a new way to flatten batteries..&quot;),&amp; they can be hard to purchase now too. Considered 16x2 LCDs that can often be rescued from old laser printers etc? Even new these can be &lt;US$10. Several serial driving approaches have evolved,especially Peter Anderson's &amp; Hippy's,allowing easy 18X interfacing &amp; full ASCII alphanumeric displays with very low current demands.

Stan - excuse brief response (mobile!)


Edited by - manuka on 29/08/2006 22:14:50
 

Innes

Member
Thank you for your replies which were very informative. The links were also helpful.

I spent the evening building a basic breadboard circuit so that I could download my code directly to the picaxe and plug straight into the output pins without the Darlington driver. Lucky I had an old RS232 cable to cannibalise! Effectively, I have answered my own question (although your replies have helped me understand why). The circuit/code works perfectly when I output a clock (or reset) signal directly to the 4026 from the picaxe pins.

I now have a demo circuit which counts from 1 to 9 and back again repeatedly. The next step is to add another 4026 so that I can count to 99. I'm wondering how many 4026's I can string together before the update becomes noticeable (I have two triple 7 segment displays handy)! This is just a learning process - I don't actually need the circuit for a particular application.

I am planning to build a small robot as a together with my ten year-old son, so no doubt I'll be back with more questions over the coming weeks!

I have been developing software for Windows for many years, so it's a bit of a culture shock to come down to such limited commands and coding techniques! It's a long time since I did any electronics, so that side is a bit of a struggle. Also, I'm hoping that my old Meccano, which has been in the loft for 25 years, will come in handy!

Thanks again.
 

Rickharris

Senior Member
How many - Quite a lot i wouldn't expect the propagation time to be very long compaired to the relativly slow speed of the picaxe.

Mecano Ideal for robot. Make sure the motor current doesn't exceed the ability of your motor driver some older mecano motors could pull hefty currents.

Lots and Lots of robot stuff on the web now. if you get really excited go for a walker that really impresses the young ones.
 

useless

Senior Member
Yeah I got into computer programming before getting into programming the picaxe, and I was shocked at how limited you are!, also it's confusing when youve always done stuff a certain way on a computer and now seems logical but it doesn't apply for the picaxe.

Hi, im useless,
useless by name ,useless by reputation.
 

RickAlty

Senior Member
This is a flashback for me... I first learned to program on a Timex 1000 with a whopping 1k of RAM.... much the same as the Picaxe 18X
 

Dippy

Moderator
Useless -you are definitely NOT useless.
You are VERY good at getting every one else to solve your queries - 10 out of 10!
That is far from 'useless'.
Even Stan has offered to come round and sort you out.
 

Michael 2727

Senior Member
Welcome to Picaxe.

A &quot; For, Next &quot; pulses out fairly fast.
<code><pre><font size=2 face='Courier'>e.g.
high 0 'RESET PIN
low 0
for counter = 1 to b1 'b1 or other digit
high 2 'CLOCK PIN
low 2
next counter
'
</font></pre></code>
A Piezo on the same cloch output produces a Biip.

PWM can be a lot slower depending on what you use.



Edited by - Michael 2727 on 30/08/2006 09:32:29
 
Top