Where to start (beginner)

Jarubell

Senior Member
Hello all! I only found out about PICAXE in another unrelated forum two days ago andi'm hooked, but where do I start. At first I would like to learn by just playing with LEDs but the analogue I/Os would be a goal in the not so far future.

So, i'm thinking of getting a 20X2? The USB adapter would be great, but what else, I have a breadboard.

Well, off to see where I can purchase these items in eastern Canada.

James
 

lbenson

Senior Member
James,

Welcome to the picaxe forum. I've ordered parts from Nova Scotia, namely from Milton near Liverpool. www.PHAnderson.com ships from the U.S. at a reasonable price and has the 20X2 in stock (I would also get some 08Ms to play with, and extra breadboards--he has good prices).

You can also order directly from Rev. Ed. Tech Supplies--both postage and shipping times from U.K. are not far out of line with respect to reasonable shippers from the U.S. (but some US shippers want to tack on outrageous "handling" costs). Make sure you get a programming cable--USB to serial, or if you order from Tech Supplies, perhaps the AXE027 (but only if you get a project board which takes the stereo connector)

In Canada, not selling picaxes specifically, www.QKits.com sells interesting stuff like 433mHz wireless transmitters and receivers--I've worked with those.

www.digikey.ca is the Canadian site for Digikey--a big supplier of components. They ship from the US, though.

Good luck, and have fun. If you have more questions, let us know what projects interest you and what your past experience with hobby electronics is.

While you're waiting, read Manuals 1, 2, and 3 (click PICAXE Manual on the menu bar at the top of the page).
 

hippy

Ex-Staff (retired)
LED's, piezo sounder, LDR ( light dependent resistor ), NTC Thermistor, DS18B20 temperature sensor, IR LED and TOPS18 IR receiver - That gives you a fair bit to experiment and learn with at fairly low cost.

Plus some batteries and a battery case.

I'll match Stan's 08M suggestion and raise you a 20X2 - I'd recommend a 20X2 and an 08M - It's always good to get two chips talking together.

Some idea of your programming and electronics skills plus any idea of what you think you might be using the PICAXE for will be helpful to give more detailed suggestions.
 

Jarubell

Senior Member
lbenson,

perfect and thanks. I had a feeling that I would be told to start with the 08M, and I will. Also Thanks for the links.

As for the AXE027, is the stereo connect something fancy or any connector would work?

I would like to start with playing with LEDs and I'm going to say that my experience is limited (at work I deal with instruments with 4-20mA I/O, I just never been able to play with the PLCs).

manuka,

Thanks for your reply and suggestion of where I should start.
 

Jarubell

Senior Member
Hippy,

I like the suggestions of the piezo sounder, temperature sensor, IR but I'm going to have to go to search what a LDR and NTC Thermistor do.

Right now I just interested in learning how to program this chips, i'm sure I'll come up with a projects later.

Thanks.
 

hippy

Ex-Staff (retired)
LDR measures brightness, NTC thermistor measures temperature ( rough and ready but cheaply ). Both create an analogue voltage when used in a potential divider circuit so these are a good way to 'do something' with analogue. Take a look at PICAXE Manual 3.
 

Jarubell

Senior Member
Okay Hippy, I got it now and yes, some LDRs and a NTC Thermistor (i'm use to RTDs at work) will be added to my play list. I am interested in analogue inputs but I going to have to keep on reading, still in Manual 1.

Thanks again!
 
Last edited:

lbenson

Senior Member
>As for the AXE027, is the stereo connect something fancy or any connector would work?

The stereo connector is not fancy, and if you use it with a Rev-ed project board which has the connector for it, it will make for the most trouble-free startup in programming (as many have argued before). That said, I have never used one, and Stan (manuka) goes for the same simple (once you get it right) wire with three header pins to plug into a breadboard. But this requires you to make up your own cable.

You would buy a USB-serial cable (phanderson sells one, as do many others). Then you need to make a 3-wire cable with DB9 female on one end and a 3-pin header on the other. Not hard but you need the parts and need to do a little soldering. And you have to get the 2-resistor programming interface right on your breadboard. Again, not hard, but many stumble there. Check Stan's site for many good breadboard illustrations if you want to try this (which for me, gives the greatest flexibility--I've probably used it on 4 or 5 dozen different picaxe boards or breadboards of 6 or 8 different types).

