Skip to content

Chap4 Input, Output and Interrupts

Wired Connections

  • Parallel (one wire per bit):并行
    • ATA: Advanced Technology Attachment
    • PCI: Peripheral Component Interface
    • SCSI: Small Computer System Interface…
  • Serial (one wire per direction):串行
    • SPI: Serial Peripheral Interface bus
    • I2C: Inter-Integrated Circuit
    • USB: Universal Serial Bus
    • SATA: Serial ATA
    • CAN…
  • Mixed (one or more “lanes”)
    • PCIe: PCI Express
  • GPIO(General Purpose I/O):通用输入输出
  • PWM(Pulse Width Modulation):脉冲宽度调制

串行异步通信(Universal Asynchronous Receiver-Transmitter)

I2C 总线

I2C(Inter-Integrated Circuit) 总线

  • 由数据线 SDA 和时钟 SCL 构成的串行总线,可发送和接收数据
  • 各种被控制电路均并联在这条总线上,每个电路和模块都有唯一地址
  • CPU 发出的控制信号分为地址码和控制量两部分
  • I2C 总线在传送数据时共有三种类型信号:开始信号、结束信号、应答信号
    • 开始信号:SCL 为高电平时,SDA 由高电平向低电平跳变,开始传送 数据。
    • 结束信号:SCL 为高电平时,SDA 由低电平向高电平跳变,结束传送 数据。
    • 应答信号:接收数据的 IC 在接收到 8bit 数据后,向发送数据的 IC 发出特定的低电平脉冲,表示已收到资料

CAN 总线

CAN(Controller Area Network) 总线

  • Polling:轮询
    • Main loop uses each I/O device periodically.
    • If output is to be produced, produce it.
    • If input is ready, read it.
  • Interrupts – 中断
    • External hardware alerts the processor that input is ready.
    • Processor suspends what it is doing.
    • Processor invokes an interrupt service routine (ISR).
    • ISR interacts with the application concurrently.

评论区

如果有什么问题或想法,欢迎大家在下方留言~