Wednesday, June 7, 2017

Eclipse IDE with SDCC C compiler tutorial

I created a new page with a mega tutorial about using the Eclipse IDE with the SDCC C compiler in creating projects for the Il Pinguino Rosso board (PIC18F46K22) here.

Tuesday, May 30, 2017

SDCC support

Update: The sdcc plugin for eclipse is designed to work for 8051 microcontrollers but it is possible to be used for PIC microcontrollers, as compiler will ignore non-specific parameters. And it works just fine... 

Original article: I won't start another blog for SDCC C compiler alone. This blog can host both projects as is about a common language and differences are minimal. But SDCC project has a separate github location so it won't interfere with one another.

Now, it all works in Linux and we have many options for a dedicated IDE: eclipse, piklab, mplabxide. With mplabxide and his SDCC plugin I got nowhere - I can't configure it properly yet  With piklab would be the best but there are some requirements and won't work on all linux distributions so, I decided to give the eclipse plugin a try. I installed the oldest eclipse version supported by the CDT and the sdcc plugin, having the sdcc compiler installed in a subfolder of my linux home folder. Will see how it goes and if it works, I will publish the entire setup. If not, I'll move to the piklab ide.

Saturday, May 20, 2017

Back tracking...

I get problems trying to use the newest versions of MPLAB X IDE and XC8 compiler... I thought ... I'll abandon the Microchip toolchain  in favor of SDCC or even cpik C compiler and, of course, JAL language, all working in Linux as I've finally became a full Linux user because of the Microsoft aggressivity with their Windows 10 (we all saw that Windows 10 proved to be a huge spying tool).

But on the second thought, I downloaded some older versions, 2.15 for MPLAB X IDE, 1.31 for XC8 and 1.11 for XC16. So, this will continue. I saw that the serial bootloader firmware written in assembler compiles with errors in this IDE version so I use the assembler from the MPLAB C18 compiler (see this article) and works fine. I know it will not offer support for the most recent Microchip additions, but this is for the PIC18F46K22 microcontroller.

Now I'm working with a Nucleo board based on STM32 microcontroller and recently finished the onewire library for DS18B20 temperature sensor and I will port the library here when there will be time for this.

Wednesday, January 20, 2016

AVR with Microchip emblem.

Yep, as anyone knows by now, AVR is a Microchip property. Not yet a product... will see about this later. Anyway, first effect: Pickit2 programmer is no longer restricted in programming AVR microcontrollers (this means a common ICSP connector for development boards addressed to usual PIC programmers willing to try AVR). Also, we expect a better availability and maybe low prices for ATmega and ATtiny microcontrollers.

See the Microchip declaration here.

Tuesday, March 17, 2015

Nevermind ... my thought initially, but...

Update December 20, 2015:


The version 1.35 ends up adding only 66 bytes compared to 1.33 version.
On the other hand, compiling the "fat32_test" project we get a lenght of:
  • 13802 bytes with 1.31 version;
  • 12178 bytes with 1.33 version;
  • 11218 bytes with 1.35 version. 
So, for certain projects, there is clearly a constant improvement from a version to another of the xc8 C compiler. But for now, the other points of the original article remains valid.

Original article:


The new 1.34 version of xc8 compiler increases the compilation result of pcf8583_lcd example (which it was 3592 bytes on last code  optimization using 1.33 version) with 208 bytes. So, never mind. I´ĺl stop wasting my time on wishful thinking.

It is obvious that Microchip will never release XC compilers for free as rumors said. More, they continue to strengthen their license manager against crackers and this tells us that the business based on XC compilers will continue.

The free version is still a joke comparing it with the avr-gcc compiler. So, to all C programmers, try to migrate to AVR, or to ARM microcontrollers if you want speed, or continue using JALv2 for PIC12 - PIC18 projects. Or go with the free Firewing language which covers PIC24/PIC32 and some of the PIC18 microcontrollers. But of course, you can stay with XC8 1.33 version. Good luck, what ever you decide to do!




Friday, December 19, 2014

It could be something...

At the article's date, MPLAB XC8 compiler is at 1.33 version and shockingly, it scores smaller code sizes in the free version than the older and unsupported MPLAB C18 in his commercial version.  Regarding compiling bootloaders, C18 still remain the only alternative between the two, but anything else can be successfully compiled with XC8.

Well, "anything else" means all I have tested so far, in the form of a common code (the code can be compiled without modifications by both compilers) for custom libraries and projects and that is:

  •  - I2C library;
  •  - hardware serial comm. library;
  •  - non-blocking delays library;
  •  - 4bit LCD HD44780 library with arbitrary pinout;
  •  - PCF8583 RTC applications displaying on LCD or sending on serial;
  •  - Blinking LED with non-blocking delays, in both sloted (JALv2 with Jallib) and millis (Arduino) ways.

Sunday, December 7, 2014

The full FatFS library for C18

This time, the full version of FatFS library, but for PIC18F27J53 microcontroller. The library is adapted by @spinnaker and posted on "All About Circuits" forums. Go to "Microchip MDD File System" thread and from the second post you will be able to download the archive containing his project.

Of course, you'll have to subscribe in order to download the file. In the linker script you'll see three protected zones for the bigger arrays FatFS needs. Many thanks @spinnaker!

Friday, December 5, 2014

One Wire and Dallas Temperature Sensors

The picprojects.net provide library and example for DS1820, DS18B20 and DS18S20 temperature sensors. It also have a search function, useful when you don't know the IDs of the sensors. The code is written for CCS C and MPLAB C18 compilers.

The code is quite nice, thanks picprojects.net!


Wednesday, July 9, 2014

MPLAB C18 Lite for Windows is available again

The MPLAB C18 Lite compiler is available again on the Microchip's official page. The actual version is 3.47 and is an insignificant update to the 3.46 version (just a file corrected for two microcontrollers - something which you can do for yourself on the 3.46 version). It remains to be seen if Microchip altered in any way the lite compiler...

This way, this blog gains even more meaning...
But don't forget that we already have full versions under Linux and OS X.

PCF8583 real time clock for C18

Until my library is ready, here is the first find of a library written for MPLAB C18 compiler. It comes with a little example so, not much to say, just test it. Surely there are more examples on the 'net.

Thanks to Phil Ciebiera !