Getting Started

Michael 2727

Senior Member
How about we get this section up and running with
some simple code for the Newbies to try out their
"fresh out of the Box" Picaxe toys
@


I wonder if Technical would consider splitting the forum
into more than one section e.g. -
EDIT - This section only Code Snippets.
  • B - Beginners, where full instructions, Pins / Legs
    and heavily commented codes only are posted.
  • I - Intermediate, some comments could be included etc.
  • A - Advanced, where you're on your own and any further
    information will have to come from the posterer if they
    are willing to help you out at all.

I thought I'd start with a simple LED Fader - I'll post something a little later, gotta go for now.
 
Last edited:

BeanieBots

Moderator
I think that's good idea.
However, we should not let the forum become an excuse for not reading the manual so the 'snippets' should be original work and not cut/paste from the manual.
LED fader would be a good start.
 

solderman

New Member
BeginnerWoes

Michael2727 - great idea - Yes Please.
BeanieBots, is the CD-ROM what you mean by "the manual"?
( it appears on the PicAxe website also )

I am using a recently bought PixAxe-18 "starter kit" and looked at the CD ROM for help.
- Section 1 - fair, it's for beginners
- Section 2 - this is where I started looking at the BASIC commands; they give examples which I Cut/Paste into the simulator. More than half don't run because of a syntax error . . . those that do . . . are OK, although some latch-up/stall when certain input-conditions have been applied.
=Indeed reading the BASIC (code listing) shows me no hint as to why they don't run and the bland "syntax error" is not any help.
(Sure I can force an error by lack of punctuation, etc.)
In "help" I found two codes that don't exist - one is CASE and SPOT (I think) - Sorry, I have a separate system I can't access right now....it's all very confusing and if you want to find someone that's easily confused - I'm right here.

I'm still looking for inspiration - anywhere....

Section 3 - not sure, most of these last few days have been spent tryinig to get the example programs to work, so I can understand how to structure my own.

If the Code is correct, then is my simulator* wrong?... I appear to have it configured as an 18-pin PicAxe and the output LED (Pins) flash On/Off with the simplist program.
However, it would be nice to have all the Editor-options explained - how does anyone do this without assistance?

*It's in the "Editor" I think = it allows you to run without having the pcb+PicAxe attached.
 

hippy

Technical Support
Staff member
When coming to the PICAXE with no experience at all I imagine it is quite hard to get to grips with things. For many people they first meet the PICAXE through a school course where the educators explain what it is and cultivate understanding, others already have experience with microprocessors which they can apply.

I don't know how the UK educational system works these days but it would be great if there were some publically accessible teaching material on the PICAXE. The impression I get is that every teacher develops their own teaching material which would suggest a lot of re-inventing the wheel and duplicated effort. If there is such published material then I haven't found it.

Perhaps the best available resource for newcomers is David Lincoln's "Programming & Customizing the PICAXE Microcontroller" book ? I haven't read it so cannot comment on it.

As manufacturers it's not Rev-Ed's primary job to educate and that could be re-inventing the wheel again. What's being asked for probably exists in a number of places, but not here or not available for public consumption. What we perhaps really need is an index to where information can be found and what level of experience it is aimed at.
 

BeanieBots

Moderator
I mean the manual that comes in three parts.
1. Getting started
2. Basic Commands
3. Interfacing Circuits

It is available from a link on this forum [PICAXE Manual] above.
It is on the CD and it gets installed along with the Editor and be called via the Help menu. So, no real excuse for not being able to find it (them).

