Where to start

Electric-T

Jun 4, 2017
212
Joined
Jun 4, 2017
Messages
212
I want to start getting into microcontrollers. Where is a good place to start? Arduino? And what are some useful languages to know? Ive already started on assembly.
 

kellys_eye

Jun 25, 2010
6,512
Joined
Jun 25, 2010
Messages
6,512
ooooo.....are you trying to start a fight? LOL

There are 'fans' of all forms of micro controllers and each has its pro's and con's.

It will boil down to what you want to do with them - and, to some extent, how you feel about the support that each type attracts. The Arduino support base is massive, as are the applications for it.

Assembly is the 'base' language (other than binary, you can't go any lower) but a lot of modern processors use C (in its many forms) for coding through their respective interpreters and it's very 'portable' between architectures too so consider C (a high level language) as a requirement.
 

Minder

Apr 24, 2015
3,561
Joined
Apr 24, 2015
Messages
3,561
I have never used Arduino but have used Picmicro extensively, if you are not comfortable with assembly you could graduate to C, Both have their plus and minuses.
I tend to have stuck with assembly as that was my original teaching with micro's. PDP8's and 8085 etc.
M.
 

Electric-T

Jun 4, 2017
212
Joined
Jun 4, 2017
Messages
212
ooooo.....are you trying to start a fight? LOL

There are 'fans' of all forms of micro controllers and each has its pro's and con's.

It will boil down to what you want to do with them - and, to some extent, how you feel about the support that each type attracts. The Arduino support base is massive, as are the applications for it.

Assembly is the 'base' language (other than binary, you can't go any lower) but a lot of modern processors use C (in its many forms) for coding through their respective interpreters and it's very 'portable' between architectures too so consider C (a high level language) as a requirement.
;) I find alot of good information comes out of debate. Yes i know assembly is a very low level language but i feel it could be very useful somehow. I think i might study both c and assembly side by side.
 

Electric-T

Jun 4, 2017
212
Joined
Jun 4, 2017
Messages
212
Well i guess i need to do more research but please, all opinions are welcome. One of the reasons i joined the forum is to gain some perspective and learn all i can
 

kellys_eye

Jun 25, 2010
6,512
Joined
Jun 25, 2010
Messages
6,512
Purists will use assembly and there is no more intimate way to program any form of processor than via assembly. It makes for the most compact coding (hence speedy processing) than any other high level language and, being an old fart myself, I was brought up on assembly through the 6502/8088, PICs (the 68705 in particular) so appreciate Minder's thoughts on the matter.

But if you want to talk to other users you have to use their language and for most this will mean C or its derivatives.
 

Electric-T

Jun 4, 2017
212
Joined
Jun 4, 2017
Messages
212
Purists will use assembly and there is no more intimate way to program any form of processor than via assembly. It makes for the most compact coding (hence speedy processing) than any other high level language and, being an old fart myself, I was brought up on assembly through the 6502/8088, PICs (the 68705 in particular) so appreciate Minder's thoughts on the matter.

But if you want to talk to other users you have to use their language and for most this will mean C or its derivatives.
I guess i should experiment a little. Assembly is one i want to know for sure. I guess i was wondering if arduino was a good starter mc. Lets say i wanted to include one in an motion alarm and i wanted to store the times the alarm is triggered and make them accessible via usb.
 

kellys_eye

Jun 25, 2010
6,512
Joined
Jun 25, 2010
Messages
6,512
To do the functions you want - especially accessing USB - you'll struggle doing it with assembly language. This is where high level languages come into their own and, for the Arduino (and others) there will inevitably be library routines that handle the complex parts of the programming to avoid having to re-invent the wheel. Such libraries will also be available in assembly but specific requirements you may have will involve some complex reprogramming that high level languages tend to manage far easier.

Similarly, accessing the Arduino at assembly level won't be easy, PICs are very much more suited to this sort of programming. I could suggest you download the datasheet for the main processors of the various platforms that are commonly used and see for yourself the number of 'commands' they each use. The PIC is very, very capable and has a low instruction set (RISC) making assembly programing a breeze - sort of....

Here's the datasheet for the very common PIC16F84 - a very capable device with many useful examples already across the web.

http://pdf1.alldatasheet.com/datasheet-pdf/view/74975/MICROCHIP/PIC16F84.html

If you want the best from any platform then going it at the register level via assembly will make you a very proficient user.
 

Electric-T

Jun 4, 2017
212
Joined
Jun 4, 2017
Messages
212
To do the functions you want - especially accessing USB - you'll struggle doing it with assembly language. This is where high level languages come into their own and, for the Arduino (and others) there will inevitably be library routines that handle the complex parts of the programming to avoid having to re-invent the wheel. Such libraries will also be available in assembly but specific requirements you may have will involve some complex reprogramming that high level languages tend to manage far easier.

Similarly, accessing the Arduino at assembly level won't be easy, PICs are very much more suited to this sort of programming. I could suggest you download the datasheet for the main processors of the various platforms that are commonly used and see for yourself the number of 'commands' they each use. The PIC is very, very capable and has a low instruction set (RISC) making assembly programing a breeze - sort of....

Here's the datasheet for the very common PIC16F84 - a very capable device with many useful examples already across the web.

http://pdf1.alldatasheet.com/datasheet-pdf/view/74975/MICROCHIP/PIC16F84.html

If you want the best from any platform then going it at the register level via assembly will make you a very proficient user.
Thank you this is exactly what i was looking for
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Yet another option:
https://sourceforge.net/projects/gcbasic/
If using the Synwrite GUI it compiles GCB to pure .HEX and .ASM with a click of a button. Both of which can be made visible in the Synwrite IDE, side by side with the GCB code.

There are lots of vids on Youtube plus a very active forum. GCB does not employ an interpreter as other basic's do, so it doesn't sacrifice speed. You can also find Youtube vids demonstrating GCB speed.

Chris
 

kellys_eye

Jun 25, 2010
6,512
Joined
Jun 25, 2010
Messages
6,512

Doug3004

Sep 5, 2014
119
Joined
Sep 5, 2014
Messages
119
If you stick with the Arduino IDE and the China clone boards, then Arduinos are very cheap and easy to use.

Atmel (the Arduino processor manufacturer) does have a more complex IDE that is a free download:
http://www.atmel.com/microsite/atmel-studio/default.aspx
I've never used it.

C is the usual Arduino language.
IIRC there is a way to use asm but it isn't officially supported. Consult Google.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
14,271
Joined
Nov 17, 2011
Messages
14,271
Atmel (the Arduino processor manufacturer) does have a more complex IDE that is a free download:
http://www.atmel.com/microsite/atmel-studio/default.aspx
I've never used it.
This IDE plus the WINAVR plugin (for GCC) workes great. The libraries avilable are imho considerably less extensive than those available for the Arduino. But the code you can create with the ATMEL studio in C is typically much faster than the code generated by the Arduino IDE. It seems to be mainly a matter of the underlying libraries and the way an Arduino sketch tries to simplify programming for the inexperienced (see e.g. this discussion).

Using C/C++ for the main business logic of a program while resorting to assembler (inline code or a library) for critical operations (speed, memory usage) is a compromise often used.
 

vead

Nov 27, 2011
473
Joined
Nov 27, 2011
Messages
473
I want to start getting into microcontrollers. Where is a good place to start? Arduino? And what are some useful languages to know? Ive already started on assembly.
1. you need development board,
2. compiler to write c or assembly program
3. Programmer software to programmed your code
4. when you will programmed MCU , you need cable to connect PC to micocontroller

personally I use 8501 development board, containing Philips p89v51rd2 MCU. keil complier to write c program and I use flesh magic to programmed p89v51rd2 MCU

test your board with LED blinking project. there are several programs available on internet. than turn on LED using switch. for example if switch is open , turn OFF LED and If switch is closed turn ON LED.
so just do it this things you will get starting points. if do you have any doubt, feel free to ask here.
best of Luck
 

Irv

Jun 7, 2017
112
Joined
Jun 7, 2017
Messages
112
One of the good, and bad, things about microcontrollers (as opposed to full computers) is the huge number of peripherals ( input/output sensors and displays) available for little cost.

The bad part is that information on these (mostly Chinese) parts can be difficult to find, so writing low level code to control them is close to impossible sometimes. Therefore, you have to depend on C code drivers that the manufacturer provides or you can find on the net.

If you're just getting started, forget assembly language, and work with what is available, which is mostly C++.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
14,271
Joined
Nov 17, 2011
Messages
14,271
The bad part is that information on these (mostly Chinese) parts can be difficult to find,
Huh?
AVRs, PICs are common and documentation is readily available as well as an active online community for these parts.
 

Irv

Jun 7, 2017
112
Joined
Jun 7, 2017
Messages
112
I was specifically referring to the peripherals (sensors and displays). Even seemingly identical devices such as simple temp sensors and LCD displays from different companies have different driver requirements. Information is often not available.

For someone just starting out, writing device drivers in assembly language without specs is going to be a bit overwhelming.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
14,271
Joined
Nov 17, 2011
Messages
14,271
For someone just starting out, writing device drivers in assembly language without specs is going to be a bit overwhelming.
Writing code without specs is difficult in any language.
 

kellys_eye

Jun 25, 2010
6,512
Joined
Jun 25, 2010
Messages
6,512
I was specifically referring to the peripherals (sensors and displays).
It's usually easy to find the main controlling device part number on any of those modules and downloading the data sheet for them tells you everything you need to know.

The Chinese don't actually invent the chips - they might fabricate them but the general spec for them is usually available anywhere you care to look. The manufacturers insist on it!
 
Top