Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 18:42 29 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PICAXE vs Arduino vs MicroMite...

     Page 3 of 5    
Author Message
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3817
Posted: 01:08am 01 Mar 2014
Copy link to clipboard 
Print this post

Compiled C or C++ will of course be faster than semi-compiled/semi-interpreted BASIC.

I think the point is that a fair number of people don't want to write C or C++ but are happy to write BASIC, and the speed loss is acceptable. (And if they wanted to wiggle a pin very fast I guess they'd use a PWM output.)

I might point out that the equivalent code for a Pinguino (same code, no changes needed) runs faster still - but again it's C/C++.

It's even faster on RPi (700MHz)!

John
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 03:13am 01 Mar 2014
Copy link to clipboard 
Print this post

Corrections required:

@JohnL, for Micromite the code generated is in 16bits mode - but the results are as expected.

@JohnS, you really need to specify which Pinguino. Anyway, if is about 8bit Pinguino, the code generated is pure C. I can do faster on an Arduino board using my collection of libraries written in C language (well, you can equal an Arduino with a PIC18F4xK22 clocked at 16MIPS - Pinguino project does not have such a microcontroller in their collection but I'm working on one). Edited by vasi 2014-03-02
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3817
Posted: 03:58am 01 Mar 2014
Copy link to clipboard 
Print this post

Sorry, I meant PIC32.

May as well use one of the STM32 chips, though. Very cheap.

The point is still that some people want Basic, they don't want C/C++. They don't want a whole bunch of other languages, either. They want Basic. I'm sure they'd be happy with it on an ARM-based chip, of whatever make/speed.

If Microchip don't make the PIC32MZ chips much cheaper than now then I suspect many people will stay away due to cost.

John
 
elproducts

Senior Member

Joined: 19/06/2011
Location: United States
Posts: 282
Posted: 10:46am 01 Mar 2014
Copy link to clipboard 
Print this post

  JohnL said  
Arduino compiled Arduino C++ code (8 bit, 16Mhz clock processor)

digitalWrite(pin, HIGH);
digitalWrite(pin, LOW);
4 micro seconds.


Ok,
You want Speed (and some requested BASIC) ?

PIC16F886 compiled in Great Cow Basic code (8 bit, 4 Mhz internal clock processor)

SET PORTB.5 ON
SET PORTB.5 OFF

1 micro second.


It's because Great Cow Basic compiler produces pure assembly code.
And it runs 4 times faster at 1/4 th the oscillator so its 16 times faster than Arduino.

Plus you have access to all the I/O and peripherals on the PIC and not just one 28 pin micro, I mean a whole lot of them from 8 pin to 64 pin and all sizes of memory up to 64K and lot of features. Basically any 10F to 18F PIC. It even has some support for AVR.

And a PIC16F886 is under $2 and requires no oscillator. Some devices under $1.

Great Cow Basic Main Site

My Great Cow Basic site

And the compiler is free and open source. Plus the pure assembly code produced can be loaded into MPLAB directly and you can debug your code and step one command at a time and set breakpoints.


Despite all this, I still think MicroMite is awesome.

www.elproducts.com
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 11:51am 01 Mar 2014
Copy link to clipboard 
Print this post

And... you can use Great Cow Basic for Arduino to generate code at even greater speed .

@elproducts, I saw your site a while ago. You are doing a great job in promoting GCB. Hopefully, someone will pic the development again, as there is still a lot to do in supporting ATmega and ATtiny.
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 12:00pm 01 Mar 2014
Copy link to clipboard 
Print this post

Oops! These really are news!

[quote]14/2/2014
A new update for Great Cow Graphical BASIC website. A release is in process. Watch this space. The release includes several bug fixes, new help files and new features.[/quote]

Hmmm... I thought is about the compiler...Edited by vasi 2014-03-02
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
marcwolf

Senior Member

Joined: 08/06/2009
Location: Australia
Posts: 119
Posted: 02:06pm 01 Mar 2014
Copy link to clipboard 
Print this post

Although I do like the PicAxe for very simple projects i.e. My electric gate controller and my dual water-tank level meter - there is one issue that has always been a problem for me.

You cannot run the Servo command and the Serial at the same time. This precludes making small servo controllers that sit on a serial bus and respond to a master command from somewhere.

Several of my projects involve animatronics and it's been a big decision whether to either have all the servo's running from one point (Lynxmotion SCC-32) or to use a more distributed system where groups of servo's are controlled by their own small controller.

Yes - there is I2C but that means a minimum of an 18X to make a slave.

Great Cow looks interesting though. I'll keep it in mind as an additional utility in my 'box of tricks'

Dave

Coding Coding Coding..
Keep those keyboards coding..
RAW CODE!!!!!
 
JohnL
Senior Member

Joined: 10/01/2014
Location: Seychelles
Posts: 128
Posted: 02:55pm 01 Mar 2014
Copy link to clipboard 
Print this post

  Quote  SET PORTB.5 ON
SET PORTB.5 OFF

1 micro second.


Not fair comparison.
You control port pins directly, additional code and controller datasheet required to set up port. Same can be done with C with same or better result.

Arduino DigitalWrite is DIRECTLY comparable to Micromite basic.

GCBasic implementation is relatively limited, similar to other old Integer Basics, PicBasic etc.
No Floating point (Conveniently not mentioned in general description?), No Strings, Very limited libraries etc.
Great for blinking leds and simple bit bangginig on 8 bit controllers.
Needs lot more time, maturity and support.

We are comparing hobby type micro controllers in the same class, Not M4 Arm or Core7 x86 etc.

Arduino Pro Mini is a fully assembled board for less than $3. Ready to use.
Programmed in easy Arduino C++ language, easier than ANSI C. Arguably not more difficult than Basic. Depends on what people consider easy or hard. Syntax has similarities. Basic doesn't have {};. C++ doesn't have Endif, Next etc.
People that haven't spent reasonable time or effort programming in both Basic and C should not get involved in comparing Basic and C.

Fact, nothing comes close to Arduino functions and libraries.
Fact, nothing comes close to Arduino Information, Forums, Tutorials, Support etc.

Most of the people here are hard core basic fan boys. This discussion should not be about irrational emotions or converting people from basic to C or the other way around.

This discussion should provide facts and comparisons so that people looking at different micro controller options can make informed decisions.














Edited by JohnL 2014-03-03
 
akashh
Senior Member

Joined: 19/01/2014
Location: India
Posts: 115
Posted: 03:49pm 01 Mar 2014
Copy link to clipboard 
Print this post

Programming languages and productivity are largely a matter of choice and experience. I have seen some code examples on this site written in basic that are compact and well written, and get the job done well, but I can think of C code that rivals it in clarity and simplicity. Many people have an inexplicable phobia of the C language - I was one of them and believed it was extremely difficult to learn so I stuck with basic and pascal. Then when the Internet took off I learned JavaScript and PHP, no problems there. I was still weary of C. But then when I started embedded development using PIC Simulator IDE (which is a really great tool for any of you who have not used it, it allows you to write in Basic and simulate your entire app, including LCD, pwm, serial, and it compiles to native code) I quickly realised that I needed more control for the types of app I wanted to develop so I was forced to start learning C. I quickly realised that C is easy! It's just a mindset and takes a little practice.
What *is* essential in any language is excellent documentation and clear error reporting. I love the mplabx IDE that highlights my errors in red as I type them, it's extremely intuitive and saves compile time.
In the Wattmon I use PHP because I find it easy to learn, it's like c but without the pointers. I have also found an open source editor that highlights the errors in the syntax as you type, making it difficult to mess up!
Sorry for the ramble, but the previous post touched a couple of points I am opinionated about!
Akash
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 04:03pm 01 Mar 2014
Copy link to clipboard 
Print this post

  akashh said  Programming languages and productivity are largely a matter of choice and experience.


With some of us on TBS, the years are not really on our side and it becomes a case of "old dogs and new tricks".

For ease of getting into, one could liken C and its derivatives to assembly. They both (until you get used to them) require a fair degree of abstract thinking.

As you say, documentation and/or commenting is very important particularly with assembly. Once you have grasped the "look" of C, a well written programme can almost need no explanation other than a brief overview of the code block/s to follow.

The advantage of Basic or Pascal (but not limited to)is that they are written almost in plain English. (ok for us of British decent). C transcends nationalities.
David M.
 
akashh
Senior Member

Joined: 19/01/2014
Location: India
Posts: 115
Posted: 04:15pm 01 Mar 2014
Copy link to clipboard 
Print this post

  Quote  For ease of getting into, one could liken C and its derivatives to assembly. They both (until you get used to them) require a fair degree of abstract thinking.


David, I would have to disagree with you there. Assembly is for nuts. Normal people can use C! If you really think about it, other than a couple of special tags such as {} and a ; at the end of a line, many languages share similarities. Java, JavaScript, php and c are so similar I guess partly because they are derived from C but also because as you put it so well:
  Quote  C transcends nationalities

Programming languages should be universally readable, and although one would always be require to understand basic English words like for, if and while, most of the syntax is totally language-independent.

I can relate to the fact that as one gets older it is harder to pick up new things, but if you spend a few days playing with some sample apps in mplab I am sure that you will find it rewarding!

Akash
 
marcwolf

Senior Member

Joined: 08/06/2009
Location: Australia
Posts: 119
Posted: 04:41pm 01 Mar 2014
Copy link to clipboard 
Print this post

As a professional programmer with more than 36 years under my belt I'll make some observations here.

Learning a different computer language is actually easier than learning a different human language.

Lets break computer languages down into their essential constructs.

Definition Defining your variables taking into account whether there are Global, Local, Static, or Constants

Blocking Main, Setup or how the code is entered when first run

Calls How outside program segments are accessed.

Branching How the If Then Else statements are handled

Looping How repetitive actions are handled

Maths Obvious..

String and Characters Obvious

Storage How short, medium and Long term storage is handled

Special Specialized functions dependent on hardware i.e. Serial, I2C, Servo

Compartment and Reuse How blocks of code can be isolated from each other and reused multiple times.


From here it is just finding the correct commands and plugging them in.

I have had experience in over 40 different languages now.. Many of them defunct - but the basis of all computer languages are as above.

Just some observation from a long time computer fellow... Who is still learning and moving forward.
Dave


Coding Coding Coding..
Keep those keyboards coding..
RAW CODE!!!!!
 
Ray B
Senior Member

Joined: 16/02/2007
Location: Australia
Posts: 219
Posted: 05:27pm 01 Mar 2014
Copy link to clipboard 
Print this post

So the debate goes on....

elproducts introduced a interesting version of Basic being "Great Cow Basic" which he describes along with his new product CHIPINO which appears to be a PIC version of ARDUINO but can be programmed in either CowBasic or C. This may be a good stepping stone for those out there who want to interface to the real world
BUT when you go to the store at http://www.howtronics.com/ your paying top dollar for the hardware with an assembled CHIPINO costing $30 (plus freight) compared to legal ARDUINO UNO clone off ebay for $12 and then there are the UNO little brother assembled boards for $3.

On a hardware cost basis, for those not opposed to C I'd recommend going with Arduino especially with the exceptional forum online support.

For PC Windows Basic programming I still go back to Liberty Basic which works well, there is a free version called JustBasic.

Cheers
RayB from Perth WA
 
elproducts

Senior Member

Joined: 19/06/2011
Location: United States
Posts: 282
Posted: 07:04pm 01 Mar 2014
Copy link to clipboard 
Print this post

  JohnL said  
  Quote  SET PORTB.5 ON
SET PORTB.5 OFF

1 micro second.


Not fair comparison.
You control port pins directly, additional code and controller datasheet required to set up port. Same can be done with C with same or better result.

Arduino DigitalWrite is DIRECTLY comparable to Micromite basic.

GCBasic implementation is relatively limited, similar to other old Integer Basics, PicBasic etc.
No Floating point (Conveniently not mentioned in general description?), No Strings, Very limited libraries etc.
Great for blinking leds and simple bit bangginig on 8 bit controllers.
Needs lot more time, maturity and support.

We are comparing hobby type micro controllers in the same class, Not M4 Arm or Core7 x86 etc.




It is fair if you really check it out before assuming. Great Cow Basic handles all the register setup (TRIS and I/O setup) along with configurations and all the other stuff hidden by the Arduino IDE. It does it in an automatic include file name "initsys". I could have used SET 1 HIGH if I used the default pin mapping (same as Arduino).
Same resultant Assembly code.
It just does it more efficiently than Arduino.

But it ironic that you claim this was unfair when you thought it was fair to compare compiled C code to interpreted BASIC in the Micromite.

  JohnL said  
Arduino Pro Mini is a fully assembled board for less than $3. Ready to use.
Programmed in easy Arduino C++ language, easier than ANSI C. Arguably not more difficult than Basic. Depends on what people consider easy or hard. Syntax has similarities. Basic doesn't have {};. C++ doesn't have Endif, Next etc.
People that haven't spent reasonable time or effort programming in both Basic and C should not get involved in comparing Basic and C.



I agree. But yet you did.
But since I've written books, articles and taught classes on C and Basic I am qualified.
I've taught 1000's how to program through my books and some directly in class.
Learning Compiled Basic is a great step towards learning compiled C.
I've taught with BASIC Stamp, BASIC Atom, Java Stamp, and most other hobbyist platforms before Arduino.
And now Micromite offers a chance to learn even easier with interpreted BASIC that only require a VT100 terminal.

And the point of the chip I mentioned for less that $2 is you don't need a module. The GCB defaults to setting the PIC to internal MCLR pullup and internal oscillator so all you need is power and ground. No board required other than the same breadboard your $3 Arduino needs. But Arduino needs an oscillator and pull-up so a board is required. And I've bought some of those low cost China Arduinos. After waiting a month to get them, half didn't work or had so many bad solder joints they were practically disposable.

I prefer the quality designs from Sparkfun or Adafruit but then it will cost more for sure.

  JohnL said  

Fact, nothing comes close to Arduino functions and libraries.
Fact, nothing comes close to Arduino Information, Forums, Tutorials, Support etc.

Most of the people here are hard core basic fan boys. This discussion should not be about irrational emotions or converting people from basic to C or the other way around.

This discussion should provide facts and comparisons so that people looking at different micro controller options can make informed decisions.



Did you even look at the library of built in functions for Great Cow Basic?
SPI, I2C, LCD, Graphical LCD, Read Keypad, Read PS/2 Keyboard, PWM, 7-segment Display, Sound, Interupts, Timers and lots of string manipulation along with arrays and tables.

So there is lots in there and its been around for a lot longer than Arduino.

No floating point I agree but everything has it advantages and disadvantages. But your main argument was speed of Arduino vs Micromite.

Arduino does have a lot of tutorials but with all the variations of Arduino, Duemilnove, Uno, Uno R3, Leonardo, DUE, IDE 1.0, IDE 1.5, expanded headers, etc. It can get confusing for a beginner.

I'm doing my part to help with the documentation for Great Cow Basic just like all the people who helped make all that Arduino support you rely on.


Fact is you came on here to show how great Arduino was compared to Micromite and it didn't stick. Micromite has a place for many of the users here and its getting better everyday.
So rather than just show the Micromite speed why not stick around and grab a Micromite and join the fun and help make it better.
















www.elproducts.com
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 04:01am 02 Mar 2014
Copy link to clipboard 
Print this post

"Micromite will... do here what Picaxe did there, I guess..."

"Arduino - probably, Android's wife ?!"

"Picaxe mostly used by dwarfs and gnomes. Or it was pickaxe?"



Edited by vasi 2014-03-03
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9310
Posted: 10:41am 05 Mar 2014
Copy link to clipboard 
Print this post

One thing I DO like much about PICAXE, is it's ability with the M2 series of chips, for just about any pin to do anything you want. With a SMD board, this can make all the difference between having to fight the layout to get tracks to specific pins, or just routing the tracks to the nearest and easiest to get at pin.

Really useful.

Only really and issue with serial and ADC, but still makes life that much easier.
Smoke makes things work. When the smoke gets out, it stops!
 
Lou

Senior Member

Joined: 01/02/2014
Location: United States
Posts: 229
Posted: 11:24am 05 Mar 2014
Copy link to clipboard 
Print this post

I have never used PICAXE or Arduino so I can't contribute anything useful here but I'm learning a lot and enjoying this thread. Please keep it going guys.

I just got into the uMite on version 4, so all this is new to an old assembler guy. Next time I need a smaller 8, 14, 20 pin uController I think I'll try Great Cow Basic on the PIC 8 bit series.

Lou
Microcontrollers - the other white meat
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 11:43am 05 Mar 2014
Copy link to clipboard 
Print this post

I'm eager to try Great Cow Basic on some Pics. and to compare it with Oshonsoft Basic, mikroBasic, Pic Micro Pascal, JALv2, SDCC.

But also on some AVRs and compare it with the wonderful avr-gcc compiler.

P.S. Guys, hopefully my joke above (an interview with Crash and Eddie from Ice Age animation movie - anyone knows them as good guys) didn't upset anybody. Was intended to release some pressure...
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9310
Posted: 01:23pm 05 Mar 2014
Copy link to clipboard 
Print this post

Oh, I love those guys from Ice Age - and scrat!!!!!


Smoke makes things work. When the smoke gets out, it stops!
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 12:45pm 06 Mar 2014
Copy link to clipboard 
Print this post

Maker have a new book about AVR programming on sale http://makezine.com/2014/03/06/new-avr-programming-book-from -make/ . Let's see what bad points they think Arduino have:

[quote]Arduino Cons
As good as the Arduino hardware is as a generic AVR development platform, it’s
not perfect. For use with this book and our examples, there are a number of dis-
advantages to using an Arduino instead of just plugging an AVR chip into a
breadboard.

Probably the first among these disadvantages is the lack of the breadboard itself.
Shields are great for finished products, but when I’m building up a hardware section
for the first time, it’s nice to test it out on something more flexible like a breadboard.

I find that the more complicated my external circuitry gets, the less suitable work-
ing on the Arduino becomes. The Arduino is great for plugging a few LEDs or a
couple of sensors into. But when things get interesting, I end up having to jumper
the Arduino into the breadboard with 10 or more wires like some demented spider,
and then my dog knocks something loose, and it takes a long while to debug the
problem, and that’s when I wish I’d just stuck a chip into the breadboard in the first place. (True story.)

Another downside to using an Arduino as an AVR development platform is that a
few ports and pins are already irreversibly wired up and unavailable for use. For
instance, when we make an eight-LED POV toy in Chapter 3, you’ll discover that
two of the pins that I’d like to use for LEDs are already hard-wired up to the crystal oscillator. It’s a design trade-off—because it’s clocked with a 16 MHz crystal oscillator, the Arduino is able to run twice as fast as an AVR using only its internal
timebase.

But because the Arduino ties up two of the pins in PORTB, you’ll only be able to
make a six-LED cylon without having to do some elaborate coding as a workaround.
If you want to display a byte’s worth of data on PORTB, you’ll be missing the most
significant two bits.

Arduino boards aren’t cheap either; just compare an Arduino Uno with the AVR
ATmega328p chip that powers it. You can buy 8 or 10 AVRs (or 20 ATtiny 45s) for
the price of one Arduino. This is because the Arduino has extra hardware—power
regulation, USB-to-serial, and other circuitry onboard—which makes them over-
qualified for many trivial applications. This also makes an Arduino too expensive
to commit to a one-off quickie project, and that’s a real shame because nothing in
the world is better than giving your young niece a goofy microcontroller-based
toy that you made for around $5 in parts. (That said, if you can prototype the toy
faster because everything’s wired up for you on the Arduino, go for it. A goal of this book is that you’ll be able to move fluently between the “Real AVR” world and
Arduino.)

More trivially, it’s a minor pain to be always going back and forth between the pin
names in the datasheet (”PB5" and similar) and the Arduino’s pin names (“Digital13” and so on).
So if you’re working along with code from this book, and you need an LED connected to pin PB0, for instance, you’ll want to hook up the same LED to your Ardu-
ino’s Digital 8 pin. (And see how the Arduino doesn’t use pins PB6 and PB7 ?)
Finally, the Arduino bootloader needs to use the watchdog timer, which is a timer
that effectively reboots your AVR chip automatically if your code gets hung up and
doesn’t check in every once in a while. We won’t even use the watchdog timer in
this book, but if you need to make a very robust design, it’s a nice trick to have up
your sleeve.

But don’t let these gripes overshadow the main point—an Arduino can also be
turned into a fine C-language AVR-programming platform. And besides, if you’ve
got one sitting on your desk, you might as well use it.[/quote]

There are also good points but for another post
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
     Page 3 of 5    
Print this page
© JAQ Software 2024