I agree with Hippy that for the complete novice it might be quite daunting.
The biggest issue that I see is that there two parts to the problem of getting started. The first is to make a circuit that works and the second is to get a program into the chip in that circuit which also works. If either have a problem, then there is no result:(

I'm quite sure that more than 98% of the (PICAXE related) questions asked here could be answered by reading those manuals. It's not simply a question of lazyness, just sometimes needs a little pointer to which command to use or maybe not knowing that a particular function is available.

The FAQ (also available above here) is another useful document that is sadly very rarely read.

All the commands have a small example code.
The older version of the command manual made frequent use of the label name "loop". This has (fairly recently) become part of the Do/Loop command structure so it is very likely that syntax errors will occur when using exact code examples from an old manual. If you find any in the new manual, then please point them out and Technical will put it right in the next version.
 
Last edited:

lbenson

Senior Member
>More than half don't run because of a syntax error

Make sure that the "Enhanced" radio button is clicked under View, Options, Editor.

Technical: as has often been said before, making this the default would save a good many questions from those just beginning, and I'm sure a great deal of frustration. What's the advantage to leaving that unchecked as a default? If you think it would significantly break older code, how about adding a note to the "syntax error" pointing to the enhanced option when somethng like a do or select command causes it?
 

Michael 2727

Senior Member
Hi Solderman,
Welcome to the forum.

Read the Manual, aka (RTFM) when you get frazzled answering
the same question every 3 weeks with every batch of new recruits,
refers to the 3 manuals (which are on the CD also ) and are as follows -
(from the manual itself
The PICAXE manual is divided into three sections:
Section 1 - Getting Started
Section 2 - BASIC Commands
Section 3 - Microcontroller interfacing circuits)


picaxe_manual1.pdf = What a Picaxe is, does, how they basically
work, software (Program Editor), connection cables, models available
and a truckload of other Picaxe info.

picaxe_manual2.pdf = Lists all of the commands available to use
as Picaxe Basic, programming language, it also gives a description of what
each command does and includes a brief example of how the command
can be used. ( some are a little too brief, my opinion only )

picaxe_manual3.pdf = This is the Hardware section, it shows you
how to connect your picaxe to almost other device from a single LED up
to a self contained picaxe INTERNET Server or Picaxe MP3 Player, wait
long enough and you may get to see a Picaxe Orbiting SpaceStation.

These 3 .pdf documents should be able to answer 95% of everything you
will ever need to know about a Picaxe. The rest is in here or not yet written.
Put these 3 documents on your PC Desktop, NOW, I'll wait !
Tap, Tap, Tap, Tap,Tap, Tap, Tap, Tap, Times up!

Earlier this year, 2007 there was an upgrade/s to the Program Editor.
It now has a few modes it can run under e.g. added was Colour Syntax
and Enhanced Mode etc. Top tool bar/View/Options will open up a window
with a bunch of tags, these contain all of the settings you need to get
the correct setup.

Now because some new commands were added for newly released
chips e.g. 14M, 28X1, 40X1 an Enhanced Mode had to be added.
If running in the Original Mode some of the newer code will show
as an error.

Make sure you have the correct Chip selected, not all pins have the same
function on every chip, this will cause errors.( cant make O/P 7 high if the
chip only has 4 outputs )
And check you are not running in Original Mode if Enhanced Mode may be needed.

It's a learning curve, you will get there, not today though.

Good Luck.
 

solderman

New Member
many thanks.

Hi all, many thanks for taking the trouble to reply.
It's good to know there is help out there.

I am well aware of the 3-sections ( they are on the CD) and may be accessed from Rev-Ed anyway.
My problem is that when explaining BASIC, they use a sample code which ( sometimes) contains syntax errors.
Unfortunately the explanations are spread over two sections . . . so it seems that I shall have to buy an enormous bottle of ink to print out all the text.
- Unfortunately, it my belief that too little time has been applied to these introductory notes.
Since they are benefiting from PicAxe sales YES they do have to provide support, otherwise I shall move to raw PIC's - they are already far easier to use than a few years ago,
If as you alude, the same Q's are asked with each new wave of beginner. . . . then you have to agree the Text must be lacking something.

It is a great skill to write technical-text which is neither patronising, nor too wordy, whilst still conveying the necessary info.
The ideal textbook leaves you fully informed, almost believing you already knew it!
- A different approach is needed when you want to check something (like nested Go-To's) - what you don't want is an explanation starting at Zero. . . you need concise information to the likely techniques . which you only slightly forgot . . . plus a few extra "wrinkles". This approach is often referred to as "Pocket Guide".

- Those of you who are "experienced" will know that condensing the program is essential; so some suggestions as to a "better" way of achieving the same result, would be very useful. I'll consider this later, but I suspect it will be best to take simple applications for which an "obvious program" can be made better with a sly alternative approach.

I must say that the CD which I bought ( Starter-kit), appears to be last-year's model, the current download contains some bug-fixes. Also I'm quite sure the right PicAxe was chosen . . . indeed I tried some of the "rogue" program examples with "alternative" versions, but as experienced PicAxers will know, the code is almost universal ( excluding only special features).

It may be that I'm getting better, or maybe I am now able to correct some silly errors.....but I'm finding the software is somewhat better than a few days ago.....(with the laterst version).
However, I suspect the whole CD could do with some revision - what do others think?

[Unfortunately you need to be a "Beginner" to understand the difficulty a very small (misplaced word) causes. Oops!]

Nevertheless they are also confused about the supply voltage - clearly this must be 5v, due to the PIC characteristics - so PicAxe mention this several times. It is surprising that there is a circuit that recommends using 6V and even suggests a PP3 - these are "obvious" mistakes, but it shows that no-one has ever applied corrections. For a 1st edition it is excusable...but this is now several editions on... I rest my Case!

YES -A beginners' section (here) would be useful; somewhere where corrections/simplifications can be posted. Somewhere where "better" explanations might be tried with peer-review

On a technical point, can someone explain why universal PIC-programmers "verify" the code at the Upper and Lower supply voltages. . . . yet PicAxe doesn't? I think this shows that PICs are far better than they used to be and PicAxe is taking advantage of this . . .why not?
 
Last edited:

hippy

Technical Support
Staff member
It is a great skill to write technical-text which is neither patronising, nor too wordy, whilst still conveying the necessary info.

I have never perfected the art of terseness. Probably because I prefer things which are explained in detail rather than leaving people to second guess anything. And I find terse harder going to read. And ... :)

The ideal textbook leaves you fully informed, almost believing you already knew it!
- A different approach is needed when you want to check something ... This approach is often referred to as "Pocket Guide".


Balancing the two is the hard thing, and usually does mean at least two different 'books'. PICAXE Manual 2 "Basic Commands" is a good example for medium to full experience, but not so good for beginners.

However, I suspect the whole CD could do with some revision - what do others think?

With a broadband connection the CD isn't needed. Unless Rev-Ed burn discs on demand, it will always be out of date.

Unfortunately you need to be a "Beginner" to understand the difficulty a very small (misplaced word) causes. Oops!

Despite the presence of experienced people in these forums, we all started with zero knowledge somewhere down the line. Often decades ago, but I am sure we all appreciate the problems that beginners can have. Like anything though, after the initial learning curve and getting through the frustrations and screaming fits it all becomes a lot easier ... then Rev-Ed introduce a PICAXE-64X9 and even the experts have to start learning again :)

