best compiler

Ok, I understand what you meant by "stability" now. Unfortunatly this still does not follow. I learned this myself the hard way. About 12 years ago I bought a Watcom C/C++ compiler. Excellent compiler, very well respected and so too was the company. Large user base, good support, exactly what you are tallking about now. Along came a company called Powersoft, bought Watcom and very soon afterwards shutdown the compiler section. You couldn't buy the thing even if you throw cash at them. A few years later the compiler made its way into the open source domain where it is now limping along.

I understand your need for some kind or criteria to base your purchase on. It is the same for all of us. We all need to think of a way to identify what we should be spending our hard earned cash on or what we should be investing our time in. But size of user base is not it.

Ok, maybe picking a standard language like 'C' (so that if your tool vendor disapears you can move to another tool vendor) is the answer. Sure but only if you stick to the absolute standard specification of the language and don't use any of the compiler specific extensions or specialised libraries for which you do not have the source. I have been programming in C for a very long time, I have used many different compilers and I can tell you that porting an app between two compilers can be a real nightmare.

Ok, maybe picking 'C' because you want to learn 'C'. Fine but if you really just want to learn 'C' there are much better ways to do it than on a tiny embedded MCU. The GNU C compiler is free and so to is the debugger. An excellent way to learn 'C' and discover the pitfalls is to use these tools on a PC.

Ok, maybe picking 'C' because any program you write in 'C' is portable. So if you write a program for the PIC you can simply use it on an AVR? No things don't work this way. You need to put a lot of effort into writing a portable 'C' program especially for a small embedded MCU. Either you put a lot of effort in while you are developing your program and a little when you actually move it across, or you put a little effort in while you are developing your program and a lot when you actually move it across. Either way there is a lot of work involved in making the same program work on different embedded MCUs. Programming in C does not give you instant free portability.

It has library functions that read from and write to the USART. Some functions will operate on the USART directly others use FIFO buffering. There is no "printf" in XCSB because it is incredibly expensive. If you want to convert a 32 bit integer of floating point number to ASCII and then send it to the USART you would use the convert function followed by the write function. If you don't like this then you can write your own function to combine the two operations and be happy in the knowledge that the compiler will optimise this very well on your behalf. The real upside to all this is that XCSB will not "busy wait" while it is printing your formatted output, it will allow you to execute other tasks during this process (XCSB supports multitasking natively and not as an addon library).

Besides, what you are describing (the #use pragma) is a CCS 'C' extension. How would you port this code to (say) the HiTech 'C' compiler and get the same functionality without adding a lot more code yourself?

When I wrote the XCSB compiler it wasn't with the intention of writing another cheap BASIC or 'C' compiler. Or even to just create something that was easy to implement. It was with the intention of writing a compiler (that could be used by professionals) that would generate very efficient code for an embedded MCU. I wanted it to be easy to use and not have the 'C' free format pitfall. I tried to make it easy for both 'C' and BASIC programmers to use (staying clear of clever syntax and grammer). Unlike most C compilers XCSB uses a static run time stack. The positions of all the variables (including function locals and arguments) are calculated at compile time and not at run time, this means that they can be accessed directly without the need to calculate stack offsets at run time. The XCSB multitasking system takes all this into account generating task safe local variable and functions. With an addon multitasking library the user is often forced to jump through hoops to achive the same high level of run time performance.

Regards Sergio Masci

formatting link
- optimising PIC compiler FREE for personal non-commercial use

Reply to
Sergio Masci
Loading thread data ...

Hi Stef,

I also have a function like that in XCSB

LED_on()

;-)

Regards Sergio Masci

formatting link
- optimising PIC compiler FREE for personal non-commercial use

.
Reply to
Sergio Masci

hi Sergio,

that's nice ! Now there's only one step to make it simpeler ... ... measuring our brain waves ;-)

cheers, Stef

Reply to
Stef Mientki

Sergio Masci wrote in news: snipped-for-privacy@yoda.srts.co.uk:

I gave up a long time ago on trying to write MCU code that's easy to port from family to family or compiler to compiler. "Portability" of code was a straw pony that you associated with c compilers on MCU's, and then you correctly showed that it just ain't the way things are.

Programs that fit in the family of chips that I tend to stick to just don't take that long to translate over from scratch.

The functionality described is certainly expensive, but incredibly convenient. I wouldn't be able to get the same functionality out of Hitech without rolling up my sleeves--which is one reason why I tend not to use Hitech. Many things like this seem to require a tad more work-- even interrupt handling, where you need to case on the interrupt flags in Hitech, but write separate routines in CCS (though nothing prevents you from writing your own global interrupt handler in CCS). If you need cheaper UART capability in CCS, it can certainly be written, as well. When I can afford to use printf, I do it, and I'm glad its there.

Don't get me wrong. I've no intention of criticizing XCSB-- I've never used it. There are just a variety of reasons above and beyond any functionality why I think that it wouldn't be a first (or maybe only) compiler of choice for those just breaking into embedded systems.

--
Scott
Reverse name to reply
Hak mir nisht ken tshaynik
Reply to
Scott Seidman

Hi Scott,

I applaud your attitude.

This is an excelent reason to choose a tool: it does what YOU want. I cannot fault you here.

My only concern was the initial implication that BASIC is bad for embedded systems without regard for the specific XCSB dialect itself.

Although I agree with your reasoning for YOU using CCS, I feel I should point out that as XCSB grows in popularity, users will add powerful libraries of their own which will rival those written by a compiler writer. The point is that the XCSB compiler allows users to write very efficient code and they do not need to rely on the compiler writer to provide the functionality they require (unlike many other compilers out there). Take a look at Colin Barnards "one wire" library for XCSB for example

formatting link

So whereas CCS is right for you XCSB will be right for others.

Regards Sergio Masci

formatting link
- optimising PIC compiler FREE for personal non-commercial use

.
Reply to
Sergio Masci

Why not write a Forth , no need to complile . It writes low mid and high level , instantly . Don't take any hints from ANSI Forth or any of the free Forths .

New Forth is simple , has no STACK ( unless ya wan it) nor [compiler] words nor "redefinitions" , its just plain simpler , less is better . It's always in the execute mode , it simply takes your partially completed WORD and stores it so you can test out some code then return to complete the WORD . I call this the learning mode !

It does not compile nor interpret , it creates code instantly . If you forget code , you stack ( Low level only ) some parameters and "test" the code . Todays MCU have more memory , it rockets ..

No s/w can match the speed of Forth , writting it or running it . It in-lines code if you have the memory . A small Forth "starter" can fit in 7kB . testing your code on the target w/o an IDE is less strain , you need not learn as much to be proficient .

Reply to
werty

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.