graduating from the picaxe

vshortt

Senior Member
I will most likely never stop using picaxes for various projects, but being what they are, they have many limitations, so I am looking to graduate from the picaxce to a more powerfull microcontroller.

I would be interested in hearing recommendations on what people think the next step should be.

I'm thinking about the 32bit series of PIC controllers my Micrchip, but I have never programmed in C before. I don't think it would be that hard, but I would love to find a more powerfull microcontroller that can be programmed in basic.

Does anyone have any suggestions? I love the idea of having a RTC, ethernet, USB and other toys built right into the controller not to mention the ability to write DOS readable files to things such as a micro-SD card easily.

I'd love to hear opinions from those that have experience with the "next step" from the Picaxe. I am definatley computer and electronics literate, so new programming languages and various programming circuits don't intimidate me in the least (If anything, I view them as a challenge!)
 

Jaguarjoe

Senior Member
If you want horsepower and still program in Basic look at AVR's and BASCOM. There's a free 2CV version and a Veyron SS version for not too much money.
 
Last edited:

matherp

Senior Member
vshortt

Have a serious look at the open source Arduino. It extends the scope beyond picaxe in various ways (compiled speed + much better arithmetic including floating point, ethernet connectivity via a "shield", etc.) and has a strong user community with lots of "libraries" of code available. Hardware is cheap and the development environment (c/c++ ish) is free. Homebuilt boards are nearly as easy as picaxe - resonator, chip, and a couple of capacitors. Download is via a serial interface using the chips onboard bootloader (unlike picaxe the bootloader can be programmed into a native AVR chip but the "base " chip is a 28 pin device and costs about £4 in the UK so more expensive and physically larger than most picaxe). If you need lots of code you can program direct without the need for the bootloader and even use the 128k Arduino Mega which with compiled code allows for very significant programs.

What you don't get is an ide that allows you to simulate the operation of the code - all debugging has to be done in hardware. As I'm very old and started programming before such facilities were available this doesn't worry me personally and I never use this facility on the picaxe anyway but clearly from the posts on this forum others do! Also, there is nothing equivalent to the wonderful 08M (and the desperately awaited 14M2) so it can't replace picaxe for lower end projects and the "entry" cost is higher.

Use of external hardware like i2c on the Arduino isn't quite as simple as picaxe but still very easy. This area is the problem to me with using native PICs which I also use with the sourceboost C compiler. More than half the code ends up being associated with managing the external hardware and debugging this is a pain - the joy of using picaxe!

Best regards

Peter
 
Last edited:

Pauldesign

Senior Member
Hey Vshortt,

Like everything in life, there are always pros and cons. As there will always be a place for analog solid state devices, there will always be a place for (liquid devices) any micro controller and also, there will always be trade off as to ease of use, cost, functions, applications, support, specifications, availability and what have u.

In my opinion there is no better microcontroller over the other as it all depends on the user and its use. Well if you need speed, complexity and high end apps, then i reckon you go gaseous devices (FPGA) using HDLs not pics.

PICAXE was aimed for educations but it popularity made it to go commercial and who knows what will happen next to the wonder chip.

Just my thoughts.
 

womai

Senior Member
If you want built-in USB, then the PIC18F2550 or 4550 is a good place to start. There is a number of Basic compilers out for PIC12F / 16F / 18F. Mikroelektronika's Mikrobasic is just one example. Pick the one you like - most have code-size limited demos available. Or if you need some more processing power try the PIC24 or dsPIC series (there is a MikroE Basic compiler for these, too).

Basic is not as widespread in the 32-bit arena since those devices are mainly geared towards professional, high-end applications where C rules supreme. I seriously doubt you'll need 32-bit processing power for any but very few projects.

Wolfgang
 

manuka

Senior Member
The Arduino clan will no doubt be suitable,but there are now so many variations that you may well become bewildered. Some (for Rev.Ed's benefit we'll call them Axxxxxx or @#&*@^*!) are quite costly too. It also increasingly irritates me to see these $$($) Axxxxx "aircraft carrier" platforms being used for the sort of near trivial tasks that a $ small footprint PICAXE would better suit. What's wrong with the barebones "Preduino" approach shown below I say!

Nah- just teasing, as this is the top side of an extremely nifty "Behindduino" I'd (predictably) also considered for PICAXE layouts. Perhaps do some Googling & get back to us with your opinions and experiences. Stan.
 

Attachments

Last edited:

Dippy

Moderator
Sorry, other than the modularity and source of snippets I cannot bring myself to a climax re Arduino.

But then again, I'm always thinking of unit cost versus capital set up.
However, the format is amazingly successful - mainly because 99% of the community can pinch software from the intelligent 1% :)

