ECE Unit 6: General Purpose Input/Output

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

20 Terms

1
New cards

Whats usually on each on-chip peripheral device?

It usually has a few registers, like control registers, status registers, data input registers and data output registers

2
New cards

What are the 2 approaches to exchange data between the processor core and a peripheral device?

  1. Port mapped I/O: uses special CPU instructions

  2. Memory mapped I/O:

  • most CPUs today use this for I/O

  • its simpler and more convenient to interface I/O

    • each device is assigned to a memory address in the address space of the microprocessor

  • uses native load/store instructions to input or output data: LDR/STR Reg, [Register, #immediate value]

3
New cards

What type of microprocessors use memory mapped I/O

ARM microprocessors

4
New cards

Explain parallel ports and components of them:

There are many parallel ports implemented in the FPGA that support input, output, and bidirectional transfers of data between the ARM A9 processor and I/) periphery

  • Each parallel port is assigned a base address and contains up to 4 32-nit registers.

    • ports that have output capability include a writable data register

    • ports with input capability have a readable data register

  • Bidirectional parallel ports also include a direction register

  • Each bit in the data register can be configured as

    • an input by setting the bit in the direction register to 0 or

    • an output by setting this bit position to 1

5
New cards

What is 3 state pipelining and what does it allow?

Pipelining includes fetching instruction, decoding it and executing it, and it allows hardware resources to be fully utilized.

6
New cards

What happens when a push button is pressed?

The program waits in a loop until the key is released.

7
New cards

How many pins does a typical joystick hardware have?

It usually has 6 pins.

  • one to connect to the power supply

  • 4 switches oriented in the up, down, left and right directions

  • and a 5th switch connected to a button on the shaft (called the centre)

These joysticks are called 4-way directional with center select

8
New cards

What does reading from the GPIO pins do?

It informs the microcontroller which in which direction the user is pushing the joystick shaft, allowing the program to adjust accordingly

9
New cards

What are the hardware components of a JS 5208 joystick?

  • pin 1 connects to power supply

  • pin 2 connects to the left button

  • pin 3 connects to the center button

  • pin 4 connects to the up button

  • pin 5 connects to the right button

  • pin 6 connects to the down button

NOTE different joystick models have different pin assignments

10
New cards

How many GPIO ports are there and how many pins in each port?

There are 8 GPIO Ports: A, B, C, D, E, F, G, H, and there’s up to 16 pins in each port

11
New cards

What do the protection diodes do in a I/O Port Bit Input and Output

The protection diodes limit the input voltage to not be above Vdd or below Vss

12
New cards

Whats Debouncing?

When a switch or button is pressed, the switch/button may bounce back and forth a few times before settling down.

Example signal when a switch is pressed (without debouncing)

To solve: the bounces usually settle within 20 ms to 30ms:

13
New cards

Whats bouncing?

Its an electromechanical noise in the system that could be interpreted as a meaningful signal if the CPU is acting too quickly

14
New cards

What are the solutions to eliminate debouncing effects?

  1. Software

  2. Hardware

15
New cards

How to use hardware vs software to eliminate debouncing effects:

A simple low pass RC filter can remove most electrical noise, bounces and glitches from an input signal and a Schmitt trigger can clean up the resulting analog signal.

  • Sometimes a combo of hardware and software filtering is also necessary, depending on the peripheral and how important it is for the microcontroller to receive accurate input.

16
New cards

What are software debouncing solutions?

  1. Read the switch after a sufficient delay to allow the bounces to settle down

  2. Read periodically, and use a counter as a filter

    • reset the counter when the signal is “unpressed”

    • counts up if “pressed”

    • If counter>threshold, the contacts has stopped bouncing

17
New cards

What is the Schmidt trigger used for?

To reduce noise and increase slew rate.

18
New cards

Problem with active keypad: When software scans that there are 2 buttons clicked at the same time, the short circuit causes hardware damage. There are 2 solutions to this problem:

  1. Hardware: configure all output pins as open drain instead of push-pull.

  2. Software: switch all the row pins to input except the one that’s currently used as output.

19
New cards

Whats a passive keypad?

It doesn’t have a power supply

20
New cards

What does the microcontroller typically do with row pins and column pins?

The microcontroller typically writes outputs to the row pins and reads inputs from the column pins. Its assumed that the input pins have pull down resistors, or otherwise interpret a floating value as zero.

  • this kind of GPIO keypad therefore requires some of the port pins to be set to input, and others set to output