• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

MPLAB

Status
Not open for further replies.

large_ghostman

Well-Known Member
Most Helpful Member
Where do you download the MPLAB IDE? I can only find MPLAB X on Microchip, I cant find the original exe on the old PC. I was going to install both on the new PC.
 

large_ghostman

Well-Known Member
Most Helpful Member
Ok I found it! in the archives.

Thats rough though, looks like all the C18 compilers are the upgrade versions!! So I cant use mplab anyway :(.
 

hexreader

Active Member
Why not use MPLAB X along with XC8 and import your legacy programs.

You can download free versions of compilers here: http://www.microchip.com/mplab/compilers

(click the downloads tab)


Not sure whether peripheral libraries need to be download too, since I am just starting to think about dabbling in MCHP tool-chain again after being away for many years. Once you get hooked on the terrible drug of MikroElektronika compilers it is hard to get back to a normal life again.
 
Last edited:

large_ghostman

Well-Known Member
Most Helpful Member
I havnt used pics for a long time, a couple of years. Even then I used mplab and c18.

I downloaded MPLABX and XC8 but I am totally lost with it! I guess I got to used to ARM and uvision. I have found C18 3.47 and installed that with mplabX, I will try and get a blink going with mplab and C18 before trying the new tools!!! I had no idea it had changed so much!! Thanks for the link
 

DerStrom8

Super Moderator
Supposedly XC8 can accept the same syntax as C18. I haven't had an opportunity to really test this though.
 

hexreader

Active Member
Supposedly XC8 can accept the same syntax as C18. I haven't had an opportunity to really test this though.
Thanks for the interest.

I think you are right - but my issue is with libraries. It is hard work importing libraries from here, there and everywhere. I assumed that MPLABX would come with a good variety of libraries (such as 2x16 LCD), but while PLIB is good, there seems to be a poor choice of default libraries.

Maybe I am expecting too much :)

Maybe mikroElektronika compilers are just too good ;)

I guess I am struggling with working out what XC8 can give me that ME compilers will not. I can't help thinking that XC8 is better, but I can't see why.
 

large_ghostman

Well-Known Member
Most Helpful Member
The old mplab and C18 had a really good help file, it detailed the libs and the syntax. So you just #include and away you go. I havnt found the details of what Libs are in with XC8. Which compiler do I need for 30f and 24F chips now? Thanks for the link BTW.

MC sent my new ICD3 today, BUT I was at school! so it will be delivered Monday :(. Actually its been handy, I now have a point of contact at MC UK. He seems interested in some of the school project stuff I am doing.
 

large_ghostman

Well-Known Member
Most Helpful Member
Thanks for the interest.

I think you are right - but my issue is with libraries. It is hard work importing libraries from here, there and everywhere. I assumed that MPLABX would come with a good variety of libraries (such as 2x16 LCD), but while PLIB is good, there seems to be a poor choice of default libraries.

Maybe I am expecting too much :)

Maybe mikroElektronika compilers are just too good ;)

I guess I am struggling with working out what XC8 can give me that ME compilers will not. I can't help thinking that XC8 is better, but I can't see why.
Mikroelktronica costs too much, I need debug capability so I would have to buy one of there programmers etc and they are not cheap! Using the IDE and compiler is ok for producing a hex file, but its debug capability I need. This is where I got spoilt with Silicon labs, there 8051 chips are brimming with different peripherals, also the debug ect can be done by any of the cheap dev boards they do or a segger JTAG. Some of the 32 bit chips are out of this world, I have some 8051 chips that have built in radio capability, I have mainly used the 868 frequency. The down side is the tiny package of the chips, its mainly the 8051 that gets as large as SOIC. The rest are BGA etc.

Plus having borrowed a pk3 for now, the mplabX seems really buggy with win8.1. I used to like Hitech C and the Hitech IDE, real shame MC bought them out and ditched the IDE. I am sure I will get the hang of it again...........eventually.
 

hexreader

Active Member
Thanks LG,

Free version of mikroE compilers are not much use for all but the smaller PICs. I have enough money for the full versions, which are good value for me, but I can see that not everyone is as lucky as I am. (not lucky enough to own ICD3 though!)

Looks like you are stuck with MCHP toolchain. You need XC16 for PIC24, 30, and 33. You need XC32 for PIC32. Luckily all come in free versions.

