Embedded Systems Programming
Added to favorite list
Updated On 02 Feb, 19
Getting Started - Counting - Flow of Control - Variables and Pointers - Blinking the LED - Preprocessor and volatile - Bit-wise operators in C - Arrays and Pointer Arithmetic - Functions and the Stack - Modules, Recursion, AAPCS - Stack Overflow and Other Pitfalls of Functions - stdint.h and mixing types - structures and CMSIS - startup code part - interrupts
4.1 ( 11 )
Embedded Systems Programming Lesson-7 introduces you to arrays and basic pointer arithmetic in C. You will learn how to apply these concepts to take advantage of the more advanced features of the Stellaris GPIO DATA registers, which answers some questions asked in the comments to this video course posted on YouTube.
The lesson starts with explaining why the traditional read-modify-write sequence that you used in the previous lessons can be problematic when you add interrupts in the future.
Next, you see how this problem can be solved in hardware by using the address bits as a mask for updating the GPIO DATA bits. You get an understanding that this solution
requires many GPIO DATA registers, and you find out why the DATA register with the offset 0x3FC is so special.
Next, you try to use brute-force solution from lesson-3 to synthesize the GPIO DATA register addresses manually and you verify that it works, although is not very elegant.
Next, you learn about arrays in C and their equivalence with pointers.
Next, you see how to index into an array and you learn about the equivalence between array indexing and pointer arithmetic.
Next, you verify the equivalence of the three approaches address arithmetic, pointer arithmetic, and array indexing when it comes to the generated machine code.
You learn about the difference between address arithmetic and pointer arithmetic.
Finally, you learn about the two peripheral buses APB and AHB in the LM4F microcontroller and you see how to switch the code to use the faster AHB.
The next lesson will be devoted to functions in C. Stay tuned...
YouTube playlist of the course
Sep 12, 2018
Excellent course helped me understand topic that i couldn't while attendinfg my college.
March 29, 2019
Great course. Thank you very much.