Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 4th October 2007, 03:37 AM   (permalink)
Quan
Default what microcontrollers program in C++

Hi what microcontroller programs in C++ I wanted to know for a teacher who wanted to program chips...

Any series will work as long as C++ works best for it...

Thanks
 
Old 4th October 2007, 04:53 AM   (permalink)
Default

C++ is not suited for microcontrollers as it is too abstract and bloaty. But C is pretty popular.
__________________
--- The days of the digital watch are numbered. ---
kchriste is offline  
Old 4th October 2007, 05:03 AM   (permalink)
Default

For microcontrollers memory is at a premium. Though correctness is valued and C++ helps with correctness, if it doesn't fit, it doesn't work. Even C can produce bloated code, but there's less waste when you try to reduce memory consumption by sharing as much as you can. That is, forget protection, forget object orientation... do it right the manual way, and make it small.

If you're dealing with embedded computers, then there's a lot more memory to work with, and hence c++ may be a proper solution.

(I've never tried writing a C++ program for AVR with g++, it's possible that it would work perfectly fine, though...)
boxer4 is offline  
Old 4th October 2007, 05:29 AM   (permalink)
Default

Quote:
Originally Posted by Quan
Hi what microcontroller programs in C++ I wanted to know for a teacher who wanted to program chips...

Any series will work as long as C++ works best for it...

Thanks

If you're using PIC Microcontroller, I would suggest HiTec PIC C. It'll make programming much easier once you get used to the program. You can down load student version (or PICCLITE) from HiTec site. You can do some serious programming even with student version. It works best with MPLab, also can be down loaded from Microchip.
Wingmax is offline  
Old 4th October 2007, 05:44 AM   (permalink)
Default

Quote:
Originally Posted by boxer4
For microcontrollers memory is at a premium. Though correctness is valued and C++ helps with correctness, if it doesn't fit, it doesn't work.
Not just the size of the memory, the complexity of the stack possible on a microcontroller does not jive with the way C++ destroys objects to reclaim memory. Even some C features like a pointer to a function don't jive with a microcontroller's capabilities, although the complier will still let you do it it may be inefficient.
__________________
I thought what I'd do was I'd pretend I was one of those deaf-mutes.
Oznog is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Please help!! program not working vinke Micro Controllers 3 5th October 2007 05:59 AM
First Program in assembly, And Programmer Inchworm. Ayne Micro Controllers 10 9th March 2007 08:27 PM
program for writing and testing circuits luca-deltodesco General Electronics Chat 3 13th August 2006 11:17 AM
little help with my program please - simple count loop kud0s Micro Controllers 5 7th July 2005 10:40 PM
PicBasic Keypad program Sora Micro Controllers 0 20th April 2004 08:02 PM



All times are GMT. The time now is 08:24 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker