240 likes | 357 Vues
This document explores the intricacies of how computers control the world through various hardware mechanisms. It discusses the functionality of joints as motors, the importance of computer ports for memory interaction, and the critical nature of maintaining clean power levels for reliable operation. Topics include the handling of binary values, data memory management, and the implications of industrial power surges on computer hardware. Practical examples and programming concepts provide insights into the interplay between software and hardware.
E N D
Each joint is a motor that can be turned on and off with a switch
A Computer “port” • Connects 1 byte of memory to outside world
A printer “Port” • Computer connects an internal byte variable to the printer switches, and changes the values to tell the printer what to print
Address Data Memory r/w
I/0 Memory Data Memory Program Memory Fast Specialty Memory
Memory mapped I/O 8-bit Your Program Driver Port A Decimal Variable A Binary Value A function call
an example program Private Sub Write_Port(value As Integer) txtByteOut.Text = (value) 'decimal Status = cbUSBDOut(DeviceNum, RELAY_PORT, value) If value < 16 Then txtHexOut.Text = "0" & (Hex(value)) Else txtHexOut.Text = (Hex(value)) End If ' hex txtBinary.Text = CBin(value) 'binary End Sub
the overriding concern • the computer power levels (+/- 5, +/- 12) are EXTREMELY sensitive to surges • industrial machinery regularly injects surges into its power lines (+24 vdc) • computer power (clean) MUST be kept separate from industrial power (dirty) • reference pt (ground) is connected between the two in ONE PLACE ONLY
Computer “dirty” Environment
Computer Environment
buying parts http://www.sparkfun.com