Home  |  Contents 
Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: JALv2.4q2 versus XC8 Post ReplyPost New Topic
Page of 2 Next >>
Author
Message << Prev Topic | Next Topic >>
vasi
Guru
Guru
Avatar

Joined: 23 March 2007
Location: Romania
Online Status: Offline
Posts: 1697
Posted: 02 February 2014 at 5:16am | IP Logged Quote vasi

I guess anyone knows that MPLAB XC8 compiler is in fact an unified "form" of the two HITECH C compilers, PICC and PICC18, known to generate the most efficient and compact code for PIC12F-16F-18F microcontrollers (and also the most expensive).

Now, Microchip says that MPLAB XC8 is the future and all new designs must use this cross platform compiler. We have a free version edition but unfortunately, what Geoff says here about HITECH Lite, it is also true for XC8 (personally, I expected to have a performance at least at a comparable level with the C18 compiler).

So, it is clear until now that this HITECH acquisition turned very bad for the hobby department. In fact, for the C programmers only. The 60 day trial for the PRO version may help a bit but this time, you can use it only once. I said more than once that we have in JALv2 compiler the best open-source alternative possible regarding to up to PIC18F microcontrollers so, we can ignore Microchip's greed.

I did some comparative tests between XC8 1.30 and JAL2.4q2 beta and the first test was obvious blinking a LED (identical source code for both compilers, pic18f46k22):


                  XC8 free / XC8 PRO / JALv24q2
Code space used:     148        92        98 bytes
RAM  space used:       2         2         4 bytes


But of course, this means almost nothing so, I compiled another demo, "USB HID Mouse" :


                  XC8 free / XC8 PRO / JALv24q2
Code space used:    8153      4234      2540 bytes
RAM  space used:     204       190        54 bytes


But for the last test, I should mention that the code is not identical - I compiled what I found in the compiler's packages. Also, for the USB Stack, XC8 use the free open-source stack, M-Stack of "Signal 11 Software", stack which will become popular for hobby projects (so that they says).

Anyway, it should be a starting point in evaluating the JALv2 compiler which can be situated in the professional zone. And don't forget that the "Pic Micro Pascal v,2" of Philippe Paternotte is about to come and it will be another free professional option.

Edited by vasi on 02 February 2014 at 5:17am


__________________
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang


Back to Top View vasi's Profile Search for other posts by vasi Visit vasi's Homepage
 
vasi
Guru
Guru
Avatar

Joined: 23 March 2007
Location: Romania
Online Status: Offline
Posts: 1697
Posted: 02 February 2014 at 11:21pm | IP Logged Quote vasi

Now, lets see what we lost with all these changes "for the better", mainly done to provide the same tools for all three major operating systems and to attract some Arduino users.

Why I didn't compiled the "HID Mouse" example from MAL - Microchip Application Library (later changed to MLA - Microchip Libraries for Applications)? Because the Microchip USB stack does not compile with XC8. But lets compile it with MPLAB C18.

So, with all optimizations active and procedural abstraction from the demo period you get:

used code space: 2484 bytes
used RAM  space:  394 bytes


After the demo period, you lose procedural abstraction and we get:

used code space: 3177 bytes
used RAM  space:  394 bytes


A little bit larger, but infinitely better than XC8 in free mode. But not better than JAL compiler who use a port of Microchip USB Stack. Now is clear as crystal that the migration to XC8 is a no-no! Should be boycotted by all users.

MPLAB C18 is at 3.46 version and the target microcontroller was 18f46j50.



Edited by vasi on 03 February 2014 at 1:38am


__________________
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
Back to Top View vasi's Profile Search for other posts by vasi Visit vasi's Homepage
 
JohnS
Guru
Guru


Joined: 18 November 2011
Location: United Kingdom
Online Status: Offline
Posts: 1562
Posted: 03 February 2014 at 8:22am | IP Logged Quote JohnS

The snag is that JAL isn't C. So, much less sample code, tutorials and knowledge on the net or in books. If you adopt it and wish in the future to change uC, maybe to PIC32 or STM32, you're stuck with a ton of code and knowledge that's not much use.

On PIC32, I'm using GNU gcc for PIC32 rather than xc32. I'm using essentially the same gcc for STM32 and AllWinner A10, A13 & A20.

I abandoned PIC18 etc as a policy as soon as 32-bit chips and boards became so cheap. Things like Maximite could not be done as well or cheaply with smaller CPUs.

