Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
#7 Arrays and Pointer Arithmetic
Play lesson

Modern Embedded Systems Programming Course - #7 Arrays and Pointer Arithmetic

4.0 (6)
56 learners

What you'll learn

This course includes

  • 22.3 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

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 a 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... ------ Resources: Companion web page for this video course: https://www.state-machine.com/quickstart GitHub repository for projects for this video course: https://github.com/QuantumLeaps/modern-embedded-programming-course YouTube playlist of the course: https://www.youtube.com/playlist?list=PLPW8O6W-1chwyTzI3BHwBLbGQoPFxPAPM

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere