How To Communicate With A Microsoft 851 (Tongue) From A Computer To A Microtongues (Tosher) (Toll) (For A Microsimmer) (Aipa) (I386) (



Similar documents
8051 Serial Port. Crystal TXD. I/O Device RXD. Embedded Systems Peripherals

Objectives. Basics of Serial Communication. Simplex vs Duplex. CMPE328 Microprocessors (Spring ) Serial Interfacing. By Dr.

Serial Communications

Application Note 83 Fundamentals of RS 232 Serial Communications

Manual Serial PCI Cards

PCMCIA 1 Port RS EDITION OCTOBER 1999

RS-232 COMMUNICATIONS

Using Xbee in Serial Communication

RJ45 Shielded (standard) port pinout. CS9000, Jetstream , Lanstream 2000, RTA8/RJX, RRC16, MTA8/RJX & SXDC8/RJX

Serial Communications

RS232C < - > RS485 CONVERTER S MANUAL. Model: LD15U. Phone: / 97 / 98 (M)

Advanced Data Capture and Control Systems

Flash Microcontroller. Memory Organization. Memory Organization

1.1 Connection Direct COM port connection. 1. Half duplex RS232 spy cable without handshaking

16-Port RS232 to USB2.0 High Speed Multi Serial Adapter (w/ Metal Case) Installation Guide

Cable Specifications and Information

USART and Asynchronous Communication

Elettronica dei Sistemi Digitali Costantino Giaconia SERIAL I/O COMMON PROTOCOLS

USB TO SERIAL ADAPTER

Cable Guide. Click on the subject to view the information. Digi Cables Building Cables General Cable Information

ELAN DIGITAL SYSTEMS LTD. SL232 PC- CARD USER S GUIDE

Cable Specifications and Information

4 Character 5x7 LED Matrix Display

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

RS-422/485 Multiport Serial PCI Card. RS-422/485 Multiport Serial PCI Card Installation Guide

Appendix A. This Appendix includes the following supplemental material:

Industrial Multi-port Serial Cards

2-Port RS232/422/485 Combo Serial PCI Card

WHQL Certification Approval...2 User Interface...3 SUNIX s COMLab..4

Quectel Cellular Engine

WHQL Certification Approval...2 User Interface K software FIFO 4 Universal PCI Interface...5 Ready for 64-bit System...5

LOW COST GSM MODEM. Description. Part Number

The Analyst RS422/RS232 Tester. With. VTR, Monitor, and Data Logging Option (LOG2) User Manual

Single channel data transceiver module WIZ2-434

When we look at the connector pinout of the RS232 port, we see two pins which are certainly used

User Manual IC-485AI

Docklight Pro Monitor User Manual 10/2015

DK40 Datasheet & Hardware manual Version 2

Cable Pinouts. SRP I/O Module

USB to serial chip CH340

Design and Implementation of Home Monitoring System Using RF Technology

LINDY ELECTRONICS LIMITED & LINDY-ELEKTRONIK GMBH - SECOND EDITION

Encore Controller to Router Connections

Cabling Guide for Console and AUX Ports

Date Rev. Details Author

Future Technology Devices International Ltd

Siemens DECT Engine MD32. Product Description. Information and Communication Products

Current Loop Application Note 1495

What is Easy-Radio? Devices Covered. Frequency Hopping Transceiver. Where x00 denotes frequency of operation. E.g. 400 = 433MHz

VSCOM USB PRO Series Industrial I/O Adapters

How to setup a serial Bluetooth adapter Master Guide

2-Port RS232/422/485 Combo Serial to USB2.0 Adapter (w/ Metal Case and Screw Lock Mechanism) Installation Guide

MCB3101 (Class I) WiRobot Serial Bluetooth Wireless Module User Manual

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Microprocessor Project Laboratory

Data Cables. Schmitt TTL LABORATORY ELECTRONICS II

RS232 Board datasheet

ALL-USB-RS422/485. User Manual. USB to Serial Converter RS422/485. ALLNET GmbH Computersysteme Alle Rechte vorbehalten

Modbus Communications for PanelView Terminals

Parallel IO. Serial IO. Parallel vs. Serial IO. simplex vs half-duplex vs full-duplex. Wires: Full Duplex. Wires: Simplex, Half-duplex.

TCP/IP Converter DDS EX-9132 Operation Manual for 8051 Series

UART IP Core Specification. Author: Jacob Gorban

Wireless Home Security System

Testing Data Radio Modem with Serial Port Tool V1.20

Computer Performance. Topic 3. Contents. Prerequisite knowledge Before studying this topic you should be able to:

MDM192 MULTI-DROPS DIGITAL MODEM FOR PRIVATE LINE. USER GUIDE Document reference :

GSM Interfacing Board

SyncLink GT2/GT4 Serial Adapter

How To Set Up A Modem (Marc) Model (Marc) Model 2 (Marr) Model 1 (Marm) Model 4 (Mariar) Model 8 (Marp) Model 6 (Mar

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate With the Eagle System

INFORMATICA INDUSTRIALE

Cable Guide Including all PortServer TS, Digi Connect, and Digi One Products

TTL-232R-3V3 USB to TTL Serial Converter Cable

CoE3DJ4 Digital Systems Design. Chapter 4: Timer operation

Modification of an AOR AR-8600 receiver to tune it with a ACECO FC-3002 frequency finder

1-Port R422/485 Serial PCIe Card

LS-101 LAN to Serial Device server. User s Manual

BIT COMMANDER. Serial RS232 / RS485 to Ethernet Converter

PFB366 Profibus-DP Gateway User Manual

8051 hardware summary

TRP-C31M MODBUS TCP to RTU/ASCII Gateway

INFORMATICA INDUSTRIALE

1 Port FTDI USB to RS232 Null Modem Adapter

2-port RS-422 / 485 Universal PCI

How To Use A Sunix Ser5037A Card On A Pc Or Mac Or Mac With A Microsoft Powerbook (Powerbook) With A Powercard (Powercard) And Powercard With A Mini Usb (Powerboard) With An

AVR305: Half Duplex Compact Software UART. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

DECT Module UM-9802 Datasheet

The Secrets of Flow Control in Serial Communication

KSH-3000-MI. Swipe Card Reader. ( Magnetic / IC Card two in One Reader ) Revision Reason Date V

How to setup a serial Bluetooth adapter

Why you need to monitor serial communication?

2-port RS-232 High Speed Low Profile Universal PCI Serial Board

FOSTCDR. Industrial Serial to Multimode Fiber Optic Converter PRODUCT INFORMATION B&B ELECTRONICS. Specifications Serial Technology

Part Number Description Packages available

VMR6512 Hi-Fi Audio FM Transmitter Module

LBNP RS-232/485/422 serial device server. User manual

Introduction the Serial Communications Huang Sections 9.2, 10.2 SCI Block User Guide SPI Block User Guide

Using HyperTerminal with Agilent General Purpose Instruments

Lab Experiment 1: The LPC 2148 Education Board

One Port Serial Server Users Manual Model ESP901, ESP901E

USB2.0 <=> I2C V4.4. Konverter Kabel und Box mit Galvanischetrennung

Transcription:

851 Serial Communications 1

Parallel vs. Serial Parallel Communication (Printer) Fast, but distance cannot be great. Expensive One byte at a time or more Sender Receiver Serial Communication (Telephone line) Long distance cheaper Sender City A One bit/data line Receiver City B 2

Serial Communications Serial Communication (Telephone line) P/S: Parallel-in-Serial-out Shift Register S/P: Serial-in-Parallel-out Shift Register D/A: Digital-Analog Converter A/D: Analog-Digital Converter Sender City A P/S D/A A/D D/A S/P Receiver City B 3

Asynchronous vs. Synchronous Two methods of Serial Communication Synchronous: Transfer block of data (characters) at a time. Asynchronous: Transfer a single byte at a time. You could write S/W to use either of these methods, but the programs can be tedious and long. So, H/W is developed instead. This H/W is called UART or USART UART: Universal Asynchronous Receiver-Transmitter USART: Universal Synchronous-Asynchronous Receiver- Transmitter The 851 chip has a built-in UART. 4

Duplex vs. Simplex Duplex PC Tx and Rx PC Simplex (only transmit) PC Only Tx Printer 5

Duplex Full Duplex: Data is transmitted both way at the same time. Tx Need 2 lines Rx Rx Tx Half Duplex: Data is transmitted one way at a time. Tx Need 1 lines Rx Rx Tx 6

Asynchronous Communications Asynchronous serial communication is widely used for character-oriented (1 byte) transmissions. Synchronous serial communication is widely used for blockoriented (multiple bytes) transmissions. Start and stop bits Framing ASCII Character space STOP bit D7 D6 D5 D4 D3 D2 D1 D START bit mark One or two bits 1 Go out last! Only one bit Go out first! 7

Asynchronous New System: ASCII character A (1 1B) 8-bit When there is no transfer, mark is 1 and space is. Space = 1 1 1 Mark =1 Older System: ASCII is 7-bit Due to the slowness of receiving mechanical devices, 2 stop bits were used to give the device sufficient time to organize itself. 2 7-bit ASCII Character 1 Stop bits Start bit 8

Even-Parity bit system Parity Bit 1111 # of 1 =4 P= Odd-Parity bit system 1111 # of 1 =4 P=1 UART chips allow programming of the parity bit for odd-, even-, and no-parity options. 9

Data Transfer Rate Data Transfer Rate Bits per second (bps) is also called Baud rate (the number of signals changes per second) IBM PC/XT 1 ~ 96 bps Pentium PC 56k bps (recent MODEM) Asynchronous data communication, the baud rate is limited to 1, bps. Interfacing standard: RS232 1

RS232 PC: COM1 (Mouse), COM2: (MODEM & RS232) RS232 is set by Electronics Industries Association (EIA) in 196. 1963: RS232A 1965: RS232B 1969: RS232C RS232 is a serial I/O interfacing standard; however, since the standard was set long before the advent of the TTL logic family, its input and output voltage levels are not TTL compatible. TTL is Transistor-Transistor Logic family (Bipolar transistor) in 1968 11

Line Driver: MAX232 RS232 is not compatible to TTL. For this reason, to connect any RS232 to a microcontroller system, we must use Voltage Converters such as MAX232 to convert the TTL logic levels to the RS232 voltage levels, and vice versa. MAX232 IC chips is referred to as Line Driver. 12

RS232 Connector: DB-25 DB-25 Connector DB-25P (Plug) DB-25S (Socket) Pin 1: Ground Pin 2: TxD Pin 3: RxD : 1 13 14 25 DTE: Data Terminal Equipment: RS232 DCE: Data Communication Equipment: MODEM 13

DB-9 Connector RS232 Connector: DB-9 Pin function description 1 2 3!DCD RxD TxD Data Carrier Detect Receive Transmit 1 5 6 9 4 DTR Data Terminal Ready 5 GND Ground 6!DSR Data Set Ready 7!RTS Request To Send 8!CTS Clear To Send 9 RI Ring Indicator 14

851 Connection to RS232 Since RS232 standard is not TTL compatible, so we need MAX232 (line driver) 851 MAX232 DB-9 (RS232 Connector) TxD 11 (P3.1) 11 T1 in T1 out 14 2 RxD RxD 1 (P3.) 12 R1 out R1 in 13 3 TxD 5 GND 15

Baud Rate Q1: With XTAL=11.592MHz, find the TH1 value needed to have the following baud rate: (a) 96, (b) 24, and (c) 12. 16

SBUF Register SBUF Register: For a byte of data to be transferred via the TxD line, it must be placed in the SBUF. SBUF holds the byte of data when it is received by the 851 s RxD line. 851 Framed MAX232 DB-9 (RS232 Connector) SBUF TxD 11 (P3.1) 11 T1 in T1 out 14 2 RxD RxD 1 (P3.) 12 R1 out R1 in 13 3 TxD Deframed 5 GND 17

SCON Register SM SM1 SM2 REN TB8 RB8 TI RI SCON Mode, 2, and 3 are ready used today. Mode 1 is compatible with the COM port of IBM PC. Mode 1 allows the baud rate to be variable and is set by Timer 1 of 851. SM SM1 1 1 1 1 Mode 1 2 3 8 bit data, 1 stop bit, 1 start bit 18

SCON Register SM2 enable the multiprocessing capability of the 851. Here we make SM2=. REN: Receive Enable REN=1: it allows the 851 to receive data on the RxD pin. If you want the 851 to both transfer and receive data, REN must be set to 1. SETB SCON.4 REN=: make the receiver is disabled. TB8: Transfer bit 8 Is used for serial modes 2 and 3, so here we make TB8=. Bit 8 Stop Bit D7 D6 D5 D4 D3 D2 D1 D 1 byte of data 19

SCON Register RB8: Receive bit 8 Is used for serial modes 2 and 3, so here we make RB8=. TI: Transmit Interrupt (this is a flag bit) When 851 finish the transfer of the 8-bit character, it raises the TI flag to indicate that it is ready to transfer another byte. RI: Receive Interrupt When 851 receive data via RxD, it get rid of the start and stop bits (deframed procedure) and places the byte in the SBUF. Then it raises the RI flag to indicate that a byte has been received and should be picked up before it is lost. 2

Programming (Transfer) 1. MOV TMOD, #2H ; Timer 1, mode 2 2. TH1 is loaded to set the baud rate. 3. MOV SCON, #5H SM SM1 1 SM2 REN 1 TB8 RB8 TI RI SCON REN=1: allows TxD and RxD 4. SETB TR1 ; Run Timer 1 5. MOV SBUF, # D 6. Loop: JNB TI, Loop ; Monitor TI 7. CLR TI 8. Repeat step 5 for next character. 21

Examples Q2: Write a program for the 851 to transfer letter A serially at 48 baud rate, continuously. Q3: Write a program to transfer the message Yes serially at 96 baud, do this continuously. 22

Programming (Receive) 1. MOV TMOD, #2H ; Timer 1, mode 2 2. TH1 is loaded to set the baud rate. 3. MOV SCON, #5H SM SM1 1 SM2 REN 1 TB8 RB8 TI RI SCON REN=1: allows TxD and RxD 4. SETB TR1 ; Run Timer 1 5. Loop: JNB RI, Loop ; Monitor RI 6. MOV A, SBUF 7. CLR RI 8. Repeat step 5 for next character. 23

Examples Q4: Program the 851 to receive bytes of data serially, and put them in P1. Set the baud rate at 48. Q5: Write a program to (a) send to the PC the message We Are Ready, (b) receive any data sent by the PC and put it ob LEDs connected to P1, and (c) get data on switches and sent it to PC. The program should perform part (a) once, but parts (b) and (c) continuously. Use the 48 baud rate. 24

Method 1: Use a high XTAL Doubling the Baud Rate This method is infeasible since XTAL is fixed. If you change XTAL, and then it is not compatible to PC. Method 2: Change a bit in the PCON register SMOD - - - GF1 GF PD IDL PCON Serial Mode Bit When 851 is powered up, D7 of PCON =, we could set D7 of PCON 1 to double the baud rate. Note that PCON is not bit addressible, so we need to do the following MOV A, PCON SETB ACC.7 MOV PCON, A 25

Baud Rate for SMOD Baud rate for SMOD = 11.592MHz/12 = 921.6KHz 921.6KHz/32 = 288Hz Baud rate for SMOD = 1 11.592MHz/12 = 921.6KHz 921.6KHz/16 = 576Hz 26

Baud Rate for SMOD Baud Rate for SMOD= Baud Rate for SMOD=1 (Doubling the Baud Rate) TH1 (decimal) TH1 (Hex) 96 192-3 FD 48 96-6 FA 24 48-12 F4 12 24-24 E8 27

Examples Q6: Assume XTAL=11.592MHz, for the following program, state (a) what this program does (b) compute the frequency used by timer 1 to set the baud rate, and (c) find the baud rate of the data transfer. Q7: Find the TH1 value (in both decimal and hex) to set the baud rate to each of the following (a) 96, and (b) 48 if SMOD= 1. Assume XTAL=11.592MHz. Q8: Find the baud rate if TH1 =-2, SMOD =1, XTAL=11.592MHz. Is this baud rate supported by IBM PC 28