My advice: abandon small Microchip devices as soon as you can. Go 32-bit. Stick to open source C compilers.

I'm finding STM32 much better value and faster than PIC32 but that's a separate decision.

John

Edited by JohnS on 03 February 2014 at 8:23am
Back to Top View JohnS's Profile Search for other posts by JohnS
 
vasi
Guru
Guru
Avatar

Joined: 23 March 2007
Location: Romania
Online Status: Offline
Posts: 1697
Posted: 03 February 2014 at 10:40am | IP Logged Quote vasi

JAL is perfect for PIC12F-PIC18F families. It is very close to ADA and that may be a path to follow. But I guess this is not a concern as many of people here have several learned languages to their background (when I started to learn JAL, I already had Basic, Pascal, C and C++ into my portfolio - hehe, JAL stands for Just Another Language). And can be a loss only if Microchip stops their fabrication line. Even if now I am into AVRs, I can't let PICs go yet.

For thousands of projects, a 32bit microcontroller is overkill so 8bit still have his place into this planet. Sticking with JAL, you stick with an open source compiler so, no problem here. Especially when it is so good at generating small code. My admiration to his creator which is doing a better job than a horde of paid programmers. JAL's value is what makes me recommend it to others.

Personally, I would go for 16bit (dsPIC33F, PIC24F/H) instead of 32 as PIC32 still have some silicon bugs and a PIC24 project can easily be ported later to PIC32 when this will get better revisions. But as you say, it can be STM32 in the end.

Anyway, thanks for your advices and for your point of view.

_____
BTW, apart of FAT32 file system (for SD-Cards and HDDs), Jallib (a huge collection of JAL libraries) comes with MINIX file system for the people who prefer that instead of Microsoft's file system. But there are also a lot of goodies to be discovered for free.

Edited by vasi on 03 February 2014 at 11:00am


__________________
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
Back to Top View vasi's Profile Search for other posts by vasi Visit vasi's Homepage
 
elproducts
Senior Member
Senior Member
Avatar

Joined: 19 June 2011
Location: United States
Online Status: Offline
Posts: 282
Posted: 03 February 2014 at 12:44pm | IP Logged Quote elproducts

JohnS wrote:
My advice: abandon small Microchip devices as soon as you can. Go 32-bit. Stick to open source C compilers.


I can't agree. I think 32-bit is great but there is a place for these small devices. Little 8 - 20 pin devices are so handy and nothing in 32 bit offers that. Plus DIP Packages for easy soldering or breadboard projects.
Plus micros under $1 is possible in small volume. And then all the compiler options in BASIC and C.

And for C programming, the new MPLAB Code Configurator makes creating a new project with I/O setup and peripheral code as simple as some mouse clicks on a GUI. One final click from there on the generate code button and I have a whole project of XC8 .c and .h code.

__________________
www.elproducts.com
Back to Top View elproducts's Profile Search for other posts by elproducts Visit elproducts's Homepage
 
JohnS
Guru
Guru


Joined: 18 November 2011
Location: United Kingdom
Online Status: Offline
Posts: 1562
Posted: 03 February 2014 at 1:43pm | IP Logged Quote JohnS

Small volume under $1 is irrelevant unless your time is free and in plentiful supply. Generally time is in limited supply and may also be expensive.

