# Suggest me VERY VERY basic assembly (for AVR) guide to start (suitable for 5 yrs old child)

Discussion in 'AVR' started by Willen, Dec 20, 2015.

1. ### WillenWell-Known Member

Joined:
May 22, 2012
Messages:
1,293
Likes:
115
Location:
Nepal (GMT +5:45)
From a year I am trying to start programming. No face to face guide here. I know NOTHING about programming and its VERY BASIC terms! MOST of the beginner Ebooks says their book for beginner but they start their guide without introducing basic terms like what is register, what is hex, what is mean by '32bit' chip etc in beginning way. Beginner needs to know such terms first and after then they will be able to go ahead. I downloaded some books but due to the reason, feeling like being lost around beginning. Also I am not very well for English too.

So please experienced, list out me some of the free PDF/doc (or any downloadable) extremely easy books. Lets say also a 5 years old American baby would understand. Expecting many useful Ebooks!

Joined:
Mar 28, 2011
Messages:
9,164
Likes:
910
Location:
Rochdale UK
ONLINE
• Like x 1
• Informative x 1
3. ### ronsimpsonWell-Known MemberMost Helpful Member

Joined:
Apr 17, 2007
Messages:
7,254
Likes:
961
Location:
Loveland, CO USA
Computer come is different "sizes" 4, 8, 16, 32.........bit.
4 bit is not common. Very small.
Compare to a human. You think about numbers 0 through 9. To do big math you do many small jobs. Example:
456+123=? (6+3=9, 5+2=7, 4+1=5)=579
If you could add 456+123 in one step you will be much faster.
"8 bit computer" thinks 0 through 255 in decimal numbers. or 0 through FF in hex numbers. or 00000000 through 11111111 in Binary numbers.
Decimal=0 to 9, Hex=0,1,2,3,4,5,6,7,8,9,A,B,C,ED,E,F, Binary=0 to 1
A 8 bit computer can add 100+55=155 in one step. Because the numbers fit in the computer's head. Numbers bigger than 255 take up too much room and must be broken into smaller pieces.
A 16 bit computer can add numbers up to about 64000 in one step.
A 32 bit computer is something like having two 16 bit computers working together or four 8 bit computers or eight 4 bit computers.

hope this helps

• Like x 2

Joined:
Jan 12, 1997
Messages:
-
Likes:
0

5. ### WillenWell-Known Member

Joined:
May 22, 2012
Messages:
1,293
Likes:
115
Location:
Nepal (GMT +5:45)

Wow, and is there a direct relation between registers and bit of a computer?

I am trying to collect many eBooks same as you wrote above. Described in very beginning way. I Wish many member share links for PDF download.

6. ### ronsimpsonWell-Known MemberMost Helpful Member

Joined:
Apr 17, 2007
Messages:
7,254
Likes:
961
Location:
Loveland, CO USA
No.
A register is normally just as wide as the CPU. Wide=number of bits. 8,16,31, etc.
How many registers, refers to how many of these resisters are sitting there for the CPU to use.

7. ### atferrariWell-Known Member

Joined:
Oct 8, 2003
Messages:
2,812
Likes:
121
Location:
Buenos Aires - Argentina
Hola Willen

Are you comfortable with binary numbers? If not, I suggest you try to grasp the basics, otherwise no matter what micro would be harder to understand.

Make sure as well you have a minimal knowledge on boolean operations.

• Agree x 2
• Like x 1
8. ### ronsimpsonWell-Known MemberMost Helpful Member

Joined:
Apr 17, 2007
Messages:
7,254
Likes:
961
Location:
Loveland, CO USA
Under Windows there is a calculator that has buttons for HEX, DEC, BIN, OCT. Enter a number then change the settings and see what happens to the number.
ALSO
It has buttons for D-WORD, WORD, BYTE. This will give you an idea of what happens when you change the "size" of a number or register.

You have to have the calculator in "scientific" mode!