The lack of MCHP libraries are an issue for me with XC8. If I am to fetch old C18 libraries and integrate them manually, then I might as well convert them to mikroE libraries.

For me, the pain of moving to XC8 may not be worth the gain.

For you - I think learning MPLABX and XC8/XC16 libraries might well be worth the effort. The newer XC compilers along with MCC and PLIB libraries look pretty good to me. You are young enough and smart enough to work your way around the maze when needed. I am getting too old for that stuff :(

Good luck with whichever path you take :)
 

large_ghostman

Well-Known Member
Most Helpful Member
Is the code configuration not supposed to replace the libs? Or I might see if the old C18 ones can be used, or rather copied. I never used them entirely, I would include them and use a couple of things, but I normally mixed that with direct register manipulation..
What really puts me off is all the complaints on MC forum. So many cases of good code and problem being in a bug in the IDE or compiler. It certainly all seems a step backwards.

The old MPLAB wasnt pretty but seemed to work.
 

hexreader

Active Member
Is the code configuration not supposed to replace the libs?
I sense that was the intention, but maybe it is early days.

If and when MCC becomes mature and more complete, I think it will make coding a lot more pleasurable. Trouble is that PICs might be obsolete before that happens.

Not sure what to make of it all.

I would definitely recommend using MCC new project for LED flash program on PIC18F4xK22 if you have one. It shows a lot of promise. I have failed to progress to anything more complicated yet (except UART serial was a doddle - IIRC)

When I work it out, I will pass on the knowledge - unless you get there first ;)

Putting effort into the older C18 seems like wasted effort to me - but you may see it differently

What ARM MCUs and compilers do you use?
 

large_ghostman

Well-Known Member
Most Helpful Member
Mainly silicon labs chips, everything from the 8051 with Keil compiler and sil labs excellent IDE, to the wonder gecko (yes, its really called that), which is a ARM Cortex M4 chip with maths processor. Because I cant afford the full Keil for the 32 bit (you get the 8051 8 bit one free), I sometimes use the keil compiler (code size limited, but reasonable), or IAR (I keep loading the trial :S), if I use the Kiel with 32 bit then I swap between sil labs IDE or UVISION IDE. If I use IAR then I use the IAR workbench IDE.

The sil labs IDE is really really good, it has an accurate readout of the current draw on the dev board and also once it detects the chip you can switch the tabs to things like the data sheet for the part your using, or full example hex files or full example source for alot of different goodies on each chip. I have most the Gecko series except the Jade Gecko I think, the starter kits are cheap but fully loaded dev boards, bonus is each dev kit is a full fledge JTAG programmer and debugger, so each kit can program any of their chips in your own circuits etc.

Normally priced around 35$ but you do get specials pop up where the boards are $15 for the 32 bit ones. The Giant Gecko is Cortex M3 core with 1 meg program memory. I was also given the full dev kits to review, they are out of this world but really pricey. They do have colour touch screen etc though. The big problem with the full sized dev kit is the abstraction, it has a board library to handle all the kit on the board, so your kind of removed a fair bit from bare register programming on it.
 

large_ghostman