I tend to programme from scratch so my bias is not the same as others.


My recommendation for the next stage up would be PIC + Proton* + programmer.
* PICBASIC Pro option
I don't like Mikroelektronika products (sorry, Wolfy).

Proton is very similar syntactically to PICAXE BASIC and Stamp BASIC.
Maybe it was designed to be?
The Forum is well populated.

A limited version of Proton can be purchased under the 'Amicus' heading from Farnell or direct.
I have no experience of it so I can't recommend or poo-poo.

There is one other BASIC compiler that makes all others (and C) look a bit limp.
I shan't mention it as it is limited to PIC18Fs and hard to learn.
But, to paraphrase a song, it is "better than all the rest".



Join the C men.
If you want to go for C then go head-first to Microchip for starters.
I cut my C teeth using MikroElektronika.


Don't imagine C is magic.
There are occasional mistakes and typoes in Microchip and Mikroelektronika products, and when you have mistakes in M'chip def files it can be annoying.
There are mistakes and errata in everything.
Don't assume you can just sit back and have an easy ride.


Don't be overwhelmed by C.
It has a lot of cunning tricks and shorthands, but just why so many schoolboys have to reach for the box of Kleenex when C is mentioned I really don't understand.

On the other hand, IF you learn C then you have the tools to programme just about ANY micro on the market.
That may be good for your future plans.


My word of warning.
I have never used PIC32 but I have used dsPICs.
When using ANY compiler you WILL need a good working knowledge of the underlying PIC.
This means a knowledge of the nitty-gritty of registers, interrupts.
The dsPIC has many more features than a PIC.
And a PIC has enough for most people.
You will NOT learn it in a month.
By all means have a go. It's an education and a challenge.
You will have to open your wallet.

Summary.
I just ask you to think carefully first - you will not get the newboy Forum support that you do in this Forum.
If you are really good at PICAXE BASIC then the transition will be easier.
If you struggle here then you'll really struggle with compilers.
 

MFB

Senior Member
The Processing language

I think matherp has pretty much covered the advantages of the Arduino for those high-end applications, whilst making a good case for retaining PICAXE’s for the rest. One further advantage of the Arduino language is the an almost identical free version exists for the PC, its called Processing. There are many advantages in learning and using of a common language for both the embedded processor and the PC parts of a project.
 

kranenborg

Senior Member
Like others have replied, there is no single best system, so I can only mention the platform that I am using in parallel with picaxe, namely ZBASIC (www.zbasic.net). I wanted to stick to the BASIC language but have a much more advanced one (surpassing BASCOM, PBASIC etc., I really wanted a deluxe version of the language implementation), and needed a compiler for speed for a particular application.

ZBASIC provides for that in that it implements all of the C functionality in BASIC, and in addition to that has a large library of functions based on a multitasking kernel. It supports full Object Orientation as well. The ZBASIC compiler optimizes and translates to C, which is then compiled via gcc to Atmel AVR machine code (which implies that you can inline C and ASM).

However, their platform requires some maturity in programming and their Forum is not nearly as active as the picaxe forum, the latter being of interest to anyone from the complete novice up to the professional. Furthermore I in the end frequently revert to a picaxe for my projects, because nothing beats a picaxe in simplicity with functions like IRIN and SERVO as well as the very favourable small size of most picaxe chips.

For what it is worth,
Jurjen
 

vshortt

Senior Member
Thank you all for the great replies!

I agree with everyone in that the picaxe will always have a place in my application "tool chest" - and I have some experience with C - considering that it's the language that you most commonly find in the professional arena, I'm really leaning towards the microchips pic's - perhaps toning it down a bit and starting with a smaller version rather than jumping head-first into the 32 bit PIC's.

I'm really interested in expanding my "tool chest" - you know the old saying: "When the only tool you have is a hammer, everything starts to look like a nail."

I'll check out what everyone has brought up and let you know what direction I opted to go
 

MartinM57

Moderator
tinyAVRs or megaAVRs programmed via AVR Dragon or STK500 and C (gcc, good for nothing) or assembler with AVR Studio 4...and the AVRFreaks forum is pretty good unless you're a complete and absolute numpty
 

womai

