SlideShare a Scribd company logo
31 st  Jan to 1 st  Feb 2008 TECHNOLOGY ROBOTICS SOCIETY Indian Institute of Technology, Kharagpur
Computer Control Parallel & Serial Port Communication
PC Parallel Port - Features Commonly known as the printer port 25 pin D-Type connector It has  12 digital output pins, 5 digital input pins Pins operate at the TTL voltage level i.e. 0 – 5V Port identified by a base address in the computer I/O memory space
PC Parallel Port – Pin Layout
PC Parallel Port – I/O Registers Most PC’s have 378 Hex base address  8 output pins are accessed via the DATA port (Base address) 4 output pins are accessed via the CONTROL port (Base address + 2) 5 input pins are accessed via the STATUS port (Base address + 1)
PC Parallel Port – I/O Registers - marked bits in register byte are unused
Accessing Parallel Port – VC ++ #include <conio.h> #define Data  0x378 // Base address #define Status  0x379 // Base address + 1 #define Control 0x37a // Base address + 2 int main () { unsigned char Bits; Bits = 0b11001010; _outp(Data, Bits);  /* output data */ Bits = _inp(Status);/*  input data */  return (0); }
PC Serial Port - Features Most commonly 9 pin D-Type connector. 25 pin D-Type is rare Pins operate at -25 to + 25 voltage levels Data transmitted as a bit sequence Known as the EIA RS232C port or simply RS232
EIA RS232C Specifications Logic 0 is between +3 to +25 volts Logic 1 is between -3 to -25 volts -3 to +3 volts region is undefined Maximum data rate of 19,600 bps
Serial Port vs. Parallel Port Serial cables can be much longer that Parallel cables 50V swing compared to 5V swing Null Modem Configuration just needs 3 core cable compared to 19 core parallel port cable Serial suited for wireless transmission Microcontrollers just need two pins (RXD & TXD) for communication
Null Modem Configuration Pin 3 Transmit Data Pin 2 Receive Data Pin 5 Signal Ground Pin 4, 6, 1 shorted together Pin 7, 8 shorted together
RS-232 Waveforms Asynchronous Communication i.e. separate clock at both ends Frame synchronization done by the start / stop bit Line is kept logic 1 when idle. Start bit is logic 0 Bit order from LSB to MSB
RS-232 Level Converters For using the RS232 data, digital devices need TTL/CMOS voltage levels Level conversion is done using IC MAX232 / DS232
RS-232 frame decoding The decoding of the bit sequence frame is done by computer hardware When communicating with robots, decoding done by onboard microcontroller Microcontroller Serial communication interface is known as UART (Universal Asynchronous Receiver Transmitter)
Accessing Serial Port - VB MSComm Control 6.0 is used for serial port communication
MSComm Control Properties
MSComm Control Properties Com Port identification number Settings: Baud Rate, Parity Check, Data Bits, Stop Bits Hand Shaking Method : Xon/Xoff for null-modem configuration
MSComm Control Properties
MSComm Control Properties InBufferSize : Input buffer size OutBufferSize : Output buffer size RThreshhold : Receive size for interrupt generation SThreshhold : Min. transmit size InputLen : Number of bytes to be picked up from the input buffer EOFEnable : Search for EOF character
MSComm Control Properties
MSComm Control Properties ParityReplace : Parity Error replacement character NullDiscard : Null characters sent to the receive buffer or not RTSEnable : Request to Send enable DTREnable : Data Terminal Ready
Example Code ‘  Receive Data Private Sub CommunicationTerminal_OnComm() Dim InputBuffer As String If CommunicationTerminal.CommEvent = comEvReceive Then InputBuffer = CommunicationTerminal.Input End If ‘  Use InputBuffer as per requirement End Sub ‘  Transmit Data If CommunicationTerminal.PortOpen = True Then CommunicationTerminal.Output = “Hello” End If

More Related Content

