Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

the best microcontroller ?

Status
Not open for further replies.
i would second that the 16f877 is a great chip with loads of I/O, 8 ADC ports, 2 PWM perfect for building robots
 
Because it's easy to learn, and there's much more help and free code available than for other languages or for the 18F series.

Start simple, and work up!.
I am interested in transistorman answer but I expect he will just repeat what you said.

It is my fear that learning an asm first will make other languages difficult to learn and promote bad habits.

I do not know of any university computer science program that teaches ASM as a first language. The EE department at the university I attended (1974) required fortran prior to asm. You will point out contrary examples.

I have spent most of my adult live learning, programming, or teaching computer and micro controller programming. There is no upside in learning to write Spaghetti code in asm as a first language. Higher level languages, especially c, can be introduced in a paced way to make them easy to absorb. The most important thing a first language can teach is to think in a way that reflects the flow of the code. That was seen as far back as the introduction of Pascal! The instructions used by the machine to cause the flow is an unimportant detail.

Note that I think embedded programmers should learn asm but not as a first language.

I expect that many of the strong supporters of asm first have never been fluent in c. A case of supporting the language they know.
 
Last edited:
In my experience of 2 years with micro controllers I started with ASM and although I found ASM interesting to learn I didn't feel I would get to the end of my projects because of its complexity. I came close to giving up on MCUs but I tried using Pic Basic Pro which changed my view completely. I am still not a pro in this language but I can do pretty much anything in a short period of time without much help from anyone.

Mike
 
Last edited:
I expect that many of the strong supporters of asm first have never been fluent in c. A case of supporting the language they know.

Hi 3v0, you are right in this case, I'm not much of a C guy, and after learning ASM looking at C codes are a bit troublesome for me.

However, it's the way I started with PICs (Though I'm not expert) and since in my university not many people even know how to program PICs, we looked high and low for references, and found Mazidi's PIC book, bought it, and learnt it the way the book told us (alongside with Nigel's tutorials).

I also believe C is much is better, but I'm also just starting to learn it after sticking to ASM for some time, it's quite hard to adjust. Learning on the 'net is a lot more difficult rather than having an actual person teaching me.

Cheers.
 
I do not know of any university computer science program that teaches ASM as a first language. The EE department at the university I attended (1974) required fortran prior to asm. You will point out contrary examples.

All the old Uni courses I've ever heard of insisted on assembler first, and you weren't allowed to move to an HLL until you wre competent in assembler.

I'm presuming you are refering to pre-micro main frames?.
 
Hi 3v0, you are right in this case, I'm not much of a C guy, and after learning ASM looking at C codes are a bit troublesome for me.

That's not the fault of learning assembler first, it's the fault of C been difficult to learn :p

I originally learnt 6502 assembler (hand assembled and entered byte by byte), then a single pass assembler, followed by a two pass assembler. Next was Microsoft BASIC, then FORTH, and later PASCAL (moving on to Delphi for Windows). I've had a number of tries to get interested in C, but never really managed it - it's far too unfriendly - and as for bad habits, C is great for learning bad habits :D.

Most of my C experience was actually converting C to Pascal - I just couldn't get on with C.

As far as teaching languages go, Pascal was one of the most popular, because it's so strongly structured - and used to be one of the early favoured one at Uni - learn good habits with Pascal, then take those good habits elsewhere.
 
At the entry level c and Pascal are much alike.

Translating code is not the best way to learn a language. You are exposed to things that should not be seen till you comfortable with the language. Too much at once.

C has some features like pointers and function pointers that are great for experienced users but send others running for the hills. Fortunately students can write programs without these features. Arrays can often be used in place of pointers. If you were to take a book on basic and just replace their syntax with c it would work just as well.

We learned Fortran on the mainframe. The microprocessor development lab had 6502 processors (IIRC) and in circuit processor emulators. The first program was a stop light. :) We used ASM code to write drivers for the IMB360 main frame, In other classes I worked with asm on a Data General Nova and an old IBM 1620.

As I have said there is great value in an embedded program learning asm. I would just like to see people learn to program in a more structured setting even if they have to start on a PC. I am not talking about the Visual Studio set of languages but rather a GCC based system without the OO and GUI code.

Unfortunately most people are not willing to take the time to do that. I would like to point out that one of our junior members has and he is doing well with little outside help compared to people who start on a micro.

There is a need for a good book or a good set of tutorials in c using microcontrollers at a more basic level.
 
Hi 3v0, you are right in this case, I'm not much of a C guy, and after learning ASM looking at C codes are a bit troublesome for me.

However, it's the way I started with PICs (Though I'm not expert) and since in my university not many people even know how to program PICs, we looked high and low for references, and found Mazidi's PIC book, bought it, and learnt it the way the book told us (alongside with Nigel's tutorials).

I also believe C is much is better, but I'm also just starting to learn it after sticking to ASM for some time, it's quite hard to adjust. Learning on the 'net is a lot more difficult rather than having an actual person teaching me.

Cheers.

C is assembly language made (mostly) portable. If you make this your mental model when learning it, the point where it "groks" will happen sooner. Programming in C sometimes is like driving fast on a icy mountain road with no guardrails, after a while you develop a certain 'ZEN' that keeps you on track but it can be hell getting to that point.

Grok - Wikipedia, the free encyclopedia
 
I learned C first on my own and when we were made to learn Pascal in class, I was frustrated by the restrictions. Heh.
 
Translating code is not the best way to learn a language. You are exposed to things that should not be seen till you comfortable with the language. Too much at once.

It wasn't to learn C, it was having given up learning C - so translated the code I wanted to Pascal instead.
 
Hi transistorman,
you can start with PIC16F877A, they're very cheap. You can order them through Farnell. Here are tutorials to start with them.

how is $7 cheap? bang for your buck borders on nonexsistant. Now readilly available to you I might buy ... particularly if you happened to have a Farnell at least in your country, but cheap? never!
 
Noticed this $4.30 MSP430G evaluation board, posted on another forum. Now that has to be The cheapest evaluation board/development environment yet. The actual target device has less going for it than a similar priced low end PIC24F.
 
Last edited:
MicrochipDirect and Newark (US) both sell the PIC16F877A for $5.44. And if you are really tight you could get a sample !

If you want bang for the buck I would look at newer chips. They offer more memory and faster clocks at about the same price maybe less.

The last time I checked you could buy a picKit2 (without target) from microchipDirect for about $35. That is a lot compared to a boot loader solution but it also functions as an ICD (in circuit debugger), 4 chan logic analyzer, and even a TTL to USB converter.

If you flash the picKit2 with the right firmware it will even program some AVR's.

But if you want to be super cheap you could look into LVP (low voltage programming) which can be done from a PC with a simple cable. The down side is that you loose one more pin to the programming interface.
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top