Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

About Hardware/embedded Programming

Status
Not open for further replies.

avleo20

Programmer
Jan 3, 2007
3
DE

Hi, Can anybody tell me that would i convert my all embedded C Code in C#. My code is a deep Hardware/embedded Programming code which access the ECU and other electronic devices with C code. Now I want to change it in to C#. So would I get any future problem? Or is it really opossible or not?
 
No more red! That is brutal to look at...

In terms of controlling your embedded hardware, you will need hardware that supports the .net framework or the Compact .net framework. So it would need to be running CE or xp embedded or something very similar. A typical linux distro can be used if it supports the mono framework but it is still in development.

Also: to control the hardware itself, you will likely need to keep some of your old C code to interface with the hardware directly. Then create an API for C# to use in order to operate that hardware using your logic in C#. You can go more low level with C# but it is most likely not worth your time.

I hope that gives you some direction.
 
Hi JurkMonkey,
Thanks for your reply. Ok i wont use red in future ;-). So do you want to say the complete replecement of C code to C# in not possible for hardware interaction. At one or other time i have to go for low level C programming. SO i think that would be a better idea to have a development on C only not to change it to for C#. What do you say?
 
It is possible to go low level in C# in a lot of cases. But you are most likely dealing with a kernel/os written in C or C++ so you will need to interface with it at some point.

I would be tempted to use C# for your logic layer because it is a very clean language unlike C and C++.
 
It is possible to use .net for embedded development, as long as you're running CE or embedded XP (like JurkMonkey said).

But to access registers, send data over ports, etc. you'd still have to drop into C.

So the question then becomes how much of your code interacts with the hardware at a low level, and if that's a lot, does it become worthwhile to use .net at all?

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Yes ChipH,

Thanks for writing. I am also having the same doubt and satisfied with you. Beacuse in my case I interacts with ECU hardware through interaction of C for accessing and filling the register data rapidly. So really is it worth ti use C#.Net? I dont think so....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top