PDF
Unit 3-1 (1)
PDF
Lecture mp 7(interface)
PPT
8255_utkarsh_kulshrestha
PPT
1205 Ppi 8279
PDF
8279nptel
PPTX
8255 Programmable parallel I/O
PPTX
8255:ppi & 8259:pic
Unit 3-1 (1)
Lecture mp 7(interface)
8255_utkarsh_kulshrestha
1205 Ppi 8279
8279nptel
8255 Programmable parallel I/O
8255:ppi & 8259:pic

What's hot (16)

PPT
Interfacing ics for microprocessor
PPT
Interfacing 8255
PPTX
8279 in microprocessor
PPTX
Embedded system (Chapter )
PPTX
Key board interface
PPT
8255 ppi
PPT
I Ointerface in mp
PPTX
PPT
Chapter
PDF
Embedded system (Chapter 2) part 2
PPTX
Interfacing of 8255 IC By Er. Swapnil Kaware.
PPTX
8255 PPI
DOC
Microprocessor Basics 8085-8255 ch-5
PDF
8279 d
PDF
Hmi vfd modbus communication
PPT
Serial Communication In Atmega 16
Interfacing ics for microprocessor
Interfacing 8255
8279 in microprocessor
Embedded system (Chapter )
Key board interface
8255 ppi
I Ointerface in mp
Chapter
Embedded system (Chapter 2) part 2
Interfacing of 8255 IC By Er. Swapnil Kaware.
8255 PPI
Microprocessor Basics 8085-8255 ch-5
8279 d
Hmi vfd modbus communication
Serial Communication In Atmega 16
Ad

Viewers also liked (20)

PPS
Robotix Tutorial 4
PPS
Robotix Tutorial 7
PPS
Robotix Tutorial 9
PPS
A Tutorial On Ip 2
PPS
A Tutorial On Ip 1
PPS
Robotix Tutorial 6
PPTX
Arduino Foundations
PDF
Freshers guide 2011, iit guwahati
PPS
Robotix Tutorial 5
PPT
Raspberry pi 3
PPTX
Robotics workshop PPT
PPTX
QUADCOPTER
PDF
Quadcopter Technology
PPTX
Introduction to raspberry pi
PDF
QUAD COPTERS FULL PPT
PPT
Raspberry pi : an introduction
PPT
Intro to Arduino
PPTX
How Social Media is Running Our Minds ??
PPTX
Arduino obstacle avoidance robot
PDF
How does a Quadrotor fly? A journey from physics, mathematics, control system...
Robotix Tutorial 4
Robotix Tutorial 7
Robotix Tutorial 9
A Tutorial On Ip 2
A Tutorial On Ip 1
Robotix Tutorial 6
Arduino Foundations
Freshers guide 2011, iit guwahati
Robotix Tutorial 5
Raspberry pi 3
Robotics workshop PPT
QUADCOPTER
Quadcopter Technology
Introduction to raspberry pi
QUAD COPTERS FULL PPT
Raspberry pi : an introduction
Intro to Arduino
How Social Media is Running Our Minds ??
Arduino obstacle avoidance robot
How does a Quadrotor fly? A journey from physics, mathematics, control system...
Ad

Similar to Robotix Tutorial 8 (20)

