Microcontrollers - AVR  programming in C - good books recommendations - Page 1
Forum section: electronics / beginners

author: lhc
author_rank: Contributor
timestamp: August 01, 2010, 06:45:41 pm
content: 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?

author: Simon
author_rank: Unknown
timestamp: August 05, 2010, 03:23:38 pm
content: I'd be wary of any books, I've been caught time and time again.

author: lhc
author_rank: Contributor
timestamp: August 05, 2010, 07:04:04 pm
content: 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

author: Mechatrommer
author_rank: Super Contributor
timestamp: August 06, 2010, 04:00:04 am
content: 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.

author: lhc
author_rank: Contributor
timestamp: August 06, 2010, 05:09:42 am
content: 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?

author: saturation
author_rank: Super Contributor
timestamp: August 06, 2010, 12:31:20 pm
content: 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=en010053Quote from: lhc on August 01, 2010, 06:45:41 pm

author: Mechatrommer
author_rank: Super Contributor
timestamp: August 07, 2010, 04:54:56 pm
content: 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 = 0xFFDDRA = 0xFFwhile (true) {PORTA = (myLed = ^myLed)}something like thatvery simple! but sadly, i dont talk in C for a simple routinenote: 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

author: lhc
author_rank: Contributor
timestamp: August 07, 2010, 10:03:23 pm
content: 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