It is surprising that there is a circuit that recommends using 6V and even suggests a PP3

I thought the references to 6V had been removed except for motors. I'm surprised if there is a mention of using a 9V PP3 to power a PICAXE other than to say don't - any idea which PDF that's in ?

On a technical point, can someone explain why universal PIC-programmers "verify" the code at the Upper and Lower supply voltages. . . . yet PicAxe doesn't? I think this shows that PICs are far better than they used to be and PicAxe is taking advantage of this . . .why not?

A good PICmicro programmer will verify the programming at extremes of voltage just to make sure it is reliable under all circumstances. For commercial use that's important because no one wants to fit a potentially dodgy chip in a board, get complaints and have to deal with all the hassles which come with that. I'm sure the PICAXE firmware is programmed and verified by Rev-Ed in this way before shipping.

It's good practice but not a necessity. I've not known any PICmicro programmed successfully to fail verification at voltage extremes. Most hobby / home programmers only verify at a fixed voltage ( usually 5V ), and the PICAXE is self-programming at whatever voltage it is connected to. It takes advantage of the fact that it's unlikely to fail verification at other voltages. It's also difficult to verify at other voltages when there's no control over the power supply ;-)
 

jonphenry

New Member
Just to throw my two cents in.

I am new to microcontrollers and programming, I started playing with the picaxes only a few months ago. Aside from a typo or two and one or two commands I couldnt quite grasp, I found the manuals to be extremely clear and concise. I had no problems writing my first little test program and have written a couple of(what I would consider)fairly complex programs with minimal 'requests for support'. Unlike many people, I fear Im one of the few who would prefer to read the manual before calling support(posting in the forums).

