Software Developers View of Hardware Programming Hardware Devices
What does this mean? Computers usually interact with outside sources for input and output: CD-ROM Mouse Keyboard Scanner Monitor.
What does this mean? Most software developers require their software to interact with these devices. So it is therefore important to understand how they are programmed and especially, how they operate. Any hardware device that can be programmed uses two processes: Sensor Actuator
Sensor Any device that converts input from the environment into a digital signal. The signal is then interpreted by the software.
Actuator An output device that performs a mechanical action. Actuators receive digital signals from software.
Processing a Data Stream What is a Data Stream? A packet of binary data consisting of a header, data characters and a trailer. For example: Header Data Trailer 010101 | 101010100 | 0101010 The information contains the data and a check to see if it is correct.
Processing a Data Stream What is in the header? Specifies how much data is to be transmitted. Contain error checking data such as: Parity Checking CRC 16 Specifies the device in which it is coming from.
Processing a Data Stream What is in the data section? Includes control characters i.e SHIFT + B All subsequent instructions to be processed by the CPU.
Processing a Data Stream What is in the trailer section? Data bits that end the block. Error checking bits Memory clear instructions.
Processing a Data Stream Recognising and stripping control Characters Control characters are represented by the ASCII values 0 – 31 and are typed while pressing the control key.
Processing a Data Stream Counting the Data Characters The header field will normally contain all required information relating to the size of data packets.
Processing a Data Stream Extracting Data Once the header and trailer have been removed, the hardware within the CPU will extract the data, and relevant software will carry out the instructions.
Keyboard Example How a keyboard transmits data? Pressing a key causes a change to take place in the amount of current flowing through key circuits. A microprocessor sends a signal relating to the pressed key along a cable port notifying the BIOS.
Keyboard Example The BIOS translates the codes into ASCII and that particular character or command is stored in memory.
Control Systems These are systems that include hardware devices, software and especially the use of sensors and actuators. There are two broad categories of control systems: Open Control Systems Closed Control Systems
Open Control Systems These systems do not react to their environment. These systems normally require a user to activate the actuator. E.g. Hotel Door Lock.
Closed Control Systems These systems actually react to their environment. This system uses sensors and programmed structures to control the actuators. For Example: Anti-Lock Breaking System
Question 1 A robotic moon car is designed to use digital controls. The motor of the car receives the following commands from a user. Motor off. Stop Turns left X deg LeftX Turns right X deg RightX Moves in straight line at X speed. StraightX Trailer <-T Header ->H
Question 1 The speed for the car can range from + 100 (Fastest) to -100 (Backward) 1.) Identify the category of control system. 2.) Identify the problems with the following instruction: ->HStraight20StopRight90Forward10->H 3.) Construct a data stream to carry out the following tasks: Move forward 30 Move left 45, move forward 80 Move right 20, backward -20, stop
Question 2 Complete the following text book questions: SET 10F Question 11 Question 13 Question 14

Programming Hardware Devices

  • 1.
    Software Developers Viewof Hardware Programming Hardware Devices
  • 2.
    What does thismean? Computers usually interact with outside sources for input and output: CD-ROM Mouse Keyboard Scanner Monitor.
  • 3.
    What does thismean? Most software developers require their software to interact with these devices. So it is therefore important to understand how they are programmed and especially, how they operate. Any hardware device that can be programmed uses two processes: Sensor Actuator
  • 4.
    Sensor Any devicethat converts input from the environment into a digital signal. The signal is then interpreted by the software.
  • 5.
    Actuator An outputdevice that performs a mechanical action. Actuators receive digital signals from software.
  • 6.
    Processing a DataStream What is a Data Stream? A packet of binary data consisting of a header, data characters and a trailer. For example: Header Data Trailer 010101 | 101010100 | 0101010 The information contains the data and a check to see if it is correct.
  • 7.
    Processing a DataStream What is in the header? Specifies how much data is to be transmitted. Contain error checking data such as: Parity Checking CRC 16 Specifies the device in which it is coming from.
  • 8.
    Processing a DataStream What is in the data section? Includes control characters i.e SHIFT + B All subsequent instructions to be processed by the CPU.
  • 9.
    Processing a DataStream What is in the trailer section? Data bits that end the block. Error checking bits Memory clear instructions.
  • 10.
    Processing a DataStream Recognising and stripping control Characters Control characters are represented by the ASCII values 0 – 31 and are typed while pressing the control key.
  • 11.
    Processing a DataStream Counting the Data Characters The header field will normally contain all required information relating to the size of data packets.
  • 12.
    Processing a DataStream Extracting Data Once the header and trailer have been removed, the hardware within the CPU will extract the data, and relevant software will carry out the instructions.
  • 13.
    Keyboard Example Howa keyboard transmits data? Pressing a key causes a change to take place in the amount of current flowing through key circuits. A microprocessor sends a signal relating to the pressed key along a cable port notifying the BIOS.
  • 14.
    Keyboard Example TheBIOS translates the codes into ASCII and that particular character or command is stored in memory.
  • 15.
    Control Systems Theseare systems that include hardware devices, software and especially the use of sensors and actuators. There are two broad categories of control systems: Open Control Systems Closed Control Systems
  • 16.
    Open Control SystemsThese systems do not react to their environment. These systems normally require a user to activate the actuator. E.g. Hotel Door Lock.
  • 17.
    Closed Control SystemsThese systems actually react to their environment. This system uses sensors and programmed structures to control the actuators. For Example: Anti-Lock Breaking System
  • 18.
    Question 1 Arobotic moon car is designed to use digital controls. The motor of the car receives the following commands from a user. Motor off. Stop Turns left X deg LeftX Turns right X deg RightX Moves in straight line at X speed. StraightX Trailer <-T Header ->H
  • 19.
    Question 1 Thespeed for the car can range from + 100 (Fastest) to -100 (Backward) 1.) Identify the category of control system. 2.) Identify the problems with the following instruction: ->HStraight20StopRight90Forward10->H 3.) Construct a data stream to carry out the following tasks: Move forward 30 Move left 45, move forward 80 Move right 20, backward -20, stop
  • 20.
    Question 2 Completethe following text book questions: SET 10F Question 11 Question 13 Question 14