• Like x 1
9. ### WillenWell-Known Member

Joined:
May 22, 2012
Messages:
1,293
Likes:
115
Location:
Nepal (GMT +5:45)
Hi there,

I even don't have more knowledge about decimal, hex, binary etc. So searching extremely basic eBooks! I have a book about binary, decimal in my native language (easy). So I am searching further basic books.

• Like x 1
10. ### PommieWell-Known MemberMost Helpful Member

Joined:
Mar 18, 2005
Messages:
10,022
Likes:
317
Location:
Brisbane Australia
ONLINE
Don't worry about number bases, binary, decimal, hex, you can use which every you are comfortable with (probably decimal). Registers are where you store numbers. If you use C then you just give your variables (registers) names - EG seconds. So you can say seconds = minutes * 60 or whatever else you want to calculate. Yes, you do need to learn how big variables are but as a start just make them all long (big) and as you learn more you can use more appropriate sized variables. The hardest part is flow control - how the program runs. You have various looping structures but they're fairly easy once you get your head around them. Look for some online tutorials, I suggest you try C as it is the simplest high level language to learn. Start a new thread called something like "Learning C" and post when you get stuck. We're all here to help.

And, most importantly, have fun.

Mike.

11. ### Wp100Active Member

Joined:
Feb 3, 2009
Messages:
959
Likes:
43
Location:
England
Hi,

There are so many online books you can get, but I would suspect that if you have not grasped things by now, then more books are likely to confuse you even more ...?

Some people can read technical books and apply that knowledge easily.

For me and some others, following a more practical approach using basic hardware and program code examples seem to work better; using the books more as a reference manual.

Nothing wrong with AVR though many beginners use them as the megaAVRs in the Adruino platform.

Also Assembly code for AVR or most other micros, are not that well supported in hobby forums like this one.

Starting with Assembly code does give you a good knowledge of the micros, and think you will find the Microchip Pics / Assembly are better supported.

• Like x 1
12. ### WillenWell-Known Member

Joined:
May 22, 2012
Messages:
1,293
Likes:
115
Location:
Nepal (GMT +5:45)
Hi Wp,

I have nothing in my mind about programming and I have poor and expensive internet on my cellphone. So choosing very basic book or downloading books again again again is impossible. I hardly can download 10MB or more. However I downloaded few but seems that these are complicated than I expected.

I am in a place from where neither I can buy chips from expensive source online like DiGikey nor I can get them around me easily. One US engineer want to offer me AVR chips and its USB programmer too. And he uses assembly. I thought if I followed his way then I could get very nice back to back support from him. And also he said that knowing assembly we can really knows how codes and chips (computer) works. Also he said we can shift easily if we learned any 'one' programming.

Last edited: Dec 24, 2015
13. ### Wp100Active Member

Joined:
Feb 3, 2009
Messages:
959
Likes:
43
Location:
England

Hi,

Its going to be tough learning micros without a good internet connection as you normally use it to download the chips IDE program, usually quiet large, and the chips datasheets and various tutorials.

Assume that US guy is offering you the AVR stuff for free, can he make up a dvd for you with the relavant datasheets and an IDE etc ?

As said before Assembly is a good way to learn the detail of the chips, but in doing so usually means buying the chips and programmer separately or an expensive development board, not that cheap and difficult if you have no easy supply lines.

I can hear the screams from others, but suggest you perhaps consider the Arduino boards like an Uno, which if bought as a clone are very cheap and all you need is a usb port /lead, it downloads your program code straight in to it and you can use its serial monitor on the PC to display things; as the pic belows shows, so you do not need to buy lcd straight away.
A breadboard and wire to connect up a few basic components like leds ,switches , themistors, optos can give hours of fun and learning.
Importantly it is not essential to have a full understanding of every bit and byte to get you going and its small IDE has many examples to guide you , plus masses of online help.

