Continue to Site

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.

  • 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.

Embedded code

Status
Not open for further replies.

toprank

New Member
Is Embedded C/C++ learning different from C/C++?

I am confused on which one I should be studying for microchips.
 
I would advise that you learn standard C first. Embedded C is only slightly different and the differences are more to do with the hardware limitation than anything else. What hardware do you have to run the programs?

Mike.
 
I would advise that you learn standard C first. Embedded C is only slightly different and the differences are more to do with the hardware limitation than anything else. What hardware do you have to run the programs?

Mike.

I have a junebug on the way.
 
Last edited:
I have a junebug on the way.

I would start searching for an IDE that supports the µC you'll be working with (Try to get one that comes with a debugger). Learn on that, so that while you learn C, you are also learing about your chip. Makes sense? I'm not familiar with Junebug, but have seen it mentioned quite often. Is it for Windows apps or embedded?

What µc will you be using? Depending on what it is, there may be a free IDE you can download. If not an IDE, than maybe a compiler. "Embedded C" is a misnomer in that there is only one C that I know of. You have different flavors, but for the most part they are the same. The biggest difference will probably be in the use of the library. You may use different libraries for a windows app. then for an embedded app, for instance.
 
Last edited:
Junebug (PICKIT 2) is a PIC Programmer / debugger, Onboard tutor support for either 16F88 or 18F1320, Supports both MPLAB IDE 8.x and standalone PICKit2 software.



I would start searching for an IDE that supports the µC you'll be working with (Try to get one that comes with a debugger). Learn on that, so that while you learn C, you are also learing about your chip. Makes sense? I'm not familiar with Junebug, but have seen it mentioned quite often. Is it for Windows apps or embedded?

What µc will you be using? Depending on what it is, there may be a free IDE you can download. If not an IDE, than maybe a compiler. "Embedded C" is a misnomer in that there is only one C that I know of. You have different flavors, but for the most part they are the same. The biggest difference will probably be in the use of the library. You may use different libraries for a windows app. then for an embedded app, for instance.
 
Junebug (PICKIT 2) is a PIC Programmer / debugger, Onboard tutor support for either 16F88 or 18F1320, Supports both MPLAB IDE 8.x and standalone PICKit2 software.

Well, now I know what I need when I start working with PICs.:)
 
Pommie is correct.

It is easier to learn C then apply it to the embedded processor. It may be painful to leave the Junebug sit while you learn C but it is the best way to do it.

I have tutorial that is very detailed on understanding what goes into a C program for the Junebug. See my homepage link in my signature.
 
Last edited:
Pommie is correct.

It is easier to learn C then apply it to the embedded processor. It may be painful to leave the Junebug sit while you learn C but it is the best way to do it.

I have tutorial that is very detailed on understanding what goes into a C program for the Junebug. See my homepage link in my signature.

I've found, through my own experience, that learning a programming language based on an embedded processor is the way to do it. There really isn't that much difference between the two as far as the programming language goes. If you never will be working with Windows apps, why bother? True, learning C for Windows or DOS base apps has it' advantages, but there are many library functions he will never use with an embedded application. My point was, he can become more familiar with his IDE while learning C at the same time. But that' just me. I'm a quick study a learn faster by doing it that way but he will need to go with what works best for him.
But on the plus side, it could give him a broader view of C and it's capabilities. But personally, if I needed to use Windows for anything, it would be in VB.
 
Neither Mike/Pommie or I suggested the user learn windows API or go deeply into the libraries.

I teach high school students to program PICs in C and I do as you suggest. But I would rather have them learn C outside the embedded environment first. It is a bit tricky not to overload them with both at the same time. Without an instructor it is easier to do C first.

You may want to look at C# on the PC instead of VB.

