Can I add new processors to the compiler?

General discussion on mikroC PRO for PIC.
Post Reply
Author
Message
john p
Posts: 40
Joined: 19 Sep 2016 18:54

Can I add new processors to the compiler?

#1 Post by john p » 02 Mar 2022 05:57

The pace of updates of the Mikroe compiler seems to have slowed, and I'd like to try using the PIC16F15214, which is an 8-pin Enhanced Midrange part with a lot of features, but it's not on the list of usable components. I'm wondering if it's possible to add one's own extensions to the compiler to add new parts. The reason why I think it might work (in theory!) is that I've noticed that when the compiler is installed, it creates a directory called Defs, which contains descriptive files for all the processors the compiler supports. If a user added files there with the right format, would the compiler accept them? I am certain that doing this from scratch would be a time-consuming job, even copying from existing files for similar parts, but maybe someone has done it and knows some short cuts.

It seems that each processor has 3 files that describe it, with the extensions .c, .mcl and .mlk. The first and last are text files and in fact the .mlk file is XML format, but the .mcl file is harder to understand, with partly printable text and some binary data. This would all be easier if Microchip would just use consistent locations for the special function registers, but they vary a lot from one part series to another. It means that although the same instruction set is used for a lot of processors and you can write code that can be transferred, the compiler has to know which part you're using. So these descriptive files must be created, but is that all that's needed to add a new processor?

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: Can I add new processors to the compiler?

#2 Post by janni » 02 Mar 2022 18:00

Adding new processor definition files is possible (though painstaking) for processors that do not have some significant changes compared to existing families (like Q series of PIC18 range that compiler simply cannot accommodate). Only the *.c and *.mlk files are needed - the *.mcl file is a compiled form of the *.c one.

Best way is to copy files of similar processor ( P16F153xx are more complex but seem to be closest) and then go (slowly :( ) through the datasheet and correct all register definitions in the *.c file. Correction of the *.mlk file will be as painstaking and the configuration words are tricky. In summary, it's possible but do it only if you have to.

john p
Posts: 40
Joined: 19 Sep 2016 18:54

Re: Can I add new processors to the compiler?

#3 Post by john p » 03 Mar 2022 23:05

Thanks Janni. That's about what I expected, "Possible but not easy". You'd have to be pretty serious about wanting a processor to do it!

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: Can I add new processors to the compiler?

#4 Post by janni » 04 Mar 2022 00:10

Yeah, it's not that bad if there already exist definition files from same family and needed corrections are limited but in this case required amount of work will be more substantial.

Post Reply

Return to “mikroC PRO for PIC General”