You might want to check out westaust's excellent PEBBLE breadboard layout emulator: http://www.picaxeforum.co.uk/showthread.php?t=12629&highlight=peeble
Post 17 shows a simple 08M layout for lighting 3 leds. A fourth could be added on pin4, and a switch on pin3 could let you move between them.

The simulator is also a great tool. It comes with the program editor, which is a free download. You can test your programming ideas before you even get any hardware. The following is a program which can run in the simulator and which turns on a different LED every two seconds.
Code:
'08LEDs turns on LEDs in turn
#picaxe 08M         

main:
  do               ' loop forever
    high b12       ' turn on pin 0, 1, or 2
    pause 2000     ' wait 2 seconds
    low b12        ' turn off led
    inc b13        ' move to the next led
    b12 = b13 // 3 ' remainder: gives 0,1,2
  loop
This would work with the layout from the PEBBLE thread. No initialization of the variables b12 and b13 is needed because they have the value of 0 at startup.
 
Last edited:

Peter M

Senior Member
@ lbenson

That bit of code is brilliant... would never have thought of that myself.

Works with the 20x2 (in the simulator at least) with all its output pins too.
Just change the 3 in this line and it goes up to what ever you want.... b12 = b13 // 3

Maths....... don't you just love what can be done with it.;)

Know doubt just one of many ways of skinning that cat. But I like that one.

Thanks heaps, I was just pondering how to do just that simple function myself.:)
.
 

westaust55

Moderator
i'm hooked, but where do I start.
James
James,

While you are waiting for your PICAXE chips and other hardware to arrive, can I suggest that you download and start reading through the PICAXE manuals (3 parts in total)
These give an intro, the syntax of the BASIC programming language and in part 3 there are many basic input and output device connection and programming examples.

The PICAXE manuals can be accessed on the Rev Ed website via the PICAXE Manual link on the orange bars at the top of these forum pages.
 

Jarubell

Senior Member
lbenson- thanks again for your input, I will look into that PEBBLE breadboard layout emulator.

westaust55- Thanks, I have found the manuals already which I have been looking at.
 

Rickharris

Senior Member
As I have said before:

If you initially focus on a few simple commands you will be able to control the components that have been suggested without getting too complicated.

Your then well set up to move on to inter chip communications and more complex commands and ideas such as PWM.

Starter commands;

High Turns output on
Low Turns output off
IF - then reads digital input
Goto jumps to a label
Wait / pause waits for seconds or pauses for milli seconds
Readadc Reads in an analogue signal.


These will do much of what you will need at first
 

Jarubell

Senior Member
Rickharris- Thanks for your reply and as for those starter commands, should be a non-issue since those bring back memories of basic, but that's going back 20 years. I look forward to working up to using analogue I/Os, but one step at a time, hopeful big steps.

James
 

Jarubell

Senior Member
Thanks louisyuikin, I know sit here waiting for my shipment, reading away and thinking of my first project.

I'm thinking of lighting up my daughters disco ball with some bright colored LEDs, would this work? I'm thinking I would be able to program a 08m to accept a ir led signal and output different led combinations. But, I need to read more.

Thanks
 

hippy

Ex-Staff (retired)
It sounds like that could work and the 08M can certainly be programmed to take IR commands and change light patterns and colours.

There's a limit to the current which can drawn through any I/O pin to light a LED so some high brightness LED's may be an issue but people here can give advice on that. As long as a suitable resistor is used the PICAXE won't be damaged by excess current - Take a look at PICAXE Manual 3, output device interfacing, LED.
 

Andrew Cowan

Senior Member
What information do you want?

They generally have low forward voltages (~1.8v), and can take higher currents than standard LEDs (often >60mA). The device's datasheet will tell you.

For general infra-red knowledge, look at the infrain command in manual 2.

A
 

manuka

Senior Member
IR LEDs can be briefly pulsed with quite high currents. Another trick involves 2 or 3 being used in series (from a ~5V supply). This gives more IR output,& also avoids wasting driving energy with dropper R's. As surely everyone now knows, digital cameras can "see" the output from IR LEDs - VERY handy when setting up.
 

Jarubell

Senior Member
Thank you for your replys.

I guess I'm just looking for direction to find general info regarding IR LEDs and yes, the receiver too. I was thinking of just using it as a switch but I see that it is more that that.

Thanks
 
Last edited:

lbenson