PPT
AN INTRODUCTION TO SERIAL PORT INTERFACING
PPTX
ES UNIT3.pptx
PDF
EJ5I Embedded system chapter 2 of diploma Chapter 3.pdf
PPTX
Serial Communication in 8051
PPTX
Class 4 I/O Ports
PDF
Serial Port Device Driver
PPTX
Universal Serial Communication Interface
PPT
8051 serial communication-UART
DOCX
Project_intership
PDF
MPS W8-L2L3 Programming AVR Serial Port Ia (in C).pdf
PDF
Lecture 3 - Serial Communicationkahfag.pdf
PPT
Chap10
PPT
8051 microcontroller notes continuous
PPTX
Serial Communication
PPTX
Serial data transfer
PDF
Unit 3 devices&amp;buses
PPTX
serial_communication_part2_Jan2025_session1.pptx
PPTX
45039336 rs232
PPT
Unit_V_CPU_PC_interfacing_With_External_Devices_RS232_IEEE_488.ppt
PPTX
Serial communication
AN INTRODUCTION TO SERIAL PORT INTERFACING
ES UNIT3.pptx
EJ5I Embedded system chapter 2 of diploma Chapter 3.pdf
Serial Communication in 8051
Class 4 I/O Ports
Serial Port Device Driver
Universal Serial Communication Interface
8051 serial communication-UART
Project_intership
MPS W8-L2L3 Programming AVR Serial Port Ia (in C).pdf
Lecture 3 - Serial Communicationkahfag.pdf
Chap10
8051 microcontroller notes continuous
Serial Communication
Serial data transfer
Unit 3 devices&amp;buses
serial_communication_part2_Jan2025_session1.pptx
45039336 rs232
Unit_V_CPU_PC_interfacing_With_External_Devices_RS232_IEEE_488.ppt
Serial communication

Recently uploaded (20)

PDF
Katrina Stoneking: Shaking Up the Alcohol Beverage Industry
PDF
WRN_Investor_Presentation_August 2025.pdf
PDF
Chapter 5_Foreign Exchange Market in .pdf
PPTX
ICG2025_ICG 6th steering committee 30-8-24.pptx
PDF
DOC-20250806-WA0002._20250806_112011_0000.pdf
PDF
Stem Cell Market Report | Trends, Growth & Forecast 2025-2034
PDF
Power and position in leadershipDOC-20250808-WA0011..pdf
PPTX
job Avenue by vinith.pptxvnbvnvnvbnvbnbmnbmbh
PDF
Roadmap Map-digital Banking feature MB,IB,AB
PDF
A Brief Introduction About Julia Allison
DOCX
unit 2 cost accounting- Tender and Quotation & Reconciliation Statement
PDF
Laughter Yoga Basic Learning Workshop Manual
PPTX
5 Stages of group development guide.pptx
PDF
kom-180-proposal-for-a-directive-amending-directive-2014-45-eu-and-directive-...
PPTX
CkgxkgxydkydyldylydlydyldlyddolydyoyyU2.pptx
PPTX
Belch_12e_PPT_Ch18_Accessible_university.pptx
PDF
Unit 1 Cost Accounting - Cost sheet
PDF
How to Get Business Funding for Small Business Fast
DOCX
Business Management - unit 1 and 2
PPT
340036916-American-Literature-Literary-Period-Overview.ppt
Katrina Stoneking: Shaking Up the Alcohol Beverage Industry
WRN_Investor_Presentation_August 2025.pdf
Chapter 5_Foreign Exchange Market in .pdf
ICG2025_ICG 6th steering committee 30-8-24.pptx
DOC-20250806-WA0002._20250806_112011_0000.pdf
Stem Cell Market Report | Trends, Growth & Forecast 2025-2034
Power and position in leadershipDOC-20250808-WA0011..pdf
job Avenue by vinith.pptxvnbvnvnvbnvbnbmnbmbh
Roadmap Map-digital Banking feature MB,IB,AB
A Brief Introduction About Julia Allison
unit 2 cost accounting- Tender and Quotation & Reconciliation Statement
Laughter Yoga Basic Learning Workshop Manual
5 Stages of group development guide.pptx
kom-180-proposal-for-a-directive-amending-directive-2014-45-eu-and-directive-...
CkgxkgxydkydyldylydlydyldlyddolydyoyyU2.pptx
Belch_12e_PPT_Ch18_Accessible_university.pptx
Unit 1 Cost Accounting - Cost sheet
How to Get Business Funding for Small Business Fast
Business Management - unit 1 and 2
340036916-American-Literature-Literary-Period-Overview.ppt