Senior Member
One interesting observation: People assume that the Picaxe is geared towards beginners and the PIC (and Atmel, TI, ...) is for advanced users. But that's not the impression I get from the respective webforums. So far the Picaxe forum seems to attract much more technically savvy users - the quality and technical level of responses tends to be quite a bit higher than on e.g. the Microchip PIC forum or Mikroelektronika's forums. Not to mention this is by far the friendliest forum I have run across.
 

MartinM57

Moderator
The thing I've seen on a lot of of forums is that a lot of (incorrect) advice is freely given when the poster of that advice clearly hasn't got a clue on what he/she is talking about.

That generally doesn't apply here (or AVRFreaks IMHO) ;)

<group hug>....we're all the best of mates here
 

Dippy

Moderator
Good luck with your research Vshortt.

Though , I'm a little confused by:
Post#1
"I have never programmed in C before."
and
Post#9
"and I have some experience with C"
Ummm... maybe you mean you've looked at someone's C code but never tried it? Never mind, doesn't matter. ;)

I know what you mean Wolfgang, especially with X2s, but with Compilers you (should) have control over just about every aspect of the PIC's guts (including fuses) and on a wider range of devices. Most Pros and serious hobbyists need that option.

And this is definitely the friendliest Forum I've seen. Excluding M.E's Forum most others are populated by 'serious' people who often splutter when a novice question comes along. And every Forum has some Fanies.
 

Pauldesign

Senior Member
People assume that the Picaxe is geared towards beginners
It seems as if we're mixing this debates between microcontrollers and the programming languages used and which are of course complementary to each other and to add to the statement in quote; it's because of it simplicity of use and applications which is why non of such competing product can't match PICAXE in such instances and hence, it's being labeled for beginners but at the end of the day, the question is: you're being faced with problems and you have to solve them some how; what can you use to get the job done ASAP and with little cost and complications?

Most people think, learning something complex makes them advanced but how much does it worth or what is the value, if the complex something can be done by a beginner and even done better.

Well, an analogy is does it make sense buying a Ferari Car if your freeway allows only 120 Km/h or using a Hummer car for public transport or even buying a car (even if is the VW beetle) to be used within walking distance.

Please don't ask me how much is working distance, as that depends on the individual. :D
 

Dippy

Moderator
Well, vshortt did bring up the subject of microcontrollers and C and BASIC... so microcontrollers and programming languages were indicated in Post#1.

AND with most non-PIC micros you HAVE to programme in C or a derivative of C. So , in most cases it's not merely 'complementary', but mandatory/oligatory.

Vshortt also indicated that he would like to graduate (i.e. move upwards) from PICAXE. The (my) assumption is that he has plans for projects a little beyond PICAXE.


I fully understand you rpoint Paul , (basically 'why use a sledgehammer to crack a walnut') , but that's not the point that vshortt is making.

On a slight aside, I would have thought MOST people assume that the Picaxe is geared towards beginners.
It is marketed as an educational and hobby product.
It does (thank goodness) most of the hard work for you.
It saves you having to wrestle with PIC nitty-gritty.
You don't have to buy a hardware programmer.
So, yes, obviously it is geared towards beginners.
- but that does not mean that it can't be used in sophisticated projects.
 

vshortt

Senior Member
Dippy, I apologize for the conflicting statements. let me clarify:

I have some programming experience in C and C#, but not in the realm of PIC's, my experience has been writing software for desktop PC's and the like.

Just like the BASIC used to program a picaxe isn't necessarily a full-blown version of visual Basic or even GW-BASIC or QBasic (There's a blast from the past!)

I expect the version of C used to program other PIC's may not be a fully version either. One of the tricks is learning what commands work and what commands don't (or work differently) when programming a microcontroller.

One of the big issues I have with the picaxe is its' lack of FPU support.. constantly having to massage numbers to get rid of decimals, then massage them again to get the decimal back out is a real pain. My guess is that this is probably an issue I will have to deal with on many other platforms, but I'm not sure yet.

The Picaxe will always have a place in my electronics arsenal. It can do about 80% of what I want to do and it does it very well, so I'm not complaining.

But you have the idea right, I want to "move up" in complexity. The Picaxe is a great platform to get started with for anyone interested in learning to program micro controllers - it was my first platform - But it does have inherent limitations.

I'd love to see a second generation of picaxes that cater to the more advanced users with built-in features that I mentioned before (ethernet, USB, etc..) but something tells me that isn't going to happen.
 

Dippy

Moderator
You can get demo versions of BASIC , PASCAL, C compilers of a number of 'makes'.

I merely suggested Proton/PICABSICPro as they are close to PICAXE BASIC and use PICs with which you are familiar.

