What is the Best Micro-Controller for a Beginner to Use for Coding in C?

  • Thread starter Thread starter Yportne
  • Start date Start date
  • Tags Tags
    Micro
Click For Summary

Discussion Overview

The discussion revolves around selecting a suitable micro-controller for beginners interested in coding in C. Participants explore various options, programming languages, and development tools while addressing the needs of a novice user looking to perform basic computing tasks and data storage.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant inquires about the possibility of running C code directly on a micro-controller versus needing to use assembly language.
  • Another participant suggests that many micro-controllers, such as PICs or AVRs, can be programmed using freely available C compilers.
  • A participant mentions the C Stamp as a potential option for beginners.
  • Concerns are raised regarding the high startup costs associated with development kits for PIC micro-controllers, prompting questions about alternative approaches like using a breadboard and a programmer.
  • One participant recommends Picaxe chips as a cost-effective alternative for those who can program in Basic, highlighting their simplicity and low cost.
  • Discussion includes the availability of various programming tools, such as the PicKit for PICs and AVRISP for ATMEGA chips, along with their associated costs.
  • A participant expresses interest in the PIC16F1937 and questions the sufficiency of its 14kB program memory for simple projects.

Areas of Agreement / Disagreement

Participants express a range of opinions regarding the best micro-controller options for beginners, with no clear consensus on a single best choice. There are differing views on the necessity and cost of development kits versus simpler programming setups.

Contextual Notes

Participants reference specific tools and programming environments, but there are limitations in terms of understanding the specifications and capabilities of various micro-controllers. The discussion does not resolve the complexities of programming languages and hardware compatibility.

Who May Find This Useful

Beginners in micro-controller programming, hobbyists exploring electronics, and those interested in learning C programming in the context of embedded systems may find this discussion beneficial.

Yportne
Messages
21
Reaction score
0
hey guys...i'm looking for a micro-controller to toy around with. I'm a newbie so bare with me with a couple newbie questions...Is their a micro that can run straight c code or do I have to do it in assembly?

I need it to be able to store a little bit of data much like a variable stores data...only a few kilobytes worth.

I also need to to be able to do simple computing on the data much like a basic C program could do with logic operators and basic I/O with other parts.

Does this make sense or am I a little lost? I've found many micro controllers but I don't understand their spec sheets and I can't find their assembly data sheet that shows me how to code them :(I bought and complete a micro-controller education kit that showed me how to code a basic stamp...so I'm kind using that as my basis for micro-controller knowledge. With a stamp I can move a servo, light up LED's change how fast they blink etc.
 
Engineering news on Phys.org
Yportne said:
hey guys...i'm looking for a micro-controller to toy around with. I'm a newbie so bare with me with a couple newbie questions...


Is their a micro that can run straight c code or do I have to do it in assembly?

I need it to be able to store a little bit of data much like a variable stores data...only a few kilobytes worth.

I also need to to be able to do simple computing on the data much like a basic C program could do with logic operators and basic I/O with other parts.

Does this make sense or am I a little lost? I've found many micro controllers but I don't understand their spec sheets and I can't find their assembly data sheet that shows me how to code them :(


I bought and complete a micro-controller education kit that showed me how to code a basic stamp...so I'm kind using that as my basis for micro-controller knowledge. With a stamp I can move a servo, light up LED's change how fast they blink etc.

All you need is to get a C compiler for the uC that you want to use, and obviously choose a uC that has enough memory for the data storage that you intend.

I think we discussed C compilers for the PIC uCs in a thread a while back. I'll see if I can find it with a search...

Welcome to the PF, BTW!
 
Yportne said:
I bought and complete a micro-controller education kit that showed me how to code a basic stamp...so I'm kind using that as my basis for micro-controller knowledge. With a stamp I can move a servo, light up LED's change how fast they blink etc.

The basic stamp is actually a PIC uC with an interpreter so that you can use PBASIC. PICs or AVR uC can all be programmed very easily using (freely) available C compilers.

Have you looked at the C Stamp?
http://www.c-stamp.com/index2.htm
 
Last edited by a moderator:
berkeman said:
I think we discussed C compilers for the PIC uCs in a thread a while back. I'll see if I can find it with a search...

Here is one thread I was thinking about:

