SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions on the software and hardware for Atmel's STK standard.
By bluechair84
#111760
I'm wanting to produce my own GPS/GSM tracker, all of the design that I can find on the internet seem to be using AVR processors and I've only experience in C++ - is it possible to do this project with c++ language or am I going to need an alternative chip?
Sorry for the newb question, this will be my first everproject so I've a lot to learn first.
By rrpilot
#111761
Not a stupid question at all.

http://winavr.sourceforge.net/ Can compile C++ code although I recall reading that there may be limitations when using C++, I've never tried it so you would have to just give it a go. Generally with embedded microcontrollers people stick with C because it will compile to smaller code. If I were you I would stick with C unless your planning on using a more powerful microprocessor like an ARM7 or ARM9 that supports Linux. Besides if you are good with C++ then you will have NO trouble picking up C.
By bluechair84
#111765
thanks for the complier, I've dl and installed now. I'll start programming in c++ i think as it will mean I have fewer things to get used to - circuitry and microprocessors will be the next thing I have to learn.
By tecoist
#111782
Just in case it's not immediately obvious, you aren't limited to winavr and Windows as your development platform. The gcc-based tool chain that's pretty much universally used for AVR code development supports C++ (among other things), and of course is quite happy on any Unix-ish platform. Arduino is C++ based, and packages C++ up in a Java IDE, and so on.
By stevech
#111812
I tried, abandoned doing C++ on AVR 8 bitters with WinAVR. Partly my lack of knowledge of C++ for embedded (static everything, no practical way to do malloc()/free() for object creation. Didn't find but one example project in C++ and I couldn't reinstate that. With WinAVR, you have to change the AVR Studio defaults for the compiler's exe name, and/or use these odd file name conventions, such as .c for C code and .C for c++ code, and .cpp is ignored.

Perhaps if I were to use IAR's AVR compiler and examples it would be easier.
By tecoist
#111819
stevech wrote:Perhaps if I were to use IAR's AVR compiler and examples it would be easier.
Arduino gives you a super-simple C++ environment, if you want easy.
By bluechair84
#111826
stevech wrote:Didn't find but one example project in C++ and I couldn't reinstate that.
Having looked around yesterday, I couldn't find any example code for a project like this. I'm only experienced at using C++ to get input/outputs on the screen and keyboard. I wouldn't know how to get inputs from the GSM module... if I use some of the other examples around the net of c coding in GSM/GPS projects I can probably rework it to meet my own requirements.

I'm having second thoughts after having some encouragment about the ease of getting into C with some C++ experience.
By tecoist
#111828
Again, if you'd like examples of how to do almost anything under the sun on an AVR in C++, Arduino is a good place to start. There are libraries you can look at to see how folks deal with moving data in and out of the AVR, if that's your concern.

I'm all in favor of learning new programming languages, though. So if you don't know C and you'd like an excuse to learn it and have fun programming the AVR, sounds like a fine idea to me.
By bluechair84
#111857
ok... next newb question.
I've Arduino referred to a number of times now but haven't worked out what it is...
By tecoist
#111861
SFE has an Arduino buying guide here.

The Arduino folks have a web page at http://www.arduino.cc/.

And the short answer is: a series of little AVR boards with an IDE and C++ library, with a bunch of plug-and-play daughter boards.