ELEC2630 EMBEDDED SYSTEMS THEORY Lecture 8: Interrupts and Communications
Interrupts • Priority by multiple interrupt handling is the method chosen by Microchip for the 18F PIC micro-controller • Htsoft, the C compiler supplier, added extra an extra keyword to allow two interrupt vectors • The micro-controller can have the priority switched off and the circuit reverts to the single interrupt vector mode • In this mode the device behaves like the 16 F PIC micro-controller
Interrupts • When the priority mode is enabled each interrupt can be assigned to the high or low priority vector • The C compiler allows one function to have the keyword interrupt which then handles all the high priority interrupts • An extra keyword low-priority is used for a second function to handle all the low priority interrupts
Interrupts • As the micro-controllers become more complex it is likely that C compilers will become more complex to enable all the new features to accessed • In the future the C compiler manual will become the new “text book”
Communications
Communications Principles • The asynchronous communication that has been investigated in the laboratory is an example of the connection between Interrupts and communications I/O • The conversion from parallel to serial and the addition of start and stop bits is carried out by circuitry within the micro-controller • The conversion from serial to parallel and the removal of the start and stop bits is carried out by another part of the circuitry
Interrupt use • The USART section of the micro-controller, named after the external I/O devices called a Universal Synchronous Asynchronous Receiver Transmitter • This circuitry has a number of Interrupts associated with it. One signals that the the transmit buffer is empty, i.e. Circuitry is ready to transmit data • A second signals that a character has been received, i.e. a serial character has been received and converted to a parallel byte
Communication Types • Other serial communication also use the same design of peripheral circuitry and Interrupt control • On micro-controllers these include SPI, Serial Peripheral Interface and USB • Another popular serial connection is CAN bus, Control Area Network • More sophisticated devices can now be found with Ethernet connections
Communication Uses • USB is commonly used for connection between micro-controller and a PC interface • CAN bus was originally developed for automobile use but is now used widely in factory automation • ETHERNET gives network access to microcontrollers and opens up a whole new area of distributed embedded systems
Wireless Devices • Many of the new wireless communications protocols have been developed for devices which are themselves embedded systems • Mobile phones and digital cameras are examples of devices using Bluetooth • Sensor networks using Zigbee and new derivatives such as Jennet are being developed where the communications is integrated into the micro-controller to make development easier
Distributed Embedded Systems • Bluetooth is for short range systems up to 10 metres • Zigbee range depends on the environment but can be 100’s of metres in the open air • CAN bus is now commonly used over areas several kilometres square • ETHERNET can give access worldwide and leads to the use of the World Wide Web as a significant part of the development of distributed embedded systems (this can be wireless with the usual range restrictions)
An example of an Ethernet enabled micro-controller