Even my hobby time I value quite highly so very cheap chips that mean using yet another non-standard language thus locking me in would be a complete no-no. (One of the reasons I stayed away from Arduino which as you probably know isn't open source as well as being poor value for money.)

John

Edited by JohnS on 03 February 2014 at 1:44pm
Back to Top View JohnS's Profile Search for other posts by JohnS
 
Geoffg
Guru
Guru
Avatar

Joined: 06 June 2011
Location: Australia
Online Status: Offline
Posts: 2142
Posted: 03 February 2014 at 11:55pm | IP Logged Quote Geoffg

Interesting discussion on 8 vs 16 vs 32 bit chips and I just had to chime in (this is just my humble opinion and only relates to the Microchip line).

There are some 8-bit chips that cost less than 1$ and I guess that for something like smart cards produced in volume they would be a viable option. Also, there are occasions when you need just an 8 or 14 pin chip and an 8-bit chip is the logical choice.

But for the great amount of general "hobby" applications 32-bit chips are the way to go (IMHO).

At the cheap end of the range (16K flash, 4K RAM) they cost about $2.10 (in one off quantities) and their current consumption is less than 6mA (at 8 MHz). Compare this to the venerable (and popular) 16F88 which costs about $2.60 and has 4K flash and 368 bytes RAM. About the only advantage that the 8-bit chips have is that their power consumption is a little less (eg, 2mA at 8MHz for the PIC16F88).

For some reason the 32-bit chips have the reputation of being complex and this puts people off. I think that this comes from the type of chips found in mobile phones. But the PIC32 range are easier than the 8-bit or 16-bit chips to program. In particular, the 8-bit chips are riddled with frustrating architectural limitations like small integers, paged memory and paged registers. There are some modern 8-bit chips which have their specialised applications but when hobbyists refer to 8-bit chips they generally mean the old warhorses like the PIC16F88 and PIC16F884 which they use as a general purpose processor.

The best thing about the 32-bit chips is that they have the memory and speed to make things like compiler optimisations irrelevant. With the 8-bit chips you need a good compiler or write in assembler. With the 32-bit chips you can use the free compiler with the huge amount of support libraries from Microchip and the 32-bit chip will swallow it without a burp and still run way faster than an 8 or 16-bit chip.

A while ago I was talking to a Microchip engineer and he commented that the 32-bit line was taking over the 16-bit territory and encroaching on applications previously reserved for 8-bit chips. So, everyone is moving to 32-bit.

Chips like the PIC16F88 were designed 20 or so years ago. The only reason why Microchip keep them in their catalogue is because there are some products designed years ago that are still in production. But, using them for new projects is like designing a new television set that uses valves!

Geoff





__________________
Geoff Graham - http://geoffg.net
Back to Top View Geoffg's Profile Search for other posts by Geoffg Visit Geoffg's Homepage
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 5166
Posted: 04 February 2014 at 12:12am | IP Logged Quote Grogster

Yes, interesting comments, Geoff.

Having now played with first the mono MM, then the colour MM, and having taught myself the MMBasic language pretty well, the idea that I can take 99% of that to the new MM chips is making me very pleased that I took the time to learn MMBasic at all.

Naturally, there are some further bench-tests needed for the new MM chips, but once that is done, I fully expect to migrate my products from PICAXE to MM IC's. All the PICAXE chips are 8-bit, and they really are a great idea and product, but I am a little disappointed that RevEd have not developed a new 32-bit PICAXE chip, but they seemed to be uninterested in that when it was proposed by a few. They also did not seem too interested in bringing in things like floating point, which many wanted - it may simply have been too hard or nay on impossible to do with 8-bit architecture.



__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 
vasi
Guru
Guru
Avatar

Joined: 23 March 2007
Location: Romania
Online Status: Offline
Posts: 1697
Posted: 04 February 2014 at 2:13am | IP Logged Quote vasi

Hi Geoff,

Regarding to PIC32, you are right when is about the top members of this family as MX4,MX6,MX7 but still...

- meantime, Microchip released recently new performing products in 16F and 18F lines with bigger speeds than PIC16F88, up to 16MIPS, on par with Arduino (ATmega) (finally!!!);

- some PIC18F come with more flash programming space than the MX1/MX2 lines (one good criteria why keeping them around): PIC18F27J53 128Kb flash space is bigger than PIC32MX150F128B 128Kb flash space. So, I can write more code inside PIC18F than in MX1/MX2 with enough execution speed (I could write more code anyway, even on par sizes);

- you still need the professional version of the C32 compiler to make the Maximite/Micromite projects possible (yes @Grogster, that is required in order to enjoy PIC32) - consider that there are also other projects that may need a non-crippled compiler and that may consider this a big obstacle in adopting PIC32 (as we found out, there is not yet a viable free alternative). Firewing is another great project that would benefit immensely from non-crippled XC16 and XC32 compilers as the language is an important factor in choosing a microcontroller family (I think that until now, BASIC did a lot more for PIC32 than Wiring language, but I may be wrong).

Anyway, Microchip can keep their compilers for themselves. If it weren't for JAL and PMP, I would have migrated to AVR long time ago (that happened in the end). But for some reasons (and probably because I'm stupid enough), I continue the lobby for JAL and PMP in Microchip favours, knowing the fact that you can make projects at a professional level without paying money for compiler licenses.

__________________
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
Back to Top View vasi's Profile Search for other posts by vasi Visit vasi's Homepage
 
elproducts
Senior Member
Senior Member
Avatar

Joined: 19 June 2011
Location: United States
Online Status: Offline
Posts: 282
Posted: 04 February 2014 at 5:21am | IP Logged Quote elproducts

Geoffg wrote:
Interesting discussion on 8 vs 16 vs 32 bit chips and I just had to chime in (this is just my humble opinion and only relates to the Microchip line).

But for the great amount of general "hobby" applications 32-bit chips are the way to go (IMHO).


Geoff, I respect your opinion and am in awe of your talents but I have to disagree.
Arduino and all the vast amount of 8-bit PIC based projects created over the years and still being created shows you don't always need 32 bits. And if you want battery operated, the 8-bit PICs draw nano amps not milliamps. So there is clearly still a place for 8-bit. And that's not my opinion, it's just all over the "hobby" projects at MakerFaires and Make Magazine and Nuts & Volts projects just to name a few.
Many 3D printers run on 8 bits.

Quote:

Chips like the PIC16F88 were designed 20 or so years ago. The only reason why Microchip keep them in their catalogue is because there are some products designed years ago that are still in production. But, using them for new projects is like designing a new television set that uses valves!


Not sure why you picked that device, it is very old. The new 16F1xxx parts as Vasi mentions have far more features, lots more memory, draw less power and run a lot faster on an internal oscillator with PLL Option and are less than 1/2 the price. And then there are the new CLC, NCO, CWG, PPS, and other core independent peripherals in the latest 8-bit PICs that give you simplified gate array type capabilities and more in a small 8-28 pin device.

And the number of third party compilers with libraries that handle common functions like SPI, I2C, serial, driving LCDs, reading keypads, etc. and take care of any banking requirements makes programming them so easy for hobbyist projects. And now there is a GUI code developer (MPLAB Code Configurator) for the parts that makes creating XC8 C code just a few mouse clicks away.

So is 32 bit great? Absolutely.
Should a hobbyist learn to use 32 bit parts. Yes. I think so. Especially the MX1/2 parts.
But other than the PIC32MX1/2 parts there aren't many "hobbyist" friendly DIP packages.
I can easily get 8-40 pin 8-bit DIP parts everywhere.

So 8-bit still has a place and to ignore it is really limiting your options for any "hobby" type project.

__________________
www.elproducts.com
Back to Top View elproducts's Profile Search for other posts by elproducts Visit elproducts's Homepage
 
JohnS
Guru
Guru


Joined: 18 November 2011
Location: United Kingdom
Online Status: Offline
Posts: 1562
Posted: 04 February 2014 at 8:06am | IP Logged Quote JohnS

vasi - I'm using PIC32 gcc with optimisation, not xc32. I don't see anything wrong with its optimisation. gcc is a good compiler and free.

(Even so, Microchip are shooting themselves in the foot if not head by their crazy behaviour with xc32.)

John
Back to Top View JohnS's Profile Search for other posts by JohnS
 
vasi
Guru
Guru
Avatar

Joined: 23 March 2007
Location: Romania
Online Status: Offline
Posts: 1697
Posted: 04 February 2014 at 9:25am | IP Logged Quote vasi

John, the C32 compiler must meet some requirements in order to compile Maximite/Micromite:
- PLIB availability;
- optimizations at the same level with the commercial one;
- no libc replacements;
- in Micromite's case, 16bit code generation.

The free version of C32 compiler developed by Jason Kajita (Microchip's employee) can't do that as is based on newlib and does not generate 16bit code (or does not provide the 16bit libraries) - is the only official free c32 compiler with full optimizations from Microchip.

There is also Pinguino C32 but I think it does not come with PLIB, 16bit code generation and I think it is also based on newlib.

I know it is possible to compile your own C32 version, eliminating the check for a license and borrowing the libraries from a commercial package but that enters in a gray (if not black) zone and you can't distribute it, and you can't expect that regular people will be able to do the same (in short, this can't be used at a community level).

If none of these custom builds can provide the same level of performance Microchip's Pro compilers provide, then we are talking about "crippled" compilers. I'm using avr-gcc and I get the same level of performance, no matter who prepared the toolkit: a linux distro, or Atmel himself so I know what I'm talking about.

Now as far as I know, for a short period of time, the commercial MPLAB C32 was available for Linux.

So, what kind of compiler do you use?

Edited by vasi on 04 February 2014 at 9:27am


__________________
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
Back to Top View vasi's Profile Search for other posts by vasi Visit vasi's Homepage
 


Page of 2 Next >>
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.1089 seconds.
Privacy Policy     Process times : 0, 0, 0, 0.11