Well-Known Member
Most Helpful Member
Monday the new (FREE) ICD3 arrives, so I will start trying to get the hang of the MC tool chain again. I had a HDD crash ages ago, so have very very little C18 code left :(, I now have a NAS and try and keep my files triple backed up. I lost alot of good stuff when that died.

Gutted all my LT spice stuff went, Eric from here was really cool and gave me alot of his libs and models for LT spice, but they have all gone now.

Strange thing is, I picked Proteus (I dont like it for sims) and Altium up really quickly, but I struggled even with the basics of LT Spice. LT spice is on my bucket list though. I would love to learn to use that properly. If I get much going with MC over the next few weeks I will post it up or send you a link to my site, its not public but its where I will keep most my project info.

Its just a kind of personal blog and a kind of project diary (or will be).
 

hexreader

Active Member
Wow - you really are into a big variety of stuff.

Hats off to you...

I have no hope of keeping up

Good luck and best wishes...

Robin
 

large_ghostman

Well-Known Member
Most Helpful Member
Wow - you really are into a big variety of stuff.

Hats off to you...

I have no hope of keeping up

Good luck and best wishes...

Robin
It will take me ages to get back into pics, I am not a natural programmer. Micros etc and programming are highly structured, I am dyslexic in the extreme. I am also not micro logic orientated, I forget what they call it but, my kind of logic thinking dosnt fit well with micro's. So when I first learn something like C it takes me a long time to grasp it. Once I have then I begin to learn fast.

The big problem I now face is the change in tool chain, this is very much like starting from scratch. Its the hardest part for me, learning how to set up the files and get the compiler to work etc. I have also got used to the ARM abstraction layer, IMHO it is totally different to MC. I havnt used many vendors chips, but what I found with ARM was you only had to learn a few things, after that it dosnt really matter what core you use because the process is the same.

What changes is different commands and some registers, but the way the tool chains are done and the CMISS??? (its not called that, I have gone blank!) means that you set each project up the same way, then you just carry on as before. With MC its totally different, when you load a chip you have to add the header file etc etc, with ARM its detected and the correct headers etc are added for you. ARM tool chains on the whole are less buggy, simplicity studio which is sil labs IDE is great, if something dosnt work then its almost something you have done in code (in which case the IDE highlights the section), or you have messed up with wiring (again you are told). With MC if a chip isnt detected etc, it could be a bug in the tool chain,a driver problem, or any number of things.


MPLABX has been around a few years now, from what I can see its still not much better than beta form. For every bug fixed it seems they add two new ones. Also when a new chip is added I guess they have to fudge the files so it will work, with arm as long as the chip uses a already known core then it simply slots in. I havnt put that well but it gives you an idea.

Sil Labs had their own chips (and still do), they are more like MC chips. At least in the sense they are not based around a specific Core always, then sil labs bought out Energy micro, they had the Gecko range which is what I use. The big advantage with these, apart from being some of the worlds most energy efficient chips, is the fact they are always based around a Cortex Core. So dosnt matter what goodies they stick on the chip, you are still dealing with a well known and tried Core.

RPI I have used for specific projects, I have mixed feelings on it. The foundation itself tell you it isnt designed for production use, its designed as a learning tool. It has a couple of what I would call serious flaws in the design, but it has a couple of things that for non expert programmers make it highly attractive. If we take what I see as the major flaws first...........

One of the biggest flaws is booting from a SD card, they fail and do it regularly. The reasoning behind this is you wear out certain sectors on the SD card with constant read/writes to the same block. I personally think its more complicated than that, I have used really expensive wear levelling SD cards, they have failed as quick as some of the ultra cheap card i have used. The more expensive cards do give you a speed advantage, but not much.

My approach to this has been to only add the boot files to the SD card. I then have a file that basically tells the OS to use the USB stick as its main drive, it still boots from the card, but as long as you dont switch the thing off and on much, you can get decent life spans out the SD cards.
You can also use a real HDD with the PI, its a bit of faffing but something I am looking at doing. My intention is to use a non mechanical HDD, this should give a good life span.

Heat is another problem, people like to clock the chips. The pi even has a setting for it..............Big mistake, unless you put some serious cooling on the chip I would leave it clocked low. It isnt designed to be as fast as a pc, trying to make is so ends in tears and frustration.

Another mistake I cant get my head around is the way they have numbered the I/O pins, it is totally counter intuitive! (to me anyway). While you can bit bang Serial and it does have a serial port, I would have put serial ports in. One is pretty much needed to run the PI (the way I do it anyway), I run it over SSH headless. I see zero point in having high end graphics chip on it, again you need good cooling if your going tto stream video from it, use it as a media centre with mainly video and a SD card, and you are a fool.

Then we have the other nonsensical power issue, you cant put the pi in sleep or a power down mode. It chugs along all the time, it would have made so much more sense to have a sleep feature, and even more sense to have a wake on LAN. But then we come back to what the pi actually is, and what it was designed for. Its a teaching tool, simple as that. Yes you can do some cool things with it, but TBH documentation and decent examples are few. It was not designed for what most people do with it, so to slate it's weak points is a bit unfair.

So what do I like about it?..................

It is by far the easiest way to get IOT working by far. I have used OLIMAX web server board, very old now and based around a pic. Getting a webpage up and running is a hair pulling event! They did make it easy with a reworked MC stack, but MC told them to stop!! Despite knocking the MC out the water, MC complained it infringed on copy write. This was such a shame, it beat the MC stack by a long way. I havnt used the board for a very very long time, I doubt it even works now with the MPLABX and new tools etc. But I did like it.

The pi makes connecting something to the internet very easy, running on Linux also means you have alot of options regarding how you program it. If you new to electronics then it does open up some seriously cool projects, but the non production standard has to be kept in mind. My self guiding hexa copter used the pi as a central hub, what was really cool was using it in conjunction with Labview and Matlab.

This combination was seriously powerful, if you add the Labview camera lib and recognition system, you can have something really special. There is various ways to configure this, for simple object detection you use a black and white type system. This makes shape recognition very fast, if you want facial recognition then you need to clock the pi a bit and dont give it too much else to do. I had micros doing most the grunt, and the pi acting as commander. It worked really well and the project started to be come something really special, I won a prize from a university for it, i was even offered the chance to goto university early. That turned out to be not such a great idea in the end, it put too much pressure on me at 14, I ended up taking 6th form higher exams in the 4th year.

If I am totally honest I expected too much from myself, and started to believe I was actually special, the truth is I was just a kid with aspergers that came up with a cool idea. That is hardly a good reason to goto uni early!! Emotionally I couldnt handle the extra pressure, what had been fun turned into work. i began to hate it, I suddenly had dead lines to meet. This wasnt good, upto that point I had a finish date for the project, but I could stop adding features at any point. Once I started down the uni route I was given deadlines, so they would say we want X added by Y time. I dont work like that, I have periods where I do little all week, then I will have a 36 hour all out session totally focussed to the point I dont eat etc.

that dosnt fit the real world, but its how I operate.

Back to the PI, if you except its shortcomings, then the only main limitation is your imagination. People tried to build bitcoin miners, they worked BUT for the money it isnt worth it. The cost of the pi is too high for building a super computer cluster, yes its fun but at £35 a pop its not the best way. If you think about it, you can go on ebay and buy 120 used laptops for £60. most have cracked screens and no HDD etc etc, but what they have is mother boards and graphics chips. Bit miners work best if you use high end graphics cores, these have millions of cores in them, its the number of cores that really matter in mining.

Super computer clusters dont need graphics for most the units, so you can build a kick ass cluster with a pile of laptops that have cracked screens and bits missing, yes you have to take them apart, yes its best to get a joblot from a single source (so they are all exactly the same laptop). But in the end 20 old laptops in a cluster knocks a 40 cluster R pi super computer into a cocked hat. I got 22 old laptops and started to build one, I never finished it. Mainly because it dawned on me one day.......I didnt actually know what I wanted it for, or what I would use it for! So it sits under bench. But I was given the laptops by the school for free, they are old and most the batteries are long dead. But they work.

So dont think you will fall behind me, you are ahead at the moment. It will take me time to catch up and I will need to ask some really basic questions. Once I do catch up, then why would I steam ahead and not help someone as well? This site got me out of a whole and taught me much of what I know, aged 11 they took me under their wing. I have many good friends here. If I can help someone then I always would, 5 years ago people here were like a really close dysfunctional family! But it sure was alot of fun.

Things have changed a little, but mainly thats down to the world changing. When I first came here you couldnt get an arduino plugin for just about everything, the option to buy the mad contraption you wanted wasnt their. So people had to design it and help you get it working.

A really good example of this is the aquarium thread!! What an epic read! In short the guy wanted to make his marine tank power heads act like the tide, but he wanted it analogue. MONTHS of work later I believe they did get it to work. Now several years on China sells a unit that can do that for $3. back then it didnt exist. So these days there is alot of links posted for things to buy to get the job done, little design and build stuff is done and projects are few. But that reflects the modern world, we are now a buy and bolt on world mostly.

Scopes are another good example, new cheap scopes didnt exist, even boat anchors were expensive, so people buying an ebay special and trying to fix it were plenty. What is the point these days? £400 and you have a good cheap brand new scope. Personally I still buy boat anchors, I have a HP logic analyzer from circa 1990 I think, touch screen the works! The hard drive fails every few months and getting a new one is getting really hard. It cost me £50, but back when it was new I have seen a brochure where its around $60,000. I love the thing, same with both my Gould monthly recap scope (totally ahead of its day), and Lecroy 4 channel scope. Both really old, but I wouldnt swap for the latest top of the range Tek scope in a million years.

Anyway I have written too much, and go off on many tangents. But that is ME :D.
 

hexreader

Active Member
Is there a good reason to learn MPLABX and PIC? ARM seems to me to be far superior. Or is it just the challenge?

Never got into PI. Seems over-complicated for simple tasks, and hopelessly inadequate as a PC. Mine gets used exclusively along with a monitor as a terminal.

Taking Uni slowly sounds like a good plan. Just be sure to go soon, as only crappy jobs are open to non-graduates, and leaving it off makes it harder as time goes on. I have just retired from a well paid job, but no way would I get the job back without a degree. If you can enjoy Uni, then that's great, but you must go, and you must get that bit of paper.

The MPLABX/XC8 project here seems self contained and usable - just be sure to select one of three options from the option box top-left.

http://picforum.ric323.com/viewtopic.php?f=40&t=210
 

large_ghostman

Well-Known Member
Most Helpful Member
The big advantage of pics is package size, dip is easy to bread board etc and they have some good peripherals. The tool chain used to make it easy to learn. ARM is a different beast, if you need pic 32 bit power I would use ARM instead. But 8 or 16 bit pic can have an advantage, coming is a wide range of package. The Sil labs 8051 mini dev boards are ace, they come with a usb mini jtag programmer that the dev board card slots into.

I think its worth learning pics, and they are good for most things. But ARM is also worth a try.
 

DerStrom8

Super Moderator
I think its worth learning pics, and they are good for most things. But ARM is also worth a try.
Something to note, many companies will see PIC experience as nearly useless, as PICs are often seen as hobby-only devices (I'm speaking from experience here). Sure, it'll help to demonstrate that you have experience with embedded systems, programming, etc, but experience with ARM is much more valuable and it looks better on a resume.
 

large_ghostman

Well-Known Member
Most Helpful Member
Something to note, many companies will see PIC experience as nearly useless, as PICs are often seen as hobby-only devices (I'm speaking from experience here). Sure, it'll help to demonstrate that you have experience with embedded systems, programming, etc, but experience with ARM is much more valuable and it looks better on a resume.
This is a full circle thing.

Go back five years ago on here in the micro section, we were talking about pics being in toasters and cars. the arduino was seen as a toy or at best something to start learning softly on. ARM was more for specific high end applications. In many ways back then the pic was taking over from the 8051 type jobs.

Fast forward to today..............

Pics didnt keep pace, they dont have the low power technology of many chips. Yes you can get XLP, but take a standard Sil Labs ARM core M3, it has a program within the IDE to monitor the power consumption. Even with the LCD's they use on the boards, you can get the LCD on and the chip say telling the time or whatever and the chip is drawing <10uA. Put it in deep sleep mode and your under 1UA.

Sounds far fetched but I have what they call the badger board, its literally like a name badge with dev board on. Its run from a 1 or 2F super cap and charge it up from the USB. 20 mins on the USB and you can have a scrolling message for 24 hours, the chip is an older type and far from the most energy efficient. But the boards also have a special light sensor, so when two badges 'meet' they can exchange information via the sensor, you still get >15 hours use from a 20 min USB charge.


The biggest give away is PICS still have DIP package option, ARM chips that are super low power by default have to be small, mainly because of the micro thing gold wires etc, and need to keep inductance down etc etc etc. So ARM has come down in price, it has alot of power, its efficient, and best of all the code is totally transportable because code for a M3 Core is code for a M3 core, dosnt matter who makes the actual chip.

Arduino has gone from the toy world, and now sits more in the rapid Development sector. Yes you can do almost anything with it, but its more proof of concept, from that I guess you then move the product to ARM. But personally I think Arduino is where the pic used to be, its so easy for a hobbyist to do an advanced project by just bolting boards onto the Arduino and so much code around for it.

Toasters I notice now tend to have the newer 8051 chips in, these now come with as many, and sometimes many more peripherals on than any 18f or 24f pic.

So for me I would say, if your a hobby person or making your own boards or using verio board, then pics are attractive because of the SMD or DIP options, they do a good job and for alot of things make sense. Industry wise I would say newer 8051 and difenately ARM, but not so much the CORTEX M0 core, this I think is pretty much EOL. I see alot of Cortex M3 -M4 around, but learn any ARM core and its not hard to switch to another Core..........

I still see Arduino as a toy, but thats personal bias and dosnt reflect the reality thats its moved on.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top