I've found, through my own experience, that learning a programming language based on an embedded processor is the way to do it. There really isn't that much difference between the two as far as the programming language goes. If you never will be working with Windows apps, why bother? True, learning C for Windows or DOS base apps has it' advantages, but there are many library functions he will never use with an embedded application. My point was, he can become more familiar with his IDE while learning C at the same time. But that' just me. I'm a quick study a learn faster by doing it that way but he will need to go with what works best for him.
But on the plus side, it could give him a broader view of C and it's capabilities. But personally, if I needed to use Windows for anything, it would be in VB.
 
Last edited:
I also, would endorse the following advice.

I would advise that you learn standard C first. Embedded C is only slightly different and the differences are more to do with the hardware limitation than anything else. What hardware do you have to run the programs?

Mike.

In addition, I would learn your micro controller hardware, and how it works using assembler so that when things don't happen as you expect, you will be able to figure out what is going wrong. (check out Nigel's tutorials at or the Elmer 160 course at https://www.amqrp.org/elmer160/lessons/index.html)

I don't know why some people respond to something which is clearly outside of their range of knowledge, or experience. The mention of a Junebug should have been enough, on this board, to communicate the OP is using the PIC micro.

In addition, debugging cross compiled apps is quite different than debugging when the source is compiled on the hardware for which it is written.

The flavors of C which are used for different processors, while all C, do use some pretty different conventions, and trying to learn C with such limited hardware would be difficult and confusing, and what you learn on one platform would not necessarily apply to another platform.
 
  • Like
Reactions: 3v0
I also, would endorse the following advice.

I don't know why some people respond to something which is clearly outside of their range of knowledge, or experience. The mention of a Junebug should have been enough, on this board, to communicate the OP is using the PIC micro.

That's why I asked about Junebug.:) Besides, this wasn't about what development software he has, it was about how best to learn C. I could care less what IDE I am using, and I've used a few. For me, it's just easier to apply to the application learning the platform as I go. I thought I made that clear. I'm just leaning on my experience here and told him what "I" think. You may not agree with it, and that's fine. It seems the general consensus is to learn standard C first.

Toprank,

Go with the crowd on this one.
 
anyone know of a C/C++ dictionary?

example:

these are statements

break
case
catch
continue
default
do
else
__except
for
goto
__finally
if
__if_exists
__leave
return
switch
throw
__try
try
while

these are directives
#define
#include
#error
#if
#elif
#else
#endif
#ifdef
#ifndef
#import
#line
Null
#undef
#using


I am trying to get familiar with the terms and what they are used for. I wrote the above on flash cards.

what other components?
operators
control flow
functions
pointers arrays
variables


thanks
 
I would get a C programmers handbook. Something really basic. Maybe "C for Dummies".
http://www.c-for-dummies.com/

You don't want just a dictionary. You want something that better explains the keywords and has examples. "Sams C Primer" is a good resource. Go to your local library. You should find a lot of resources there.
 
In addition to the good advice of Rezer, I would recommend "The C Programming Language" - Second Edition - by the inventors of the language Dennis Ritchie, and Brian Kernighan.

There are also some free sources: If you download a demo compiler and view the help file... I like Source Boost -
http://www.sourceboost.com/Products/BoostC/Overview.html
but I think the CCS help file is also quite good but you do have to answer some questions before downloading -
http://www.ccsinfo.com/demopoll.php
and there are lots of references on the net:
http://www.cprogramming.com/reference/
 
I would get a C programmers handbook. Something really basic. Maybe "C for Dummies".
http://www.c-for-dummies.com/

You don't want just a dictionary. You want something that better explains the keywords and has examples. "Sams C Primer" is a good resource. Go to your local library. You should find a lot of resources there.

WOW, this book "Sams C Primer 5th Ed" is great @@ thanks rezer!


In addition to the good advice of Rezer, I would recommend "The C Programming Language" - Second Edition - by the inventors of the language Dennis Ritchie, and Brian Kernighan.

There are also some free sources: If you download a demo compiler and view the help file... I like Source Boost -
**broken link removed**
but I think the CCS help file is also quite good but you do have to answer some questions before downloading -
http://www.ccsinfo.com/demopoll.php
and there are lots of references on the net:
http://www.cprogramming.com/reference/

I will look into this.
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top