Senior Member
>I'm just looking for direction to find general info regarding IR LEDs and yes, the receiver too

Did you check out the infrain2 command in manual 2? Flexible control with many Dollar/Pound Store remotes.
 

Jarubell

Senior Member
Sidetrack with playing with PICAXE programming Editor, I can't wait for my shipment! Can't believe how happy I am with what I did, even how simple the code is.

Code:
setint %01000,%01000 
b1=0			

main:
	if b1 > 2 then number0
	if b1 = 1 then number1		
	if b1 = 2 then number2
	goto main					

interrupt:
			
	pause 1000 	
	if pin3=1 then interrupt			
	setint %01000,%01000
	b1=b1+1	
	return
	
number0:
	b1=0
	goto main
	
number1:

	high 1
	low 2,4
	pause 500
	low 1
	high 2,4
	pause 450
	goto main
	
number2:

	low 2,4
	high 1 
	pause 1000
	low 1
	high 4
	pause 100
	goto main
flashing outputs, yahoo!!!!
 

lbenson

Senior Member
The TVR010 remote control is not specifically required--any remote which outputs the correct Sony codes will do. Many (most?) universal remotes can be set to the appropriate Sony mode.

Note that because infrain2 is "blocking", like serin, it's appropriate for circuits where you set a state of the output pins, and then don't change them until you receive another command from infrain2.

If your transmitter is another picaxe instead of the remote, then as hippy has shown elsewhere, you can transmit dummy signals which can trigger an interrupt, and in the interrupt you do your infrain2 command to read the real signal code. In this case your code can be "free running" because you don't issue the blocking command until you know that data will be coming.

Hope this makes sense. It's past my bedtime and focus is fading.
 

Jarubell

Senior Member
lbenson, well last night was past my bed time and I read both your post and the manual and nothing made sense, however, tonight it makes a bit of sense now. I just going to have to order another 08m and the sensors and start trying! Would it be wise to get a couple 08m?

Thanks
James
 

MartinM57

Moderator
It would be wiser, IMHO, to get a couple of 20X2's into your prototyping kitbag - and then if you ever want to seriously make a device you can downsize what you have prototyped in a relatively powerful (yet hardly more complex) environment to the target PICAXE whether than be 08M, 14M etc.

08M is a great device, but it has limited capabiilty and only a small amount of code space - when I'm prototyping I want to investigate all sorts of things and not be constrained by needing 10 more bytes of code than an 08M supports or wanting that little extra hardware feature that a 08M doesn't have.

A couple of bucks(?) extra at this stage can make a whole load of difference to how you get on with PICAXEs...
 

Dippy

Moderator
Everyone will have a different opinion. Generally, I agree with Martin.
Stan wil post pictures of breadboards. Breadboards are great - once you have a vague idea what you are doing.

And, of course, it depends how seriously you take this and whether you feel you will be doing more sophisticated projects later.

If I were starting all over again I would get several PICAXEs including the 20X2 and 28X2.
I would get a project board or two and a little breadboard.
I would get some other bits and pieces too, to save me having to put in another order next week (more costs more delays).

I would get a project board as they include the download circuit. Although this is typically only 2 or 3 components so many people have trouble getting over this first hurdle when throwing things blindly into breadboard or strip board.
Eliminate this first hurdle, start downloading and you'll be hooked.... :)
 

hippy

Ex-Staff (retired)
I'll echo the sentiment that it's probably wise to spend a little extra and get a larger 20X2 or 28X2 instead of another 08M.

The 08M is excellent at what it does, good value for money, but the downside of being cheap is limitations on capabilities and potentially having to jump through hoops to make things work as projects and experiments get bigger and more complex.

It's a matter of limited room to expand, like buying a one room unfurnished flat compared to a 20 room mansion, all mod-cons included and fitted, with a large garden with guaranteed permission to build on.

You may not need all that for everything you do but it gives plenty of breathing space while experimenting and not sure how things will turn out ( during prototyping as MartinM57 describes ). As you get more experienced and familiar with PICAXE you will better know which is best for a particular job, go small to save costs, or spend a little more to better guarantee success even if it turns out you could have gone small. That's like buying insurance against not hitting a brick wall and having to scale back ambitions when you do, or having to start again with a larger PICAXE.

