浅谈68HC11SerialIO摘要.pptVIP

  • 3
  • 0
  • 约1.43万字
  • 约 77页
  • 2017-07-03 发布于湖北
  • 举报
68HC11 Serial I/O Chapter 11 Parallel I/O Serial I/O Why Serial I/O? Parallel Data Transfer Example Assume an 8-bit parallel interface with a transfer rate of 1Megabyte/s. How long will it take to transfer a 15Megabyte file? Parallel Data Transfer Solution Assume an 8-bit parallel I/O interface with a transfer rate of 1Megabyte per second. How long will it take to transfer a 15Megabyte file? Serial Data Transfer Example Assume an serial interface with a transfer rate of 1Megabit per second. Also, assume an overhead of 2 bits for each byte of data transferred. That is, we need to send 10 bits for every 8 bits of data transferred. How long will it now take to transfer a 15Megabyte file? Serial Data Transfer Solution Transfer rate = 1Megabit/s Overhead is 2 bits/byte How long will it now take to transfer a 15Megabyte file? Solution: Total Megabits = 15 Megabytes*(10 bits/byte) = 150 Megabits Transfer time: 150 Megabits* (1 second/Megabit) = 150 seconds Note: this is 10x the parallel transfer rate 68HC11 Serial I/O Two types: SCI – Serial Communications Interface Asynchronous: No clock needed SPI – Serial Peripheral Interface Synchronous: Clock needed Asynchronous Serial I/O Synchronous Serial I/O Using the Asynchronous Serial I/O (Ser. Comm. Iface.) on the 68HC11 Initialize the interface Data rate (baud rate) Word length Interrupts, if needed Write to the Data Register Read from the Data Register Initializing the Interface Polling Method Top Level Pseudo-Code 68HC11 Initialize the interface Set baud rate Set Mode Turn-on transmitter and receiver Initializing the Interface Set the Baud Rate Baud-$102B Baud Rate Control Reg Initializing the Interface Set the Mode SCCR1 - $102C SCI Control Register 1 Initializing the Interface Turn on the transmitter and receiver SCCR2 - $102D SCI Control Register 2 Initializing the Interface Pseudo-code 68HC11 Code Pseudo-code Initialize the Serial Port SCCR1 ? Mod

文档评论(0)

1亿VIP精品文档

相关文档