1) Basic concept of programming and experience in programming helps a lot.
2) Knowledge of C programming language. If you get confused on every second line when you see a C program then you need to do a lots of practice to get through with bits and pieces of this language. Don't try to learn C language on embedded platform. Learn it by writing small console programs in PC.
When you think you can balance the bicycle on two wheels it won't be difficult for you to refer datasheets of MCUs and develop successful program.
Their are several tutorials available online that may help you learn.