https://www.physicsforums.com/showthread.php?t=178088

And here is the search that I used to find it (Advanced Search for the word compiler in any of my posts in the EE forum:

https://www.physicsforums.com/search.php?searchid=1924715

That hit list may give you other ideas...
 
Last edited by a moderator:
Hey guys thanks for the replys!

But I have another question. In that other thread posted above they mentioned they were straying from pic's because of the start up cost being say $200 or more for a dev-kit.

Can you not just buy a pic, download a compiler and attach it to a breadboard? What is a dev-board? Is that the little circuit board that my basic stamp came with that has a serial port hooked to it to load up your code?

Do i need a dev kit for each different pic or is their one kit per family of uC's?
 
If you don't need great speed and can program in Basic, have a look at Picaxe chips.
The language is very much like the Stamp but the chips are nowhere near as costly.

The chips cost about $5 to $20 (depending on type) and the programming editor is free. The cable from your computer costs about $10 to make or you can use an old serial mouse cable. It only uses 3 wires.

The chips have an impressive range of tools built in and they are very simple to get going. Lots of fun too.

Have a look at :
http://www.phanderson.com/picaxe/
if you are in the USA

Get the free software and chips from :
http://www.rev-ed.co.uk/picaxe/

These chips just go in normal IC sockets so you don't need the expensive "development kits". Just wire them up yourself.

The chips still have the original PIC numbers on them, but the bootlooader let's you do easy programming without the bit bashing of assembler. They cost about the same as the original chips because of bulk buying.
The serial bootloader is not available though. That is Rev-Ed's property.
Easy programming reduces development times so serious programs can be produced very quickly.

Here is a typical fragment of code from a NiMH battery charger program. The comments at the right are ones I just added.:

Start: '...label

Readadc10 0,w1 '...read the 10 bit ADC port

pause 1000 '....wait one second
high portc 5 '.....put 5 volts on one pin
pause 1000 ' .....wait one second
low portc 5 ' ....put 0 volts on the same pin

if w1>1000 then start '...check for overvoltage

w3 = w1*49/100 '...integer arithmetic

You could have a look at this earlier post:
https://www.physicsforums.com/showpost.php?p=2314873&postcount=14
 
Last edited:
Yportne said:
Hey guys thanks for the replys!

But I have another question. In that other thread posted above they mentioned they were straying from pic's because of the start up cost being say $200 or more for a dev-kit.

Can you not just buy a pic, download a compiler and attach it to a breadboard? What is a dev-board? Is that the little circuit board that my basic stamp came with that has a serial port hooked to it to load up your code?

Do i need a dev kit for each different pic or is their one kit per family of uC's?

A full dev kit (with simulator, in circuit debugging / emulation) will be costly (usually in the $200 to $400 range, IIRC) However, programmer-only arrangements are a lot cheaper (around $50), especially those that use in-circuit programming (TIP: buy a breadboard).

Microchip has the PicKit 2 or PicKit 3 which program the majority of their chips (see the documentation for specifics). MPlab is free, but C compilers for PIC are not (the official Microchip ones are free for student use, but lose a little of their optimization after the trial period).
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en023805&part=DV164120

ATMEL has the AVRISP mkII, which likewise programs the majority of their chips (again, see the documentation for specifics). There is a free (and widely-used / supported) GCC port available (unlike PICs, which were designed to be programmed in assembly, ATMEGAs were designed to be programmed in C)
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3808

These programmers are available at DigiKey, Mouser, and the likes. Probably not the 'Shack, however. You can buy more 'universal' programmers on eBay, but quality / compatibility / support varies a great deal. You can buy something like the Xeltek (which actually will work and program a huge number of chips), but will set you back a grand or two.
 
Last edited by a moderator:
Hey guys I've done some toying around. I managed to obtain mplab along with a c-compiler so i think i'll toy around with some PIC's.

I'm eyeballing the PIC16F1937. It only has 14kB of program memory, is that a pretty simple program or does the program condense when it's compiled to machine language? I'm wondering how much you can do with 14kB as i haven't really made a micro-controller program before...
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 21 ·
Replies
21
Views
25K
Replies
1
Views
4K
Replies
2
Views
1K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 41 ·
2
Replies
41
Views
7K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K