So, have a go. Search on compilers.
Download and look at their Help files.
Everyone has a 'My Favourite' and as there are SO many different shapes and sizes of Micro I don't think you'll achieve much with a general question here.

Spec your task, spec the Micro, check the compiler options, check the price, sit down, dig out wallet, panic and bingo! Job done.


Good luck
 

KeithRB

Senior Member
Dippy, I apologize for the conflicting statements. let me clarify:

I expect the version of C used to program other PIC's may not be a fully version either. One of the tricks is learning what commands work and what commands don't (or work differently) when programming a microcontroller.

.
The C language will be complete, after all, a PIC is probably on par with the PDP-8's that ran the first C compilers. However, I am sure that the library functionality - which is technically part of ANSI C - is not all there.
 

graynomad

Senior Member
The Arduino bootloader and core libraries have been ported to about 20 chips, from the huge 100-pin Mega2560 to the 8-pin Tiny85, so in theory you can use a chip that suits the application.

If you use the Arduino IDE there are libraries for most things including i2c, SPI, LCD screens etc. so you don't really have to know much about the underlying hardware. The Arduino IDE is however...how should I put this...crap!

The next step is to use the (free) AVR Studio IDE, this has an simulator and all the things you would expect in a full-featured IDE. And did I mention it's free. This is what I use, there are possibly better tools as well (like Codevison) but they aren't free.

From what I've seen people tend to use an official Arduino as a prototyping tool, just plug in a USB cable and away you go, much like Picaxe.

Then when things are working and you want to make a permanent circuit just burn the code into a stand-alone chip.

The other thing in Arduino's favour is the community, like this really, friendly and hugely knowlegable. Hang around the forum for a while.

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl
 

Dippy

Moderator
There will always be small differences in any manufacturer's implementation of C (or any common language).
There will be different libraries/includes etc.
There will be differences in how the library function is called/executed and included into the compiled code.
The fundamentals will be the same nominally if they conform to the standard, but there are often subtle differences which are down to the compiler author(s).

However, none of this is of interest to the novice writer.


To paraphrase an old TV ad for cream cakes: "Don't talk ... eat!" i.e. stop dithering and get on with something. :)
Anyone can get demo versions of all/most of these compilers.
Get a version and have a go. Check it out. Suffer the pains. Look at the costs/effort.

If it suits you, and suits your desired micro and suits the app (and your wallet) then get it.
BUT, without any doubt, if you envisage a 'future' in micros then learn C.


I'm getting the new FiveTran compiler for PIC32s. It looks good.
 

MartinM57

Moderator
Most (all?) microntroller C compilers are ANSI-C based for the 'standard' parts of the language:
- operators
- functions/ subroutines (pass by value/ref etc)
- arrays etc
but tend to have their own USPs for how they deal with the microcontroller environment:
- datatypes - size of int, float etc
- placement of fixed data in flash or in EEPROM (where and when it's put there)
- a 'main' program that never returns
- interrupts
- code optimisation (debugging a program at the C level when the compiler has decided to not actually include that line of code in the object code is no fun - been there)
- etc

To grow up into serious C programming on a microcontroller requires a good appreciation of all these things - which is why I can't program in C to save my life and do everything in AVR assembler where I have complete control. It's a bit slow sometimes, but you get the hang of it after a long time ;)
 

graynomad

Senior Member
It's a real gotcha to have a compiler optomize away some code and you can't figure why the simulator refuses to execute that line or the hardware doesn't behave as you would expect.

I think this normally happens when you're trying something new with bogus code just to see if it works. An example might be

Code:
while (1) { 
    for (x = 0; x < 1000000; x++) {}; // delay loop
    toggle_pin();
}
You just want to see a pin toggling and expect that to happen after a delay loop with 1,000,000 iterations and produce a frequency of say a kHz or so, but you get a few MHz instead and it doesn't matter what number you use in the for loop the pin toggles at the same frequency.

The compiler has decided that the for loop actually doesn't do anything, so it got rid of it.

There's a couple of ways around this but it's a real puzzle when you start.
 

moxhamj

New Member
My excuse is that Dippy dared me...

This is a screenshot of a propeller IDE for C (written in... vb.net!) We have ones for Basic and Fortran and Forth and a variety of assembly languages, all using the same hardware. All code and board designs are open source.

Board specs = onboard VGA display driver, SD card file interface (fat32), two serial ports, keyboard and a local 20x4 LCD display. 512k of ram. A new board design adds a parallel port and a mouse.

