Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: 555 timer chip guy on April 30, 2007, 08:29:52 AM

Title: Microcontroler help
Post by: 555 timer chip guy on April 30, 2007, 08:29:52 AM
what determines what a microcontroller can be programed in.
Title: Re: Microcontroler help
Post by: Hal9000 on April 30, 2007, 09:23:12 AM
Hey dude, check out this:

http://www.arduino.cc/ (http://www.arduino.cc/)

If i were to start my robotics journey again, here is where I would start

Look at all the lovely, ready to use tutorials:

http://www.arduino.cc/en/Tutorial/HomePage (http://www.arduino.cc/en/Tutorial/HomePage)

*drool*
Title: Re: Microcontroler help
Post by: nanob0t on April 30, 2007, 11:07:44 AM
Hey dude, check out this:

http://www.arduino.cc/ (http://www.arduino.cc/)

If i were to start my robotics journey again, here is where I would start

Look at all the lovely, ready to use tutorials:

http://www.arduino.cc/en/Tutorial/HomePage (http://www.arduino.cc/en/Tutorial/HomePage)

*drool*


That's pretty neat.

I don't think anything really determines what a microcontroller is programmed in.  The microcontroller is just a piece of hardware with electronics in it.  A manufacturer just creates the chip and chooses a programming language to program their chip in and specifies in it.  The PICs are capable of being programmed in a few languages, but it's very very costly. 

I'm not too sure about this, but it's mostely just a manufacturer's decision.  Though, there may be something within the chip that only allows it to understand one language.  I don't know.  I wouldn't go trying to messing with hacking them, although it's probably possible.

It would be worth looking into though.

If you find anything out, I am interested in seeing it.
Title: Re: Microcontroler help
Post by: dunk on April 30, 2007, 11:16:11 AM
hey 555 timer chip guy,

so pretty much all microcontrollers can be programmed in some sort of machine code or assembly language.
most microcontrollers have some sort of interpreter that can convert some other higher level language into machine code for that microcontroller.

so in answer to your initial question, somebody needs to write an interpreter from your desired language to the machine code your microcontroller can understand.
then you run your code (written in C or Basic or something like that) through the interpreter.
the interpreter converts it into machine code that your microcontroller can understand and run.

sometimes an interpreter is provided by the microcontroller manufacturer. (eg. AVRs.)
sometimes it is sold by 3rd part companies. (eg. PICs.)
sometimes you can find an open source one. (eg. GCC for AVRs along with many other platforms.)

it is possible to write your program directly in machine code if you want but it will take a bit longer.

dunk.
Title: Re: Microcontroler help
Post by: 555 timer chip guy on April 30, 2007, 12:06:41 PM
thank you
Title: Re: Microcontroler help
Post by: Admin on April 30, 2007, 04:33:45 PM
yea what dunk said.

to simplify, you can program in any language you want.

you just need a compiler that changes what you write into machine code that is readable for the particular microcontroller you want. that machine code is determined by the manufacturer.

any language -> compiler -> machine code

you just need to find a compiler that works with your perfered language
Title: Re: Microcontroler help
Post by: 555 timer chip guy on May 01, 2007, 08:27:36 PM
yea what dunk said.

to simplify, you can program in any language you want.

you just need a compiler that changes what you write into machine code that is readable for the particular microcontroller you want. that machine code is determined by the manufacturer.

any language -> compiler -> machine code

you just need to find a compiler that works with your perfered language
but how do you find out what mechanical code the microcontroller is programed in.
Title: Re: Microcontroler help
Post by: Admin on May 01, 2007, 08:32:28 PM
Quote
but how do you find out what mechanical code the microcontroller is programed in.
every single microcontroller is different.

instead, check the compiler and see if it lists your microcontroller number specifically. you will have to configure your compiler to work with that microcontroller before compiling, anyway :P