chipKIT® Development Platform

Inspired by Arduino™

Newbie coming from C#, Visual Studio, .Net Micro Framework

Created Sat, 04 May 2013 06:16:34 +0000 by SkierHiker


SkierHiker

Sat, 04 May 2013 06:16:34 +0000

I'm brand spanking new to the chipKit, Arduino, C, MPIDE, MPLAB X development environment. I'm coming from 10 years of C#, Visual Studio, and 5 years of working in the .Net Micro Framework on GHI boards. I have a product that I'm converting from the GHI board to a chipKit Max32. The firmware is written entirely in C# and the .Net Micro Framework. It consists of 15 classes that include support for CAN, Bluetooth, LEDs, Watchdog, Persistent Storage, Messaging, etc. I'm looking for advice on how best to start on this effort.

Here is what I've done so far.

  1. Purchased the chipKit Max32 and the chipKit Programmer
  2. Downloaded MPIDE, MPLAB X, and the MPLAB XC32++ Compiler

My plan is the following:

  1. Take a crash course in C++.
  2. Convert all my C# classes to C++ via a converter.
  3. Find or write the .Net Framework classes I'm using.
  4. Test the classes individually if possible.
  5. Combine them into a "project" and see what happens.

So here are some questions and advice I would really appreciate some help with:

  1. Is my plan a good one?
  2. Can I run C++ code on the Max32. My research suggests I can.
  3. Has anybody migrated code from .Net to the Max32 (Arduino) platform?
  4. What is the best IDE to use considering I'm a Visual Studio kind of guy?
  5. Where is the best place to get my feet wet? I learn best by sample programs that I can modify and tweak.
  6. Are there other forums that I should join?

Thanks - Mark.


majenko

Sat, 04 May 2013 17:26:10 +0000

I'm brand spanking new to the chipKit, Arduino, C, MPIDE, MPLAB X development environment. I'm coming from 10 years of C#, Visual Studio, and 5 years of working in the .Net Micro Framework on GHI boards.

You poor poor thing. Still, we shouldn't mock the afflicted... ;)

I have a product that I'm converting from the GHI board to a chipKit Max32. The firmware is written entirely in C# and the .Net Micro Framework. It consists of 15 classes that include support for CAN, Bluetooth, LEDs, Watchdog, Persistent Storage, Messaging, etc. I'm looking for advice on how best to start on this effort.

Good luck.

Here is what I've done so far.

  1. Purchased the chipKit Max32 and the chipKit Programmer
  2. Downloaded MPIDE, MPLAB X, and the MPLAB XC32++ Compiler My plan is the following:
  3. Take a crash course in C++.

Essential.

  1. Convert all my C# classes to C++ via a converter.

Better: write the classes from scratch in C++, then you will get a great feel for class programming, C++ and the hardware you are programming for. Also, there may already be classes / libraries around for some of the things you're working with.

  1. Find or write the .Net Framework classes I'm using.

See 2.

  1. Test the classes individually if possible.

Write each one as a completely separate library, then you can debug them individually and include them at will into your program.

  1. Combine them into a "project" and see what happens.

Duck And Coverâ„¢

So here are some questions and advice I would really appreciate some help with:

  1. Is my plan a good one?

Reasonable. You are rather leaping in head first with this project...

  1. Can I run C++ code on the Max32. My research suggests I can.

Yes. The compiler is gcc / g++.

  1. Has anybody migrated code from .Net to the Max32 (Arduino) platform?

Probably, but not me.

  1. What is the best IDE to use considering I'm a Visual Studio kind of guy?

There is a chipKIT on X-Code project for the Mac - look around on this forum for more info. Also, people have managed to get the Arduino working in Visual Studio - no idea how (or why?!), so the same should be possible with the chipKIT toolchain.

  1. Where is the best place to get my feet wet? I learn best by sample programs that I can modify and tweak.

File -> Examples

  1. Are there other forums that I should join?

The microchip forums can be quite helpful if you're having trouble with the hardware ([url]http://www.microchip.com/forums[/url]). There is often quite a delay in getting an answer though.


avenue33

Sun, 05 May 2013 09:36:46 +0000

