开发者

Simulating Circuits and Programming Micro-controllers over Linux

开发者 https://www.devze.com 2023-03-05 10:16 出处:网络
I\'m about to go through a Micro-Co开发者_如何学Cntroller project which controls a robotic arm. My problem is that @ MS Windows there are MikroElectronica (IDE: MicroC) compile .c to Hex put the hex i

I'm about to go through a Micro-Co开发者_如何学Cntroller project which controls a robotic arm. My problem is that @ MS Windows there are MikroElectronica (IDE: MicroC) compile .c to Hex put the hex in Proteus and simulate. Then using a special (PCB) Kit with CD (carries windows software) I would put the microchip and install the hex file or what ever.

First all the respect to Ms but I just hate it! I adore Ubuntu/linux and open-source I need from the experts to tell me in "Steps" how to do the previously mentioned in linux with minimal complications.

The Electrical and Mechanical Engineers along with me always brag about Ms is easy. I want to show them how Computer Science guy uses open-source technology and how strong and reliable it is.

Please help !


You wish to demonstrate the power of Linux by trying to run products designed for another operating system on it? Chances are those tools may work in Wine.

Or maybe you can use Hi-Tech C as a compiler and try gEDA for simulation. It is also possible to compile Microchip C30 on Linux if you are working on 16-bit PIC:s. In any case, this may not be as easy as using the out-of the-box Windows tools. It will be more educational, nevertheless.


If you can be flexible and opt for AVR then you will have free GCC compiler and programming tools. All open source and Linux/Mac friendly. More info at www.avrfreaks.com.


Here is a compiler, linker and simulator tutorial for PIC on linux. Here is one that uses SDCC c compiler. Google throws out lots of websites when you search for linux pic.


From my side, I cross-compile and program Microchip dsPIC from Linux but it is not really straightforward. Here are the big steps

First I built the C30 toolchain from Microchip sources (you need to apply a few patches on the given sources for it to compile). Once you have the toolchain binaries, you will need to have the specific Microchip MCU resources. Those are coming with the C30 installation on a win32. I copied those files from the Windows installation folder onto my linux filesystem. Here you should be able to compile and link some C & ASM code to a hex file through command line.

Second step, I wanted to build my projects within the Eclipse IDE. To do that we "just" had to write a couple makefiles to call our new C30 toolchain.

Third step, program the .hex onto your microchip MCU. Two ways to do it. If you have a Pickit2, Microchip provides a command line tool to play with it. I personally have an ICD2 programmer. I use the command line tool provided in the Piklab project.

Now I don't have any facility to debug with my ICD2 under Linux. Now Microchip provides an alternative IDE with "Mplab X" which is based on Netbeans (sick) and should work under Linux and MacOS. But this project seemed to be yet under development, I don't know if it is really usable.

0

精彩评论

暂无评论...
验证码 换一张
取 消