At my former job, when a customer had a question about our system or software, they would pull out the manual and find our phone number. Thats all they used the manual for. Alot of people are more comfortable getting their info from a real person as opposed to figuring it out themselves or worse not trusting they understood what they read(When in doubt, try it out!).I think thats probably why many newcomers ask those simple questions the resident gurus have answered umpteen thousand times.
 

manuka

Senior Member
Learn by doing/RTFM- not for everyone

In spite of umpteen decades as an educator/writer, & the wonders of the self driven web/YouTube etc,I'm often still rather taken back when asked to READ OUT THE INSTRUCTIONS to people. Often even the enthusiastic tone of voice can be a learning motivator!

Like most engineers I'm a tactile self driven learner & have long subscribed to teaching under the hear/forget, see/learn, do/remember school of thought. But not all learners work this way -aside from possible technical vocab. literacy issues, some folks just understand better when they hear things verbally or are shown 1:1.
 

Rickharris

Senior Member
Ok for the point of view of a current secondary (11 to 18 years old) teacher in a good quality school (Boys Grammar School) in the UK:

Boys don't like reading (a generality but like most generally true) they prefer to have someone tell them.

Reading and understanding if you have neither experience, a technical hobby or background may not be the same thing.

Without the tinkerers willingness to 'have a go, so what if I break it' attitude many people are frankly scared to dive in - more so if a) they think they have followed instructions but it still doesn't work, b) they entered the supplied code - didn't understand how it worked anyway because it uses some complicated and "interesting" features AND the example contains errors they are never going to find at their stage of knowledge.

Personally I break the teaching into 3 sections:

1. A basic overview to understand what "control" is and what the systems does with no worries about HOW it does it (Magic will do for now) - Sensors, lDR, Thermistor (see later) - output devices LEDs, Piezo sounder, motors. The average 12 year old does NOT know how an electric motor works - science in UK schools no longer teach this, although they may show them a picture.

2. The 7 most useful commands you need to get a grip of:
High
Low
Wait/Pause (Note: the average beginner has no idea what a milli second is)
Goto and labels
For ...Next and variables.
Sound because the kids think it's fun.


Couple those with some LED work to get them seeing it in action and after 6 hours most will be programming multiple LEDs some can be shown 2 LEDs between 2 outputs, all will be making a noise as soon as the first one does, and about half will have some immediate grasp of what they are currently doing.

The next 2 lessons go to driving other things - motors because they are useful beasts.
I explain relays, an electromechanical switch, and pass round a BIG one with no cover on so they can press the leaver and see the contacts change.

They take the idea of a relay H bridge very easily. The we go onto the L293 (same but smaller - who cares what is inside at this present time only what it does.

We bread board the L293, a small motor/fan a thermistor and a light bulb (BIG jump for some but they already know they can make things turn on and off)

In pairs for support we discuss advanced programming - READADC - The kids programme the fan to turn on to cool the thermistor, and the bulb to come on to warm it up - Air conditioning system/greenhouse control.

This pretty much fills 6 weeks 1 hour a week.

In the next 6 weeks we build a simple 2 motor robot simple touch and reverse action but the kids like them and most can easily programme them.

After that it is up to them - I point them at Picaxe.com, I tell them it's cheap, I tell them to show their parents (interested!!!), Hardly ever do any do anything about it because it's so much more fun killing alien monsters on your ready made sleek and cool XboxtendoWii or whatever.

BUT where would the world be if we were all engineers - i hear Dippy saying "a better place" - OK :)

Fact is, (I think), This forum is invaluable because of the experienced people who are willing to give their time again and again to the same issues with different people and often without a word of thanks.

Without the support many/most would not get past point a).

We do however have 2 issues - 1. the beginner who can't get the durned programme to download. 2. The advanced user who needs some highly complex heavily optimised code to drive their wireless driven remote ant colony simulation designed to cleanup nuclear waste in the event of the next government screwup.

