Mechatronic Systems Engineering 2202A/B Lecture Notes - Lecture 6: Microcontroller, Peripheral, Input Device
Document Summary
An input/output (i/o) operation: the transfer of data between the cpu and the external world. Peripheral devices: pieces of equipment that are interfaced to the i/o ports of a microcontroller. Typically, an interface circuit is used to synchronize data transfers between the cpu and the peripheral device. Interfaces are required to handle differing speeds and characteristics. On input, data is placed in a data register (buffer) until it is read by the cpu. On output, cpu places data in the register until it is read by the peripheral. When getting data from an input device, the cpu must ensure that the data is valid by one of two methods: Polling: status bit is continually checked, cpu must wait for desired condition. Interrupt: interface chip sends interrupt to cpu when it has valid data; operation of cpu is suspended to handle interrupt. High: bit value = 1, voltage vcc. Low: bit value = 0, voltage gnd.