Having an 08M plus 20X2/28X2 will let you get to grips with what each can offer and you can then make more informed decisions later. One advantage of a circuit designed for 20X2 is that if it's done right, if an 08M ( or 14M, 20M ) could have been used, it's entirely possible to just drop one of those into the top part of the socket and rewrite the code.
 

Jarubell

Senior Member
Thanks guys, I did purchase a 20x2 after one of Hippy's earlier posts, which I'm happy I did now. The next time, i'll have a lot more in my shopping cart before I purchase, this waiting sucks and I still don't have some components I was looking for. I might have to look outside of Canada, i'm just afraid of exchange rates.

I appreciate you replies.
 

papaof2

Senior Member
It's helpful to check the daily rates here: http://www.xe.com/ucc/

Customs and shipping are more likely to be a financial hit than the current exchange rate is - I bought some 40X2's directly from Rev-Ed and with shipping paid less than I would have from a US supplier (none of whom had 40x2's at the time).

John
 

lbenson

Senior Member
No customs from GB and reasonable shipping cost from Rev-ed when I ordered in Nova Scotia. Note that for shipping, there is a cost trip-point which increases it. I dropped a 14M from my order to get back to the lowest shipping cost.
 

Jarubell

Senior Member
Well, than I'll give Techsupplies (which I just found) a try, they do have a lot more to select than the place here in Canada online.

lbenson, did you live in NS? If so, did you find a local electronic supplier?
 

lbenson

Senior Member
I have a seasonal home near Liverpool. I don't know of any Nova Scotia supplers--but I didn't look hard because if there are any, they're probably in Halifax, an hour and three-quarters away. For a wide range of parts, I used www.digikey.ca -- but they ship from the U.S. If you can wait for stuff, Sure Electronics on Ebay has a lot of things at good prices. The company which took over Radio Shack in Canada (I forget the name), has, I think, the same catalog of parts as Radio Shack, and the same part numbers, so you can get things like the IR transmitter from them. Costly, tho, but better if you can use store pickup.
 
Last edited:

Jarubell

Senior Member
My 08m has arrived! So I now have another beginner question. How do I "Observe precautions for handling" for my new "Electrostatic Sensitive Devices"
 

lbenson

Senior Member
>How do I "Observe precautions for handling"

Don't do a happy dance on the carpet while picking up and putting down your new 08M, and don't use it to scratch the cat's back. Don't hot-plug it into a live circuit.

Other's may have sadder stories, but they seem to me to be pretty robust devices, and other than keeping them in anti-static foam until I use them, I don't do anything special. If to be used for commercial purposes, or where failure might harm a person or property, more precautions would be in order.
 

manuka

Senior Member
This is a pretty standard alert so don't panic! ESD is/was very much an industry woe, and covering themselves may well be an issue. Such simple precautions as grounding yourself, tools & workbench surfaces (+ storing ICs in static proof packages/Al foil etc) are usually all that's needed at a home level. 30,000V CRT screens at nearby desktops were once part of the problem, but their passing in favour of LCDs has further eased ESD concerns. However DON'T GET SLAP DASH or you'll maybe find out the hard way about ESD- so called "walking wounded" chips with erratic & degraded performance can be a nightmare to identify & fault find.

FWIW I've dealt with perhaps 1000s of PICAXEs,mostly in education, & haven't lost a single one yet to ANY cause. These little darlings are almost bullet proof. Even 08Ms too hot to touch (following wiring blunders) performed OK once cooled & corrected. This is in stark contrast to nameless ICs I worked with in the '80s & '90s, some of which would go belly up at a mere glance. With the then higher cost of ICs we took more robust precautions than now as well... Stan.
 
Last edited:

Dippy

Moderator
I agree with Stan (again!).

If you wish to be thorough you can get, quite cheaply, a wrist strap thing that can ground you. (With great care, you could make your own).
I have a bench PSU (plugged in permanently) and usually just touch the Earth terminal before fiddling. I have never, ever zapped a PIC/PICAXE/FET/anything.
As said though, don't be cocky and be aware of what you are doing to the cat.
 

BeanieBots

Moderator
Most devices these days are pretty tough and that includes PIC micros.
The one to be careful with are 4000 series CMOS. These can be ESD damaged just by looking at them.

The device which catches many out because they don't associate static damage with them is the new breed of high power LEDs. These REALLY ARE prone to ESD damage. Those such as the LUXEONs which have been pre-fitted to heatsinking boards also have ESD protection fitted.
 
Top