Resources to learn AVR

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

HI,

 

Can you please recommend some resources for following 

 

1.)Number System: Real quick (for one who knows how to convert Decimal to Hexa or to binary using calculators)

2.) Understanding Memory Sizes  

3.)Programming Practice

4.) For AVR I have been Following Make: AVR Programming Book 

Mav

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1) note that this is nothing to do with AVR specifically. It's pure computer science. It's often easier to learn about things like number representation on a PC where you can see more immediate results. The key things to understand are binary, 2's complement, BCD and ASCII conversions (to and from)

 

2) not sure what this means - every AVR data sheet has a chapter on "Memories" which explain the memory regions in each device and where they are located.

 

3) What do you mean by "programming"? Are you talking about the act of burning code images into the flash of an AVR (like ISP etc) or do you simply mean "computer programming" - like how while() and for() loops and so on work. Again for the latter you can learn all about that in any programming environment - doesn't have to be AVR specifically - it'll be easier to learn most things about writing computer programs on a PC in fact.

 

4) that is not a question - that is a statement of fact. Previous threads seem to show its an OK resource for learning if possibly a little dated?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For AVR specifics, check out the tutorial section here at AVRFreaks.

Jim

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
stack gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

BTW if this thread is a direct result of your other thread:

 

https://www.avrfreaks.net/forum/spi-interrupt-master-device

 

Then the issue there seems to be that you have not understood the distinction between synchronous and asynchronous use of peripheral devices.

 

The fact is that for things like UART, SPI and so on you have two ways to use them:

 

1) almost certainly the "easiest" way to use a device is to trigger it to do something then wait to see when the thing you asked it to do is complete (like transmitting a character or whatever). As you can't get on and do other things while you are waiting (which is often a while() loop waiting for some bit to signal completion) this is known as "synchronous" operation because the operation of the transmission and it's completion is synchronised with everything else you are asking the AVR to do. It can't move on until the triggered operation is complete

 

2) the other method to use a device is "asynchronous". If this you trigger the device to perform some action (like transmitting a character say) but as soon as you have started the process you then effectively ignore the peripheral for the time being. You return from the action of starting the transfer and the AVR gets on and does other things (like reading keys, writing to a display, etc). In this mode of operation you also set things in the peripheral so that when a job is complete it "interrupts" the AVR whatever it may be doing at the time. As this completion of the operation can happen at almost any moment, whatever the AVR is doing it is not synchronized with the other things the AVR is doing so this is called "asynchronous". Note that because you now effectively have "two things happening at once" things can get a LOT more complex - especially if the thing the AVR moves on to do is somehow connected to the completion of the job the peripheral is doing. There can be all kinds of unplanned interactions between the main code execution and the peripheral interrupt (these things sometimes called "foreground" and "background" code). The one advantage that async operation brings is that the AVR is not blocked waiting for events to complete. It can get on and do things (like being responsive to key presses and stuff) while something else is happening in the background. In the synchronous case, if a peripheral took a long time to complete some operation you might be "stuck in a loop" waiting for that to complete and miss the fact that the user is pushing buttons or whatever.

 

In the linked thread you confused these concepts and were (apparently) trying to do both at once. I'm not sure how you can easily learn about such mistakes and how to avoid them - such things come with experience. The one possible mistake is that you were perhaps trying to run before you could walk. I would not consider trying to use async/interrupts with a peripheral until I had fully understood its synchronous operation first.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

After you are done with the book, read

one of the data sheets.  ATmega328 is

popular since it's on the Arduino Uno.

You can skip sections that you aren't

interested in.

 

The Register Summary toward the end

shows all of the registers and bits used to

control the CPU and peripherals.  When I

was learning the AVR I printed out this

summary and highlighted each register

as I learned its function.  Use a different

color to mark bits you don't understand

and go back to them later.

 

Also look through the header file for the

chip.  This is the file the compiler reads

when you include the <avr/io.h> header.

For the 328 this file is named iom328.h

(you will also find iom328p.h and maybe

iom328pb.h).  All of these files are in the

include/avr subdirectory.  In these files

you will see each of the registers and bits

defined, same as the register summary.

 

--Mike

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This has a lot of good info concerning the guts of the classic AVR's...read & understand

 

http://www.avrbeginners.net/

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Several of the mentioned topics have pretty good explanations on wikipedia. For example:

 

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

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did smiley's book not cover it all from start to finish?

Not sure if he still sells it, but if he does get a copy of that and start reading.

A lot you ask is basic stuff you normally get in school, can not imagine that there is nothing to be found on the web on that.

 

Also take small steps, if you now ask questions about the very basics of programming, then diving into the world of processor peripherals and how to use them is a big big step away.

As Clawson already suggested for learning the basics you might best be first doing things on the PC that will give you knowledge and understanding of how things work then the next step is to take a processor and start doing simple things with that before getting going with the peripherals.

Last Edited: Wed. Apr 17, 2019 - 05:34 AM