Author Topic: Microcontrollers - AVR programming in C - good books recommendations  (Read 6842 times)

0 Members and 1 Guest are viewing this topic.

Offline lhcTopic starter

  • Contributor
  • Posts: 40
Do you have some recommendations for good tutorials and books to start programming microcontrollers in pure C?

For learning C there is "The C Programming Language" by Kernighan and Ritchie.

Is there any book for a beginner that has no knowledge about microcontrollers to guide him? To show him the architecture, all the basics and teach how to write C for AVR?
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Microcontrollers - AVR programming in C - good books recommendations
« Reply #1 on: August 05, 2010, 03:23:38 pm »
I'd be wary of any books, I've been caught time and time again.
 

Offline lhcTopic starter

  • Contributor
  • Posts: 40
Re: Microcontrollers - AVR programming in C - good books recommendations
« Reply #2 on: August 05, 2010, 07:04:04 pm »
So where do you start when you have some knowledge about C but don't know how to use it to program microcontrollers? I don't need a C course but rather microcontroller architecture/usage course.

How all of you uC guys started? Just tell how you have done it. It's not like you were born knowing how to program AVR-s, tell me your secret  ;D
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11631
  • Country: my
  • reassessing directives...
Re: Microcontrollers - AVR programming in C - good books recommendations
« Reply #3 on: August 06, 2010, 04:00:04 am »
i suggest reading the basic of C... variables, branches, for if loop, calling functions etc, the basic thing. once you get familiar and understanding how the mechanism works (esp whats going on when you call external functions)... then you can move on to uC specific functions/library. once you have mastered the earlier, there will be no problem in the later. in any uC brands.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline lhcTopic starter

  • Contributor
  • Posts: 40
Re: Microcontrollers - AVR programming in C - good books recommendations
« Reply #4 on: August 06, 2010, 05:09:42 am »
Thanks, but the problem is that i *do* know C already (I'm not a master programmer but it should be enough). What I don't know is how to apply that to microcontroller.

I need a source to learn how to address everything in a microcontroller, description of standard libraries etc. this is what I'm talking about.

So how did you learn how to program uC?
 

Offline saturation

  • Super Contributor
  • ***
  • Posts: 4787
  • Country: us
  • Doveryai, no proveryai
    • NIST
Re: Microcontrollers - AVR programming in C - good books recommendations
« Reply #5 on: August 06, 2010, 12:31:20 pm »
Get the PIC 1 starter kit, for $30, it includes the particular C flavor for the uC, sample codes, complete spec sheets and everything you need to get up and running.

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010053


Do you have some recommendations for good tutorials and books to start programming microcontrollers in pure C?

For learning C there is "The C Programming Language" by Kernighan and Ritchie.

Is there any book for a beginner that has no knowledge about microcontrollers to guide him? To show him the architecture, all the basics and teach how to write C for AVR?
Best Wishes,

 Saturation
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11631
  • Country: my
  • reassessing directives...
Re: Microcontrollers - AVR programming in C - good books recommendations
« Reply #6 on: August 07, 2010, 04:54:56 pm »
o well, u understood C. now you have to know the uC registers and how to change those values and what effect will occurs by doing so. if you got that, then a simple C style assignment will do the trick!


unsigned char myLed = 0xFF
DDRA = 0xFF

while (true) {
     PORTA = (myLed = ^myLed)
}


something like that ;)
very simple! but sadly, i dont talk in C for a simple routine ;)

note: you need to find out what is DDRA and PORTA, the rest are within your grasp, i'm sure!
and back to your original question... well, sorry, i dont have any :(
« Last Edit: August 07, 2010, 05:00:58 pm by shafri »
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline lhcTopic starter

  • Contributor
  • Posts: 40
Re: Microcontrollers - AVR programming in C - good books recommendations
« Reply #7 on: August 07, 2010, 10:03:23 pm »
I have found Avr Freaks website and forum. Lots of tutorials and helpful links there about everything inside of uC. It should get me started in no time  ;D
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf