Thread: Microcontrollers in C

  1. #1
    Registered User
    Join Date
    Dec 2008

    Microcontrollers in C

    Okay, it's been a while, and this time, i'm going to need opinions, so please help me with this one!

    - How do you actually program a microcontroller? Does it involve connecting circuit to PC?
    - What's the best compiler for this kind of case?
    - Will i be programming each component one at a time or a circuit as a whole?
    - What's a good book or tutorial for this kind of programming?
    - Can anyone share an experience involving this kind of programming? (maybe some tips, i'm a beginner and only know c a little bit)

    I think that's it for now, i am looking forward your answers, thanks.

  2. #2
    Join Date
    Oct 2007
    Inside my computer
    For your 2nd question, I believe it depends on what type of microcontroller it is. There are obviously different compilers for different systems.
    So you might want to say what kind of microcontroller it is and some may know a compiler for it.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Farncombe, Surrey, England
    The term microcontroller (uC) is used to describe a microprocessor that has built-in peripheral devices, such as I/O ports, memory controller(s) and other devices that you may need to build a small computer. There are tiny 8-bit micro-controllers, and there are bigger 32-bit microcontrollers. This chip is often used to build a small SBC (Single Board Computer), which has a minimum of memory (RAM and ROM) and some connectors that allow the SBC to communicate to the rest of the world.

    None of your questions can be answered with a single answer that covers ALL microcontrollers.

    Some connect to a PC, others you write your program on a PC, then use a ROM/FLASH programming device to store the program in a ROM, which is then plugged into the computer board.

    As Elysia already said, different microcontrollers use different compilers. The very minimal requirement is that the microcontroller is supported by the compiler. Without knowing what model of microcontroller, it is impossible to say which compiler(s) are available for it. Most uC manufacturers have a web-page with "recommended sets of tools", including compilers.

    What you will be programming depends on the board-design. Normally, there is one processor and then some peripheral (I/O) devices, such as serial ports, LED/LCD display. Some even have proper VGA or Text console output.

    Sharing experience is again very dependant on EXACTLY what you will be doing - unless you expect me to actually write down everything I've learnt when working 15 or so years with various forms of uC stuff. And then you would have to digest the "braindump", much of which is highly unlikely to help you.

    The more specific your questions, the more likely it is that you get a proper answer. Open-ended questions like these are nearly impossible to answer.

    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #4
    Registered User
    Join Date
    Dec 2008
    I also thought that my questions are not specific, forgive me for that. But it is because, i have not even touched the microcontroller yet, i was given information about electronic devices first before using the microcontroller in C.

    Anyway, thanks for the replies, i think i'll ask more once i get my hands on the microcontrollers.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Programing microcontrollers in c
    By gorabhat in forum C Programming
    Replies: 2
    Last Post: 09-09-2008, 10:40 AM
  2. Starting with microcontrollers
    By KONI in forum Tech Board
    Replies: 15
    Last Post: 05-13-2007, 03:25 AM
  3. Embedded microcontrollers?
    By confuted in forum Networking/Device Communication
    Replies: 2
    Last Post: 02-09-2006, 03:28 PM
  4. C Programming for Microcontrollers
    By CB4 in forum C Programming
    Replies: 4
    Last Post: 03-07-2005, 08:34 AM
  5. 8051 microcontrollers
    By ygfperson in forum Tech Board
    Replies: 5
    Last Post: 12-02-2002, 12:29 PM