They are 2 distinct areas and have different needs - PLEASE guys don't get discouraged and stop replying to the beginner (RTFM isn't always very useful although with a page ref it may work - see above) - good teaching is a log with an expert at one end and an open mind at the other, (Mark Twain - paraphrase), Keep them logs rolling.

We were all beginners once, and remember how hard valves were to get working Stan?
 

manuka

Senior Member
Valves ? They were EASY- the filament lit up to confirm a 6.3V supply for starters! Good points Rick. Stan
 

wllshaw

Member
Thanks for teaching the youngsters amoung us

As a newbie to the world of picaxe chips I want to say THANK YOU in advance of any questions I may have. I have a picaxe starter kit ordered and on the way. Part 1 of the picaxe manual has been has been downloaded and read. Understood, well, we'll see. It did take me a while to understand what (RTFM) stood for. While that may elicite a laugh here or there, when you are surrounded by acronyms sometimes you get lost. I am still looking for parts 2 and 3 on the web.
Your comments in the forums have been helpful, and I say this without even having started working with the chips. A wise man once told me that teaching students is like talking to a wall. You keep repeating the same thing over and over and over for the first year. Year two brings about a change and you just update information the students should already have. Year three, and the students come to you for advice only. Year four means you sit back and monitor the students as they are on their own and walking with both feet. I have found this to be true and I believe your comments validate my opinion.
In regards to why I am here. I am a 47 year old youngster who has absolutely no clue about the world of picaxes, but I am interested. What I do have is a 13 year old son who keeps asking me questions--yes-- over and over and over and over. I am tired of looking at him and saying "I don't know", so here I am. I will hopefully learn enough, fast enough, to stay ahead of his learning curve.
Please keep replying to the most mundane questions. For all of us youngsters, we appreciate it.

Thanks
 

hippy

Technical Support
Staff member
Welcome to the old-timers club

I am a 47 year old youngster who has absolutely no clue about the world of picaxes, but I am interested.
I think you'd be surprised by how many 'old duffers' there are on this forum, myself included :)

Once you have your first LED turning on or off - or the Programming Editor displaying "Hello World!" if you're not feeling hardware adventurous - I think you'll be hooked like the rest of us.
 

manuka

Senior Member
Speaking from a educators point of view,I have to (again) say that vested interests may view PICAXE style circuitry as being "too easy". Existing labs & lesson plans based around established delivery may endure long after their use by date, simply because of resources, manuals,established suppliers,reliable class sets,syllabus demands & of course staff familiarity. The tardy PICAXE uptake in the US educational system apparently relates to their entrenched Basic Stamp "culture", even though BS prices are a good order of magnitude higher.

Naturally a significant issue,for both students & teacher,relates to their past electrotech. experiences, & even ones political views on productivity & innovation. "Youngsters" (& this-shock insight- includes teachers) who've come from decades of sweating NPNs, hard wired logic, op-amps & 555s etc, may be extremely wary of simpler approaches. They've put in the hard yards & don't see why the next generation shouldn't as well. You often can't teach old dogs new tricks- they've only got 5 years to retirement sort of thing & will just keep doing more of the same. Not all educators enjoy their work!!!

My tertiary educational experiences have often left students wildly excited about PICAXEs (OK- I do tend to the enthusiastic!),with mind expanding applications abounding. Sadly subsequent(& even parallel) courses may act as a wet blanket if the deliverer feels the likes of Z80s & pages of low level code are the best way to flash LEDs under a rationale of "We're teaching you to think". Not all educators share my approach of "fostering initial enthusiasm to make later demanding work easier"... Stan
 

Attachments

Last edited:
hey Jon

I just read your keypad code and circuit, I wish I had read it before, I built a 10 position selector switch exactly the same way. BTW thanks for the code, mine was bit more MS-like (suffering bloat)
 

Peter M