There is a chipKIT on X-Code project for the Mac - look around on this forum for more info. Also, people have managed to get the Arduino working in Visual Studio - no idea how (or why?!), so the same should be possible with the chipKIT toolchain.

Have a look at embedXcode

There's also the excellent :arrow: Visual Micro plug-in for Visual Studio.


Jacob Christ

Sun, 05 May 2013 09:37:36 +0000

I live with one foot in Visual Studio (VB.NET Mostly) and the other embedded PIC devices. I'll follow this thread as well to provide any assistance.

I do have a question though, why are you changing platforms? Is there something lacking in the previous one that you expect to be better with chipKIT?

Jacob


SkierHiker

Tue, 07 May 2013 07:14:32 +0000

Have a look at embedXcode

Unfortunately I'm on a Windows platform.


SkierHiker

Tue, 07 May 2013 07:21:50 +0000

There's also the excellent :arrow: Visual Micro plug-in for Visual Studio.

I dug as deep as I could with my little shovel into Visual Micro but couldn't get very far due to lack of knowledge. But sure would appreciate if someone else could figure it out. See this thread. [url]http://www.chipkit.org/forum/viewtopic.php?f=6&t=2236[/url]


SkierHiker

Tue, 07 May 2013 07:32:18 +0000

I do have a question though, why are you changing platforms? Is there something lacking in the previous one that you expect to be better with chipKIT? Jacob

Size and cost mostly. But this learning curve is starting to steepen.


SkierHiker

Tue, 07 May 2013 08:09:34 +0000

Update on my progress:

  1. I was hoping to use Visual Micro but that's not looking very likely so I'm learning MPLAB X.

  2. I'm on this forum, Microchip's forum, MPLAB's forum, Arduino's forum, and Visual Micro's forum.

  3. I played around with converting my C# to C++ and it kinda works but I think I'll be tweaking a lot of it.

  4. I think I'll have to redesign the app since the C# version uses a .Net threading model and I'm not sure I want to attempt that here.

Some more questions:

  1. What's the difference between MPIDE and MPLAB X? I understand that MPIDE is an implementation of the Arduino IDE. Is MPLAB X separate from the Arduino architecture? Is it better?

  2. During my C++ education, I ran into vectors which seemed to take a lot of work out of dynamic arrays. Are vectors supported in the Max32 world? I see that they are not in the Arduino but there are custom implementations.

  3. The two main classes I need examples from are CAN and Serial. I'm hunting them down but if anybody here can help, I'd appreciate it.

  4. Are there any MPLAB sample programs (like flashing a LED) around? I'd like to try compiling, downloading to the board, setting a breakpoint, and other features of MPLAB.

Thanks- Mark.


SkierHiker

Tue, 07 May 2013 08:13:45 +0000

I live with one foot in Visual Studio (VB.NET Mostly) and the other embedded PIC devices. I'll follow this thread as well to provide any assistance. Jacob

Thank you.


Jacob Christ

Thu, 09 May 2013 14:21:28 +0000

Update on my progress:

  1. What's the difference between MPIDE and MPLAB X? I understand that MPIDE is an implementation of the Arduino IDE. Is MPLAB X separate from the Arduino architecture? Is it better?

MPLABX has been the defaco tool offered by Microchip for many years for doing programming and debugging for PIC Microcontrollers. MPIDE is a community project that spun out of the Arduino IDE that can be used for programming chipKIT boards (or PIC32 boards with a chipKIT bootloader).

  1. During my C++ education, I ran into vectors which seemed to take a lot of work out of dynamic arrays. Are vectors supported in the Max32 world? I see that they are not in the Arduino but there are custom implementations.

My guess is yes since chipKIT uses gcc/g++ but I haven't tried.

  1. The two main classes I need examples from are CAN and Serial. I'm hunting them down but if anybody here can help, I'd appreciate it.

Serial is really easy on chipKIT. I've never personally used CAN, but I have taken some classes.


EmbeddedMan

Thu, 09 May 2013 19:07:18 +0000

Jacob, I think the first "MPIDE" in your post should have been "MPLABX".

:-)

*Brian


Jacob Christ

Fri, 10 May 2013 13:58:24 +0000

Jacob, I think the first "MPIDE" in your post should have been "MPLABX". :-) *Brian

Your right of course, I fixed it should someone run across the post.

Jacob