I think there is very much a place for picaxes for small projects, and then for bigger ones (ie code that is more than a few thousand lines), the propeller is a good "next micro". I particularly like the ability to take 8 general pins and use them to drive a VGA display, as smaller VGA displays are giveaway items these days. Even the LCD ones.
 

Attachments

Last edited:

Dippy

Moderator
Time to change the title to "I'm going to show off" :)

FAT32?
I hope you have the licence from the Big Boy for integration and are members of the SD Card association.
 

graynomad

Senior Member
Propellers have always interested me, but I just read this on the Parallax site

The Propeller chip can run on its own with a power supply, internal clock and using RAM for code storage. Add an external EEPROM for non-volatile code storage.
Does this mean that you need an external EEPROM for a stand-alone gadget?

If so, does the chip boot directly from the EEPROM?
 

moxhamj

New Member
Yes you do need an external eeprom for a minimum circuit on the propeller. Also the download circuit is a bit more complex than a picaxe's - it is a few transistors or a max232. And you need an external crystal. So not quite as simple as a picaxe.
 

cdngunner

Senior Member
Personally I am in the midsts of teaching myself C++ because I am going to try to program the texas Instrument 16 bit MCUs. Apparently everything you learn and do on their lower models will transfer into their Stelaris ARMs (apparently).

Thats my goal anyways, we'll see if I can make it.........
 

Marcwolf

Senior Member
Ardunio's are nice, but if want some more intensive processing capabity then look at the FEZ range. http://www.tinyclr.com

These are 72mhz ARM processors that run the dotNET Micro Framework so you can program in C# at a very high level

The software is free. Just download the Express C# from Microfoft, load the libraries from TinyCLR, plug in the board using a USB and your up and running.

Boards range from the mini for $43AUD to the Panda $97AUD.
This link shows the difference between the various boards
http://www.tinyclr.com/compare/

The forum there is excellent.

Hope this helps
Dave
 

Pauldesign

Senior Member
Well, there are no better micro-controller or programming languages over the other; it just depends on the user and the use and because any individual have different mindset, taste, thought and brain power.

No micro controller and or programming language will be a one-stop shop and that is why there are always mixed products used in a design to balance the trade offs in them.

Just like everything in life, there are endless varieties and products; which everybody wish to have, learn and use; provided time, money, availability and brain power is not an issue and by the time the individual is done with all, a new one will pop out...

I'll say, since life is short, it's good to try and experiment the alternatives but is better to stick to one and best to know it to the fullness.

At the end of the day, specialist makes more money than jack of all trade who are master of none. :)
 

Dippy

Moderator
Oh Lord, is this thread still going round in circles?
See you on the dark side. I'll be the one wearing an anorak.:rolleyes:
 

Dippy

Moderator
A huge tangent ... not that it matters.

I am a terrible hoarder.
I inherited it from my father and kept hold of it.
Haha - you won't get quality gags like that on the TV. Woody Allen eat your heart out.
Anyway, I found some old Psion brochures.
Old Series 3 , series 5 and HC from 1992 to 1995.
They mentioned a language called OPL.
Did that die with the Psion brand or did it morph into something else?
 

hippy

Ex-Staff (retired)
OPL continued with the development of EPOC and Symbian OS and can be found in some Nokia mobiles but Symbian then dropped support for it.

OPL was a Basic-style language, a bit quirky like most home computer implementations.
 

Tooms

Member
Ardunio's are nice, but if want some more intensive processing capabity then look at the FEZ range. http://www.tinyclr.com

These are 72mhz ARM processors that run the dotNET Micro Framework so you can program in C# at a very high level

The software is free. Just download the Express C# from Microfoft, load the libraries from TinyCLR, plug in the board using a USB and your up and running.
And a spinoff from the FEZ is the NetDuino there is design to be same formfaktor as Arduino, but i using .Net micro framework.

http://www.netduino.com/

There are using C# now to code but they are talking about adding the VB.net.


Seems very power full from what i can see, has not tryed them jet.
 

hippy

Ex-Staff (retired)
I've got a Psion II which was until recently running a telephone/address database, alarm clock, stopwatch, even a PICAXE terminal emulator, all home-written OPL, and that kept running for 3 years on one PP3 9V battery. Their hallmark was very conservative consumption when running, almost none when idle.

Write source in a text file, download to Psion II, compile then run as needed. Must buy a new battery, find the source code and try and remember how to download!
 

Dippy

Moderator
Excellent.
Just think, a modern device would have a custom battery that would cost £50 or unobtainable.
 
Top