• Like x 1
14. ### WillenWell-Known Member

Joined:
May 22, 2012
Messages:
1,293
Likes:
115
Location:
Nepal (GMT +5:45)
Yes sure, he already sent me a DVD with many AVR datasheets and AVRStudio4.0 and some drivers. I even do not what is IDE etc and what I need others. But the DVD has no eBooks and tutorials as I expected.

C language might be my alternative because I can apply it to the AVR when I got chips from the US engineer. Other than this, I am far from possibilities.

15. ### Dick CappelsMember

Joined:
Jun 1, 2009
Messages:
139
Likes:
21
Location:
Udon Thani
This will give you most of what you need in terms of documentation. That, and the datasheet for the controller you intend to use.

An Overview -What Is A Microcontroller (PIC but at the bottom of it, they are basically the same)

http://www.circuitstoday.com/basics-of-microcontrollers

Beginners Introduction to the Assembly Language of - AVR-Assembler ...
http://www.atmel.com/Images/novice.pdf

Instruction Set
www.atmel.com/images/Atmel-0856-AVR-Instruction-Set-Manual.pdf

AVR Assembler User Guide
www.atmel.com/Images/doc1022.pdf
The Novice Guide to AVR Development
http://www.atmel.com/Images/novice.pdf

• Like x 2
16. ### KeepItSimpleStupidWell-Known MemberMost Helpful Member

Joined:
Oct 30, 2010
Messages:
9,917
Likes:
1,097
I'd like to push you in an entirely different direction to get your feet wet. I'd like yo to regress a little and go back to the model A or Model T of the computer industry. In essence, the PDP-8 (8 bit) and PDP-11 (16 bit) computers. I think the PDP-11 is an elegant machine.

Not sure what you should read first, but here goes:

https://en.wikipedia.org/wiki/PDP-8

http://homepage.cs.uiowa.edu/~jones/pdp8/faqs/

and here https://www.grc.com/pdp-8/pdp-8.htm

https://en.wikipedia.org/wiki/PDP-11

https://en.wikipedia.org/wiki/RCA_1802

http://www.ittybittycomputers.com/IttyBitty/ShortCor.htm

http://www.cosmacelf.com/publications/data-sheets/cdp1802.pdf

The important parts is to get a sense of "history" here and we go from something simple to a simple processor on a chip. With no subroutine calls, the 1802 was really weird to program, but it has a place in history,

Programming depends are architecture:

https://en.wikipedia.org/wiki/PDP-11_architecture

• Like x 3
17. ### specWell-Known MemberMost Helpful Member

Joined:
Oct 27, 2015
Messages:
5,828
Likes:
709
Location:
Somerset UK GMT
Hy Willen,

You say you have a cellphone (mobile phone). Do you also have a computer? If so can you let us know what model computer you have and what operating system: windows, OSX etc.

I have a reason for wanting to know this but, in general as the other members have implied, you are tying to do too much in one go, especially in view of your stated lack of experience with computers.

The most productive way to learn any subject is to divide and conquer or you will just get overwhelmed which maybe is the case as you say you have been studying computers and programing without much success for a year. The other important point about learning is to be able to establish and focus on the main points and filter the detail. Many books and tutorials are very bad in this respect, especially for you, not being a native English speaker (NES). I gotta admire your drive and tenacity; I have enough trouble understanding some of the things in books in spite of being an NES.

Here is a rough division of your task as I see it:

(1) Practice programing in one high level language: Python, Basic, C, C++

(2) Understand about the different data types: integer, floating point, character string, etc (this is dead simple)

(3) Understand how a computer works in general: arithmetic/logic unit (ALU), registers, program counter, memory, etc. (fairly easy)

(4) Understand how one particular microcontroller works: Arduino, Raspberry Pi, Beagle Bone (you would be miles ahead if you work with one of these complete microcontroller boards rather than just a microcontroller chip)

(5) Understand machine code but only generally

