next up previous contents
Next: Problems Up: Robot-computer Interface Previous: Operations in the Chip

Workstation's Role

The workstation has the control program running on it. For the communication protocol, the program opens the port /dev/ttya using the system call "open" and then controls the configuration of the port by using the call "ioctl" which can set the baud rate, type of transmission and reception, length of each character etc. The port was configured to operate at 9600 baud rate, non-echoing, raw mode where all the 8bits are received and transmitted as they are without checking or masking the 8th bit for parity. Also there is absolutely no processing done on the characters, so that the carriage return and line feed are read and sent as different characters, and the lower and upper case letters are mapped differently. Also the port was configured to be non-blocking using another system call "fcntl", which makes the read operations easier. So once the port has been opened in the correct format, all the program has to do is read or write to this port, using commands "read" and "write".

So the program gets the sensor values from the chip by reading from the port, and then scales them appropriately from Hex to Integers, uses them in the program to calculate the voltage to be sent out, and then again scales them to be between 0x00 and 0xFF (so that 0x00 corresponds to -10V and 0xFF to +10V), before writing to the port so that the chip can read it. Once the whole program is completed , the port is closed to prevent further communication, and allow access to other programs.



Matanya Elchanani
Wed Dec 18 17:00:21 EST 1996