Robotix Tutorial 8

  • 1. 31 st Jan to 1 st Feb 2008 TECHNOLOGY ROBOTICS SOCIETY Indian Institute of Technology, Kharagpur
  • 2. Computer Control Parallel & Serial Port Communication
  • 3. PC Parallel Port - Features Commonly known as the printer port 25 pin D-Type connector It has 12 digital output pins, 5 digital input pins Pins operate at the TTL voltage level i.e. 0 – 5V Port identified by a base address in the computer I/O memory space
  • 4. PC Parallel Port – Pin Layout
  • 5. PC Parallel Port – I/O Registers Most PC’s have 378 Hex base address 8 output pins are accessed via the DATA port (Base address) 4 output pins are accessed via the CONTROL port (Base address + 2) 5 input pins are accessed via the STATUS port (Base address + 1)
  • 6. PC Parallel Port – I/O Registers - marked bits in register byte are unused
  • 7. Accessing Parallel Port – VC ++ #include <conio.h> #define Data 0x378 // Base address #define Status 0x379 // Base address + 1 #define Control 0x37a // Base address + 2 int main () { unsigned char Bits; Bits = 0b11001010; _outp(Data, Bits); /* output data */ Bits = _inp(Status);/* input data */ return (0); }
  • 8. PC Serial Port - Features Most commonly 9 pin D-Type connector. 25 pin D-Type is rare Pins operate at -25 to + 25 voltage levels Data transmitted as a bit sequence Known as the EIA RS232C port or simply RS232
  • 9. EIA RS232C Specifications Logic 0 is between +3 to +25 volts Logic 1 is between -3 to -25 volts -3 to +3 volts region is undefined Maximum data rate of 19,600 bps
  • 10. Serial Port vs. Parallel Port Serial cables can be much longer that Parallel cables 50V swing compared to 5V swing Null Modem Configuration just needs 3 core cable compared to 19 core parallel port cable Serial suited for wireless transmission Microcontrollers just need two pins (RXD & TXD) for communication
  • 11. Null Modem Configuration Pin 3 Transmit Data Pin 2 Receive Data Pin 5 Signal Ground Pin 4, 6, 1 shorted together Pin 7, 8 shorted together
  • 12. RS-232 Waveforms Asynchronous Communication i.e. separate clock at both ends Frame synchronization done by the start / stop bit Line is kept logic 1 when idle. Start bit is logic 0 Bit order from LSB to MSB
  • 13. RS-232 Level Converters For using the RS232 data, digital devices need TTL/CMOS voltage levels Level conversion is done using IC MAX232 / DS232
  • 14. RS-232 frame decoding The decoding of the bit sequence frame is done by computer hardware When communicating with robots, decoding done by onboard microcontroller Microcontroller Serial communication interface is known as UART (Universal Asynchronous Receiver Transmitter)
  • 15. Accessing Serial Port - VB MSComm Control 6.0 is used for serial port communication
  • 17. MSComm Control Properties Com Port identification number Settings: Baud Rate, Parity Check, Data Bits, Stop Bits Hand Shaking Method : Xon/Xoff for null-modem configuration
  • 19. MSComm Control Properties InBufferSize : Input buffer size OutBufferSize : Output buffer size RThreshhold : Receive size for interrupt generation SThreshhold : Min. transmit size InputLen : Number of bytes to be picked up from the input buffer EOFEnable : Search for EOF character
  • 21. MSComm Control Properties ParityReplace : Parity Error replacement character NullDiscard : Null characters sent to the receive buffer or not RTSEnable : Request to Send enable DTREnable : Data Terminal Ready
  • 22. Example Code ‘ Receive Data Private Sub CommunicationTerminal_OnComm() Dim InputBuffer As String If CommunicationTerminal.CommEvent = comEvReceive Then InputBuffer = CommunicationTerminal.Input End If ‘ Use InputBuffer as per requirement End Sub ‘ Transmit Data If CommunicationTerminal.PortOpen = True Then CommunicationTerminal.Output = “Hello” End If