Senior Member
Hmmm... does that mean that you wouldn't bother with the laborious task of answering the same question over and over in the newbies section... what would become of the new beginner then??? who would be there to get them exited about what is possible, I find answering these questions (in a classroom more so) is often a way of learning new things myself..when you look at how they've tried to skin the cat (well wouldn't have thought of starting with the nostrils, but anyway) they always seem to ask the same thing in a different way requiring a different train of thought, often provoking new thought!!

David Lincoln's "Programming & Customizing the PICAXE Microcontroller" book... yes have read it, a good read, a few typos here and there (probably less than here though), but this just tests your understanding a little better (isn't that right Stan, we can't all be perfect all the time)
Would be good if I could remember it all.

Valves I hear you say.. yes they glow.... but they aint workin if they don't bite, bit like gaurd dogs.... now thats a lesson I only learned once.. zzst!

Some students go "so what I could do that with a switch" others do see the potential of automation. (or just big kids toys)

I would agree that a lot of todays youth would rather someone do it for them, but a bit of guidence or a bit of a push, and who knows they may be the next one complaining about newbies...

The other two manuals your looking for are under the tab picaxe manuals at the top of the page... they also come with the software when you down load it.

Yes... education, we all started off having someone else wipe our butt (and yes day after day after day... can't you do that yourself yet???? is does take some of us a long time to master the seemingly simple) and now look at what we can do!!!!!
 

grey83

New Member
Thanks very much, I for one ,would be very gratefull for a newby section. You guys are so far above me in skill and understanding. Still, I have gotten so much from this forum.
Thanks again,grey83
 

Benjie

Senior Member
Hello!
I'm another newcomer and I think the problem of easy start deals with the form of the instruction manuals. 25 years back I learned, and used extensively, DBase III with no support at all but just using their extensive user manuals. The difference with the today manuals is the form: they are in electronic data form not printed on paper. Browsing a pdf file in search of a solution is quite different then going through the pages of the equivalent book. Sound old fashioned? I don't think so. I suggest to newcomers to invest on print ink or have the manuals printed with laser printers of some service company.
You will see the difference.

BTW I learned, and now almost forgot, the Basic language back in 1977 using the little Sinclair computer which had the Basic commands pasted in the keys of the keyboard. Its printed manual was an educational reference.
Have just ordered the 20X development board. Hope to write some working code soon.
 

papaof2

Senior Member
I agree on paper versus digital - cnn.com even had a link to an article on people being able to read paper books faster than e-books.

But it does seem that the PICAXE manuals are updated immediately after I print a copy...

John
 

slimplynth

Senior Member
The first thing I read in any text, print or pdf...

...the index.

The manuals score highly on this section. Think they only lack when it comes to fixing an unexpected. Though sensibly, there are more than a few things that can go wrong due to operator error)

(scrapped the flow chart I started because I wasn't sure if it was needed :confused:)

It's a fine balance, people need to read/research before asking something that's already been discussed (something I'm guilty of). Guess Rev-Ed are funding a forum with an ever growing need for QnA that needs to be archived and also be accessible.

Personally think the search button/function needs looking at but then I'm always happy to google..

Code:
[query_word1] + [query_word2] ... [q_wn] site:picaxeforum.co.uk
..which gets the best results.

Have tried before to categorise interesting posts for use in a personal website for future readings.. was very difficult to categorise apart from the obvious problem 'download'.

others categories (quick list) being...

Wireless/ Serial
Maths
Motor control
Servos
IC2
SPI
Bit Banging
... see the index of the relevant manual for others...

Like any other IT escapade, possibly the most difficult thing to do is to think of an idea/project.. what it's aim is and what items/code are required to make it work (hope I haven't stated the obvious)... once the download problems are covered then surely the forum is about sharing ideas (and 'other' problems - which are difficult if not impossible to document) the projects section is sparse, but then those that can.. teach and those who could add are probably busy people themselves.

again, i feel bad for not posting a complete project :eek:.. i can only blame it on a difficult work and haphazard social life. Have taken a hell of a lot of knowledge from this forum. The Moderators/Hippy/Technical are always posting items/code that add to the picaxe experience.

I hope new starters aren't intimidated from posting, you shouldn't be... sarcasm may be evident sometimes but surely the fact that your looking for answers means your a little bit different to everyone else and can understand a witty comment for the humour in which it was intended.

errr sorry, :D I know, wittering I am and Rev-ed now have to archive this post
 
Last edited:
Top