(6) Understand assembler for your chosen microcontroller

(7) Understand about input/output modules (called shields. Shield is a classic example of a word used unnecessarily to confuse the situation): temperature sensor, LED controller, motor controller, etc.

(9) Understand about fundamental logic functions: AND, OR, EXCLUSIVE OR, etc (this is also dead easy)

(10) When you have done all this, advise others, who ask questions on ETO and are in the same position as you were.

Most of the above divisions can be done independently of one another. For example, if you have a suitable personal computer you could be up and programing in Python within a few hours at no cost. You can do the same thing with C and C++, but Python is much easier to learn and use.

spec

Last edited: Jul 16, 2016
18. ### specWell-Known MemberMost Helpful Member

Joined:
Oct 27, 2015
Messages:
5,828
Likes:
709
Location:
Somerset UK GMT
19. ### specWell-Known MemberMost Helpful Member

Joined:
Oct 27, 2015
Messages:
5,828
Likes:
709
Location:
Somerset UK GMT
Here is an overview of the Arduino, a microcontroller system module which is used by many people, especially on ETO, because it is simple to program, powerful, well supported, and dirt cheap. It even comes with a free Integrated Development Environment (IDE). An IDE is an application that runs on your PC and allows you to write programs, and then download the programs into the Arduino via a USB link and run the programs. https://en.wikipedia.org/wiki/Arduino

You can download the IDE, plug the Arduino into your PC with a USB cable, write a simple program, and run it, all within an hour. You don't even need a power supply as the Arduino is powered from the USB 5V power line.

Modules like the Arduino and Raspberry Pi have revolutionized how microcontroller chips are used, so that microcontrollers are now well within the grasp of even a newbee hobbyist.

The Arduino is suited to low-level bit manipulation and input/output while the Raspberry Pi is more powerful and has additional hardware functions, rather like a single board computer.

spec

Last edited: Jul 16, 2016
20. ### KeepItSimpleStupidWell-Known MemberMost Helpful Member

Joined:
Oct 30, 2010
Messages:
9,917
Likes:
1,097
www.picaxe.com is probably one of the simpler computers out there. Blinking a light is sometimes the 1st project.

Another way to start is to have a project and have a mentor to help you through with it. High level concepts won't exist in this processor.

The Boolean functions do have to be mastered: AND or NOT etc but only simply.

Number representation: like 2's complement, octal, hex probably.

What is "sign extend". That's usually a don't care. e.g. You need to know why 32767+1= -32768 in a 16 bit 2's complement number. Note the - sign.

21. ### WillenWell-Known Member

Joined:
May 22, 2012
Messages:
1,293
Likes:
115
Location:
Nepal (GMT +5:45)
Hi Dick

Thank you for the relevant information. And I wish to get more soft-copy of such documents/videos along with follow up (?).

Hi KISS and hi spec

Thank you for the avalanche of the information. Yes, currently I have a cell phone and it's my source of internet. Personally I do not have computer but there's a computer in my home with my brother. So I can use the computer when I need, if brother is not engaged. I cannot say its model number because it's not branded. We are living in cheap part of the world. No one buy branded desktop computer because it costs double. The motherboard I use is Biostar, HardDisk from WD, SMPS from Dynamic, RAM: do not know, DVD drive from LG, and casing from Perfect.

Thank you for all the alternatives like PDPs, Arduino, Picaxe etc. But I am living in a isolated village of a poor accessible country. It's sad that due to many personal and other reasons I am unable to get even basic parts of electronics. So that I got some gift boxes of basic electronics parts from some American/Canadian engineers. Same way I am going to get Atmel's AVR chips and its programmers in near future. So that my programming learning (assembly or C) is just based on them.

Steps suggested by spec seems pretty useful to me. Yes, maybe my one of the problem to learn something is I am non-english speaker. So that I said 'I need materials suitable for 5 years old kid'.

Last edited: Jul 16, 2016