ICT2104 Chapter 3: GPIO

Description

mind map for ict2104
Meixi Lim
Mind Map by Meixi Lim, updated more than 1 year ago
Meixi Lim
Created by Meixi Lim about 9 years ago
46
0

Resource summary

ICT2104 Chapter 3: GPIO
  1. Basic I/O Interfacing Concepts
    1. I/O Ports: Physical electrical links for microcontroller to communicate with external world
      1. Types: Digital & Analogue
        1. Mostly multi-function: Normal I/O pin or special function pin
          1. Each digital I/O port...
            1. Can have Schmitt Trigger
              1. An active circuit which converts analog to digital signal
                1. 'Trigger' because output retains value until input changes sufficiently to 'trigger' a change
                2. Combines input, output and interrupt functionality
                  1. Can be programmed for each bit (serial) or as an 8-bit port (parallel)
                3. External Hardware Consideration
                  1. Output Port
                    1. Active Low / Normally High
                      1. 0 to turn on LED
                        1. 0 when switch is pressed
                          1. MCU - Resistor - Vcc
                            1. Current Sink Mode
                            2. Active High / Normally Low
                              1. 1 to turn on LED
                                1. 1 when switch is pressed
                                  1. MCU - Resistor - Ground
                                    1. Current Drive Mode
                                  2. Input Port
                                    1. External Pull-Up Resistor
                                      1. Internal Pull-Up Resistor
                                    2. MSP430 Digital I/Os
                                      1. Up to 10 8-bit digital I/O ports (P1 to P10)
                                        1. P1 and P2 have interrupt function
                                          1. Can be multi-function pin
                                          2. Port Direction, Schmitt, Pull Up/Down, Drive Strength, Function Select Registers
                                            1. PxDIR: Direction of I/O
                                              1. Bit 1: Output
                                                1. Bit 0: Input
                                                2. PxIN: For read only, reflects input signal
                                                  1. Bit 1: Input is high
                                                    1. Bit 0: Input is low
                                                      1. ! Avoid writing to them: results in increased current consumption
                                                      2. Schmitt Trigger
                                                        1. For slow edges to be converted to fast edges
                                                          1. Cleans up noisy signals
                                                            1. Changes waves to square waves
                                                              1. Reason: CMOS, BiCMOS and TTL devices require fairly fast edges on inputs
                                                              2. PxOUT: Value to write to output pin
                                                                1. Bit 1: Output is high
                                                                  1. Bit 0: Output is low
                                                                  2. PxREN: Enables/Disables Pull-Up/Down resistor of corresponding I/O Pin
                                                                    1. Bit 1: Enabled
                                                                      1. Bit 0: Disabled
                                                                        1. If enabled...
                                                                          1. PxOUT = 1: Pull-Up
                                                                            1. Force it to be active low / normally high
                                                                              1. Resistor near Vcc
                                                                              2. PxOUT = 0: Pull-Down
                                                                                1. Force it to be active high / normally low
                                                                                  1. Resistor near Gnd
                                                                                2. Only for input pins (?)
                                                                                3. PxDS: Select drive current strength for output ports
                                                                                  1. Bit 1: Full drive strength
                                                                                    1. Bit 0: Reduced drive strength
                                                                                    2. PxSEL: Select pin function for pins with other peripheral module functions
                                                                                      1. Bit 0: I/O function selected
                                                                                        1. Bit 1: Peripheral module function selected
                                                                                        2. Unused: Set to output
                                                                                        3. Multiplex and Polled I/O
                                                                                          1. Switch Problem: Debouncing - Voltage does not go instantly and cleanly between VSS and VCC when switch is pressed
                                                                                            1. Solution: Generate a delay period > 10ms before verifying keypress
                                                                                              1. Solution: SR latch-based switch debouncing circuit
                                                                                                1. Solution: RC network-based switch debouncing circuit
                                                                                                2. Multiplex Keypad: 4 Output Pins and 3 Input Pins
                                                                                                  1. Getting key: Send voltage to output 1 by 1 and check if input is active 1 by 1
                                                                                                  2. Polling: Constantly check status of port for new data
                                                                                                    1. Simple to implement
                                                                                                      1. Wastes CPU resources and energy
                                                                                                    2. Handshaking and strobed I/O
                                                                                                      1. Handshaking: Automated process of negotiation that dynamically sets parameters of communications channel established between 2 entities before normal communication begins
                                                                                                        1. Handshake Control: To synchronise transfer of asynchronous data
                                                                                                          1. Make use of Data Strobe signal to indicate that data has been sent
                                                                                                            1. Can only be low after ACK* is received
                                                                                                            2. ACK* to acknowledge data is received (device) and MCU can accept new data
                                                                                                          2. Analogue I/O
                                                                                                            1. System Components
                                                                                                              1. Sensor: Converts analogue measurements into electrical signals (voltage/current)
                                                                                                                1. Signal Conditioning: Filtering, Amplification, Attenuation or Impedance Transformation
                                                                                                                2. Resolution: The smallest change to the analog voltage that can be converted to digital code
                                                                                                                  1. LSB: R = 1 / (2^n)
                                                                                                                  2. ADC: 12 bits, max data rate of 200 KSPS with 16 channels
                                                                                                                    1. tsample: time to sample and hold onto analogue input while it is being converted
                                                                                                                      1. tconvert: time it takes for conversion (13 x ADC12CLK)
                                                                                                                        1. Stores result in ADC12MEM register
                                                                                                                          1. Conversion limited by upper and lower limits
                                                                                                                        Show full summary Hide full summary

                                                                                                                        Similar

                                                                                                                        Personal Statement
                                                                                                                        reecey112k9
                                                                                                                        How to Create A Mindmap
                                                                                                                        PatrickNoonan
                                                                                                                        Creating Mind Maps with GoConqr
                                                                                                                        Sarah Egan
                                                                                                                        NEW: ExamTime's Mind Map Maker
                                                                                                                        Andrea Leyden
                                                                                                                        Macbeth Quotes/Themes
                                                                                                                        Michael LEwis
                                                                                                                        Genes, The Genetic Code, DNA and Chromosomes
                                                                                                                        Bee Brittain
                                                                                                                        CUBAN MISSILE CRISIS
                                                                                                                        Olivia Andrews
                                                                                                                        How Villainy is Depicted in Macbeth
                                                                                                                        scarletsnow491
                                                                                                                        Philosophy
                                                                                                                        Rebecca Harbury
                                                                                                                        Health and Social Care PIES
                                                                                                                        s1501118
                                                                                                                        Asch Study and Variations
                                                                                                                        littlestephie