lecture7 - ATermSpring2008 Lecture#7:Makingitwork:TheKeypad...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Foundations of Embedded Systems A Term Spring 2008 Lecture #7:  Making it work: The Keypad Reading for Today: Keypad datasheet, MSP430x4xx User Guide Ch 9 Reading for Next Class: Review all reading, notes, User's Guide Ch 1,3.1-3.2,9 Lab #0: Due Now Lab #1 (on Web) :             Due next Tuesday 9/16/2008 in class HW #2 (on Web): Due THURSDAY  9/11/2008 EXAM #1 – This Friday 9/12/2008! Last class :  More on configuring and reading from and writing to the digital IO  ports on the MSP430F449.   -->Using bitwise operations for configure the digital IO ports. MSP430F449  Basic Digital I/O >>   Six independent, individually configurable, 8-bit wide digital I/O ports >> Each pin of each port can be configured individually as an input or an output >> Each pin of each port can be individually read or written to      Function Select Register :   Sets function of each pin in the port  (i.e. P4SEL) -- Bit = 0 = Selected for Digital I/O         -- Bit = 1 = Not selected for digital I/O  (multiplexed pin functions)      Direction Registe r:   Sets direction of each pin in the port (i.e. P2DIR) -- Bit = 0 = Corresponding pin is an  Input         -- Bit = 1 = Corresponding pin is an  Output      Input Register :   Where input to the port is read from  (i.e. P2IN) -- Bit = 0 = Logic low -- Bit = 1 = Logic high      Output Register :  Where data to be output from the port is written  ( P5OUT) -- Bit = 0 = Logic low -- Bit = 1 = Logic high >> All I/O port registers are  memory mapped  – Read and write to the registers          names (defined msp430x44x.h) as if they were C variables! 
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Using pre-defined constants to avoid “magic numbers” >>  In C, there is always multiple ways to implement the same functionality >> Some ways are accepted as representing better coding style          Try to avoid “ magic numbers ” = fixed hard-coded numbers that appear in code 
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern