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.

searching for help...

Status
Not open for further replies.
Steve P said:
I have never programmed/coded anything in my LIFE...with the exception of a few cheesy websites. I was talking with my engineer friend and he recommended that I start programming with a higher language like Basic or C. I then told him that all the "pros" on Electro-Tech recommend assembly as the foundational language.

So, if you were me and knew ABSOLUTELY NOTHING about programming...and I mean NOTHING!... how would you BEGIN to teach yourself assembly language. I've seen some different tutorials on it, but they all assume that you're somewhat familiar with programming. I don't know ANYTHING. I understand the concepts of an If/then statement, but I need to know the real deal.

Like anything else, you have to work at it 8)

By all means use BASIC or C, but you are severely limiting your capabilities - using assembler means you HAVE to have a good understanding of the hardware, which makes a big difference to the way you write your code. In a high level language the hardware is generally hidden from you, so you're working against the hardware (and wearing a blindfold?), instead of working with it.

I've seen high level code sections written using ten or twenty lines of high level source, where you could do the same job in just one or two lines of assembler. This isn't because the high level language is inherently inefficient (although it is!), but because the programmer didn't understand the underlying hardware.

In the fairly distant past, if you were doing a programming course at university, you weren't allowed to use a high level language until you were fairly adept at assembler - that's probably not a bad idea today either!.
 
Steve P said:
Hey Joel,
I have never programmed/coded anything in my LIFE...with the exception of a few cheesy websites. I was talking with my engineer friend and he recommended that I start programming with a higher language like Basic or C. I then told him that all the "pros" on Electro-Tech recommend assembly as the foundational language.

So, if you were me and knew ABSOLUTELY NOTHING about programming...and I mean NOTHING!... how would you BEGIN to teach yourself assembly language. I've seen some different tutorials on it, but they all assume that you're somewhat familiar with programming. I don't know ANYTHING. I understand the concepts of an If/then statement, but I need to know the real deal.

What should I do? What or where would you guys go for help if you were in the same situation?

Hey Steve,

Starting out with a high level language is not a bad choice at all. What are your goals?

One of the fun ways to learn programming on the PC are the "visual" development environments, also called Rapid Application Development (RAD) tools, like Visual Basic, Delphi, C++ Builder. etc. Those will allow you to come up with functional Windows programs in no time using a high level language. You draw some buttons, attach some code to it, and start learning real world programming in no time. This would be my first choice for a complete beginner.

Second best choice to me would be plain C. Although you often see it refered as a high level language, it is actually in middle grounds between Basic (and any of its variants) and assembly language. It is very powerful, yet quite easy to read and understand :

Code:
My_Brain_Hurts = 1;

if(My_Brain_Hurts)
{
    Take_A_Break( 30 ); 
}

However, if you want to start on the PIC right away, maybe picking up assembly from the start makes sense. In this case, what I would do if I were you is start slow. Nigel's tutorials are a great starting point.

Assemble a small program, put it on the PIC and see what it does. Read the code, and when you think you understand a part, modify it a little and see if it does what you thought it would. You're gonna learn the basics real fast that way.

Start with something. If you can't decide, flip a coin. After a little while, you'll probably be able to tell what you're more comfortable with. Try to stick with free tools first. Don't invest in books or software right away.
 
Hi Steve,

Forget about even starting with assembly language before you have a complete understanding of the following.

You need to learn the basic building blocks of a microprocessor, doesn't have to be a PIC in particular, just any one will do. Get hold of any such book from a library and spend sometimes on it. Ask here if you have come across a concept that you find difficult to fully understand.

The important thing is to know what functions each block serves and why they are absolutely necessary in the structure of the microprocessor. This knowledge would then apply to any microprocessor or microcontroller as they simply integrate the various building blocks onto on the chip itself.

The main function of any assembly language is to let you control these building blocks using instructions. Once you have fully understand concept like port, stack, program counter, flags, registers....you will have no problem in using assembly language to control them.
 
I think eblc1388 is absolutely right. However, what he describes I believe should be the 2nd step of your learning curve.

The first would be to get familiar with basic logic concepts, program structure, etc. for which the underlying microprocessor architecture makes absolutely no difference.

For example, those concepts would be "hexadecimal, decimal and binary numbering systems", "binary logic", etc. While learning those, you would ideally be able to write some code that will let you play with the recently acquired knowledge...

But it really depends on your goals. Do you want to learn "programming" in general, or do you want to build PIC-enabled circuits & applications right away?
 
Joel Rainville said:
For example, those concepts would be "hexadecimal, decimal and binary numbering systems", "binary logic", etc. While learning those, you would ideally be able to write some code that will let you play with the recently acquired knowledge...

Good one Joel. Guess what Chapter one is usually about in any book on microprocessor? :D :D :D
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top