Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to choose a microcontroller and what kind of programming is the best to use

Status
Not open for further replies.

dann11

Full Member level 3
Joined
Oct 22, 2015
Messages
166
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,742
I am kinda new in microcontroller, it is still quite hard for me to choose what kind of microcontroller should I used. I find it hard to understand some of its characteristics like for example, the ADC resolution, the MAC operation. And which program is better used in microcontrollers?

Thanks in advance.. :)
 

hi,
first you need to know requirements like : does it have to measure some voltage(/voltages) ? yes=> i need ADC , no=> don't need ADC,
Does it have to do many calculations and lot of instructions? yes => i need high cpu frequency , no => don't need .... how many input/output circuits i need? ..... and so on .you have to be more specific
Of course high level language programming like C is the best option .The program itself is offered for free by the producer of the microcontroller
 
  • Like
Reactions: dann11

    dann11

    Points: 2
    Helpful Answer Positive Rating
Hi,

additionally...

what do you want to connect?
What interfaces do you want to use?
What periferals do ou need?

For sure there is a lot to read. And to be true I don´t you find the perfect solution at once. It is an developing process.

But i´d say: don´t worry too much. Select a modern architecture microcontroller.
Look for a starter kit and look what cheap modules and periferals are available at ebay or other stores...
Buy one that seems to be Ok and start working. Maybe you find it good, maybe you choos another controller as next step. But it will give you experience.

Also look for forums dedicated to your microcontrollers and read through them.

Good luck

Klaus
 
  • Like
Reactions: dann11

    dann11

    Points: 2
    Helpful Answer Positive Rating
The Atmel AVR series is very user friendly. It has a lot of cheap development kits available including the Arduino stuff. It also has a lot of support on the web and free good quality development tools.

PIC has some offerings as well but i do not think to the extent of the AVR.

C language is the most standard and supported, but you can usually find a compiler for just about any language for micros and it is harder to get support for these other languages.

AVR freaks is a huge Atmel site.

Here is one site that has AVR and PIC development boards.

https://www.futurlec.com/DevelopmentBoards.shtml

Ebay has a lot of them also as well as any standard electronic distributor.
 
  • Like
Reactions: dann11

    dann11

    Points: 2
    Helpful Answer Positive Rating
in a microcontroller that has a 16 bit data bit width, this means that I can transmit 16 bits data at once.. what are the instances in which higher data bit is needed in a single transmission? does it has something to do with the type of data?
 

in a microcontroller that has a 16 bit data bit width, this means that I can transmit 16 bits data at once.. what are the instances in which higher data bit is needed in a single transmission? does it has something to do with the type of data?

Hi,

it means that internal registers of CPU , instruction Sets , ALU (which do the math operation) all are 16 bit wide. This also affect your variable (type of Data).For example :
8 bit microcontroller - it mean all of registers , memory , ..etc are 8 bit wide.
when you writing your program , you may have different type of variables for example : Byte (8bit) , int (16bit) , ... etc.it affects memory and speed of execution of your program.
let assume A,B are 8 bit variables. if you do C=A+B , your result will be 8 bit wide + a Carry bit (for overflow if the result is more than 255) and CPU usually does this in One clock cycle.
but if of the A,B are 16 bit wide , if you do C=A+B , your result will be 16 bit wide, but for doing this in a 8 bit microcontroller , CPU needs more clock cycle like between 10 to 20 depend on architecture and also moving the data between registers and memory takes more clock cycles. The result will be a much slower execution of your program.

if your microcontroller is 16 bit , for 8 bit & 16 it variables, usually there will be no speed problem, but for 32bit variables (like Log int , Float , ..etc) you will have same problem.

In a 32bit microcontroller , usually there will be no speed problem between 8 , 16 or 32 bit variable operations , but there will be in calculation using Floating point.In that case and if you really need a large amount of floating point operations there are 32bit microcontrollers with FPU unit for floating point operation at high speed.

You can start with a simple microcontroller (AVR or 8051 family or PIC) and trying and getting familiar with microcontroller concepts and after that ,move to more advanced microcontrollers.

BTW, you should really see what do you need in your project, you may think that you should go with 16bit or 32 bit HIGH SPEED microcontrollers , but the Speed or type of microcontroller (16 bi t , 32 bit) isn't the main factor, main factor is your requirements : Like what peripherals you need? Is Power usage is a problem or not (specially in battery powered applications)? what sort of calculation do you need? and how often? and ..... This may result using a simple 8 bit microcontroller without any problem. Because when you use more advanced microcontrollers (Like ARM), The learning curve will be much longer , and each family of these advanced microcontrollers are getting more more complicated than previous family.
 
In a 32bit microcontroller , usually there will be no speed problem between 8 , 16 or 32 bit variable operations , but there will be in calculation using Floating point.In that case and if you really need a large amount of floating point operations there are 32bit microcontrollers with FPU unit for floating point operation at high speed.

what is the function of a floating point operation?
 

what is the function of a floating point operation?

Hi,

Floating point is the formulaic representation which approximates a real number so as to support a trade-off between range and precision (Wikipedia).
https://en.wikipedia.org/wiki/Floating_point
https://floating-point-gui.de/formats/fp/

Usually in microcontrollers ALU (Arithmetic Logic Unit) which calculates arithmetic operations, basically is working with integer numbers Like : 25555*337820 , 254+589, 88554-9999852 , ... etc
and if you do a division operation like C=9/8 , C will be 1, not 1.125 , if you want do an arithmetic operation with Real numbers like C=A*B , A=1.254 , B=-2.655 , you should first specify A,B,C as Float Variables , like this In C programming : float A,B,C;

In that case, compiler will use a special library to convert real numbers operations to integer operations and will do the reverse for the result. this is an floating point operation. But using this will cost you a lot of clock cycles and even a simple ADD (+) operation won't take a clock cycle (unlike an integer operation) and will slow down the whole process.

If in your algorithm or process, you need a lot of operations with real numbers , you should use a microcontroller with a FPU (Floating Point Unit) which is specialized in Floating point operation and will do them with consumption much less clock cycles.
 
  • Like
Reactions: dann11

    dann11

    Points: 2
    Helpful Answer Positive Rating
Hey,
You could go on this site https://123d.circuits.io/ and try some microcontrollers out! I used it for testing small projects before building them in real life!
It really helps you and can give you an idea for what microcontroller you want!

Greetings Mounir
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top