AHMEDABAD
I hereby certify that the following students of B.E. IV, Semester VII,
Instrumentation and Control have satisfactorily completed their project on
DATE:
Project
Project Report
7th Sem I.C.
ACKOWLEDGEMET:
FOREWORD:
The word robot was coined by the Czech writer Kapek in his play ‘Rossum's
Universal Robots’. Since then countless devices have been created and have been
associated with the word ‘Robot’. The works of Isaac Asimov have laid the foundation of
sociology pertaining to the use of robots instead of humans and the word ‘Robotics’ was
also coined by him. In today’s world, work on robots, that resemble and look almost
human, and others which don’t resemble humans in any way, progresses in leaps and
bounds. The world has forerunners in this technology like MIT, CMU, Sony, Honda etc.
In this world of ASIMO, AIBO, Packbot etc., we have made an attempt to create a device
Perhaps the most important work of Isaac Asimov could be considered to be the
coining of the 4 Laws of Robotics. One of the fundamental concepts of robots made
famous by the Zeroth Law of Robotics by Asimov: “A robot may not injure humanity, or,
through inaction, allow humanity to come to harm.” We have tried to create a system
which will allow safeguarding of life. We plan to achieve this by way of allowing the
robot to take the place of humans in situations which hold a potential threat to human life.
Our attempt was to provide a tool to the enforcers of law and order that could allow them
to access and assess a situation which could hold avoidable threat to human life.
ITRODUCTIO:
This report is the documentation of all the efforts that went into the making
shortened to Sabre, (a type of sword) and going with the spirit of prototypes having
Demonstrator’ prototype, wherein an attempt has been made such that the presently
This report is divided into 6 sections. Each section deals with the project
from a different viewpoint. The first section deals with the purpose of the robot, the
features it has and the system block diagram. The second section deals with the
operational description of the different modules of the robot which thereby allow the
proper functioning of the features that we have planned to implement on the robot.
The third section is the hardware and software section wherein the mind and the
nerve control of the robot is explained. The fourth section deals with the mechanical
design of the system. The fifth section contains the summary of different
technological fundamentals that were considered for use in the system as well as the
selection of the integrated circuit chips used in the project. The last section is the
components used in our project, bibliography, information about the sources of the
SECTIO 1
PROJECT OBJECTIVES:
The features that we have planned to implement on the robot are as follows:
1. Locomotion
2. Camera vision
3. Pan/Tilt motions for camera
4. Self-righting mechanism
5. Gripper mechanism
6. Extension operations
7. Path Illumination
drive has been thought of. The differential drive also has a multi-speed operation
facility too.
video information that is acquired by the camera has to be transmitted to the base
controller (called Zeus from now on) The HMI part of Zeus displays the video to the
human operator.
The additional requirement is that the camera should be able to cover the
maximum space around it, without the mobile robot (called Xabre from now on)
being required to rotate or move. This facility is provided by Pan/Tilt feature. This
allows the human controller to change the Point of View (POV) of the camera
easily.
The self-righting feature provides for a very versatile operation of the robot over
uneven terrain. In case during navigation, Xabre turns upside down, we can actually
flip it to right side up without the intervention of the human controller. This is done
The gripper feature is the small object manipulator provided on Xabre to allow it
to physically interact with its environment and place or retrieve small objects into
the target location. The gripper has a single Degree of Freedom (DoF) apart from the
gripping action.
with other tools that are required for it to perform desired tasks. Since it would be
improper to not provide the facility for the direct control of such tools without
additional overhead of hardware, we have already provided for the extension tools.
At times, Xabre may have to venture into areas where there is minimal light. In
such cases, since we can’t implement IR vision systems (reason being cost
constraints); we have the path illumination feature. This allows the camera to be able
TARGET APPLICATIOS:
The target applications are surveillance and object retrieval purposes, basically
where it is practically difficult for humans to venture. The need to have a system like
the one we have designed is commonly felt in certain cases very frequently. One of
such target applications, for which this project was designed, is the case of hostage
the law enforcement officials would find it very convenient to not risk any human
life by sending someone inside. Instead, if Xabre is sent in, it can peruse the
surroundings and communicate, to the officials outside, the scene inside through
Zeus.
Xabre can also be used to approach and investigate any suspicious object which
could be hazardous. For this purpose, the gripper mechanism which has the ability to
grasp and extricate small objects, can actually manipulate or extract such objects
which are accessible to it. Since the beginning of the project, we have tried to design
a system which can easily be upgraded with the minimum effort. As a result of this,
the present design allows for the implementation of system upgrades in form of
extension operation tools. The extension operations make the Xabre versatile and
upgradeable. It can be fitted with upto 5 tools that can perform remotely controllable
tasks. For e.g. when equipped with a miniaturized metal detector, Xabre can also be
used for detection of personnel landmines which have some metallic structure.
Additionally Xabre can be used to navigate into ducts or small places that are not
Technology
Nirma Institute of Technology
XABRE
Project Report
7th Sem I.C.
controlled using a wireless link and perform specific functions. The application of
the device as a mobile surveillance system and a small object manipulator requires
the presence of vision and a small gripper system onboard the vehicle. The vehicle
implemented in the system are the pan/tilt operation of the camera & path lighting.
For further development and tool addition, provision for 5 extension operation tools
is also provided. The whole project is hence broadly divided into the following
modules:
Module List
The modules are present over both the Zeus control and Xabre bot. The
module definition basically separates out sets of hardware doing a specific common
objective task.
The above modules can be broadly divided into 2 parts by way of location:
1. Zeus (The Control) : The immobile PC side systems including modules:
M01, M08 (partially) & M09 (partially)
2. Xabre (Bot): The actual robot including modules: M02, M03, M04, M05,
M06, M07, M08 (partially), M09 (partially) & M10
The system block diagram shows how the operation of the Xabre is carried out.
The human controller determines an action to be carried out. Then he/she gives the
corresponding directive to the Human Machine Interface (HMI) which is a VB form
object present on the PC monitor screen. The HMI does the required processing of
the directive and generates a bit pattern which is basically a command that the µC on
Xabre can understand. It sends the directive to the Transmitter module on Zeus
through the COM port. The Transmitter module then transmits the command to
Xabre.
The receiver module on Xabre receives the command and sends it to the C
through its Serial UART 0. The µC then processes the command and detects as to
for which module the command is for, based on the bit pattern. It then actuates the
module as required. Some modules have their own feedbacks to the µC. These are
basically limit indicators and for these modules, the µC checks for limit status before
actuating the module.
The Camera module is kept entirely isolated from this control scheme. This
module being a fully separate and ‘plug n play’ system, has its own communication
system. It sends back the video data to Zeus, wherein the receiver o/p is converted to
PC display compatible form and displayed onto the PC monitor screen. The pan/tilt
operation of the camera is listed separately because it is under direct control of the
µC and is a separate entity than the Camera module.
Ground Reality
The projected targets have been somewhat satisfactorily met after a number
of obstacles. The whole mechanical design has been carried out by us, without any
external help, using AutoCAD 2000i software. The system architecture and the
software design for the µC has been completed. The software implementation for the
µC for some of the modules has been completed for this semester.
The delays caused due to availability of motors, mechanical structure
manufacturing etc were the main obstacles in the achievement of the objectives.
SECTIO 2
Function Description:
The modules are controlled remotely or otherwise by way of functions, each
of which is defined for a specific module. The function defines the activities of the
module based on the commands or external input received by the module. These
functions are normally executed when either a command is received or any interrupt
is received from the interrupt i/ps. The general program then performs the task of
continually ascertaining if the control communication link is still active or not. All
the actuatory actions are only executed as responses to interrupts. The functions are
explained below:
Functions:
1. Locomotion (Ref M02):
Class: Manual Control
Description: The robot works on the tank-style drive. The differential motion
generated by the 2 motors gives the required direction navigation and
maneuverability. The magnitude and the direction are specified in the
commands. The driver IC (the LMD18200T) accepts PWM input only. For this
purpose, we are using Timer 0 in mode 1 to generate the PWM output for both
the drives simultaneously. The locomotion motors on the right and left of the
system are driven by 2 bit signals each. 1 bit determines the direction and the
other bit provides PWM o/p. The port P0’s lower nibble is utilized for this
purpose. This is the only module under the control of the µC that doesn’t use the
system bus (viz. Port P1 as the data bus and bits of Port P2 used for the device
select)
Sensors: none
Inputs: none
Command Bytes: 2 (10Y-Di-MMMM)
Internal Status Bytes: Locomotion Byte (Loc_Byte)
External Port Bytes: 4 bits (RDRPWM-LDLPWM)
command is received before the end of the previous Zeus command, the older
one is discarded. These commands are scrapped if the Self Righting Auto action
is triggered.
Sensors: 3 IR LED-PXTOR pairs (Same as Self Righting Auto)
Inputs: 3 bits, interrupt driven.
Command Bytes: 2 bits (XY)
Internal Status Bytes: SR Status Byte (SR_Stat_Byte) [Same as Self Righting
Auto]
External Port Bytes: 2 bits (Same as Self Righting Auto)
4. Gripper Operation.
Class: Manual Control with auto trip
Description: This function pertains to the micro-manipulator implemented on
Xabre used to grip and lift (if required) small objects (size < 10 cm). The
implemented system has a total of 4 functions to perform. The first 2 pertain to
the direct gripping action. These are namely: Gripper Open and Gripper Close.
They are limited by Gripper Open Limit Switch and the Gripper Close Limit
Switch. The Gripper Open Limit Switch prevents damage to either motor or
gripper if we try to open it beyond its limit. The Gripper Close Limit Switch
prevents damage to motor or gripped object when gripper is closing. The
additional system functions are namely: Lift and Drop. The Lift function allows
the Gripper to rise up by 300o after gripping object, such that the object is lifted
off the ground. This allows Xabre to move, after having picked up the object and
ensuring that the object is not dragged while Xabre is moving. Drop function is
required to place the object back on ground after returning to the base station.
Sensors: 4 microswitches
Inputs: 4 bits, interrupt driven.
Command Bytes: 4 bits (AB UV)
Internal Status Bytes: Gripper Status Byte (G_Stat_Byte)
External Port Bytes: 2 bits (G1G2 G3G4)
5. Pan/Tilt of Camera.
Class: Manual Control with auto trip
Description: The camera module is independent in its operation of image
acquisition and data transmission. However the system is not equipped with the
ability to change its POV on its own. This requires a setup to physically rotate
the camera so as to move its POV Camera panning or tilting is carried out as per
the Zeus commands sent to it. The panning action is limited to 300o by limit
switches on either extremities and the tilting action is limited to 135o by limit
switches on either extremities. The action is continued until one of the
microswitches is tripped or Zeus command orders a stop.
Sensors: 4 microswitches.
Inputs: 4 bits, interrupt mode
Command Bytes: 1 byte (110- _ - CD - EF)
Internal Status Bytes: P/T Status Byte (PT_Stat_Byte)
External Port Bytes: 4 bits (TDTM - PDPM)
6. Light Operation
Class: Manual
Description: The light function is manually controlled and lights up only when
the system is asked to switch it on. This is essential for surveillance as Xabre
should let its presence known only when there is explicit need for the same.
Light is turned on after receiving ‘Turn_On’ command from Zeus. On receiving
‘Turn_Off’ command from Zeus, the light is turned off. Light provides only
forward path lighting only presently. The light system can be attached to the PT
System to allow it to have the same POV as the camera.
Sensors: none
Inputs: none
Command Bytes: 1 bit (G)
Internal Status Bytes: l (SR_Stat_Byte)
External Port Bytes: 1 bit (L)
7. Extension Operations 1
Class: Manual with no processing
Description: Used for allowing additional tools to be added to the system.
Extension Ops 1 carries the 3 bit command and a 1 bit command for the
extension tools.
Sensors: none
Inputs: none
Command Bytes: 111 - 0 – E31E32E33 – E41
Internal Status Bytes: Higher order nibble of Extension Byte (Extn_Byte)
External Port Bytes: 4 bits (HIJK)
8. Extension Operations 2
Class: Manual with no processing
Description: Used for allowing additional tools to be added to the system.
Extension Ops 2 carries the 2 bit command and two 1 bit commands for the
extension tools.
Sensors: none
Inputs: none
Command Bytes: 111 - 1 - E21E22 – E11 – E51
Internal Status Bytes: Lower order nibble of Extension Byte (Extn_Byte)
External Port Bytes: 4 bits (NOQR) (same byte as Ext Ops 1)
9. Reset Operation
This operation sets Xabre to initial operative stage loading default values for the
system.
Detailed explanation:
I. Two bit commands
Bit SRM Pan Tilt Gripper 1 Gripper 2
Pattern XY CD EF AB UV
00 Do Nothing Do Nothing Do Nothing Do Nothing Do Nothing
01 Stop Stop Stop Stop Stop
10 Open CW* Pan Left Tilt Up Open Lift Up
11 Open ACW* Pan Right Tilt Down Close Drop Down
*CW opening is also implemented for SR Auto in the initial phase. To bring the SR
arms back into the lock-in position, ACW rotation is applied.
commands to the tripped system (Pan or Tilt for which microswitch has tripped) if
the on bits for the same are set.
II. Outputs:
Locomotion
LD Left or Right Direction LPWM Drive PWM signal.
RD 1=Forward; 0=Reverse RPWM 1=ON ; 0=OFF
SR/Gripper 1-2/Pan/Tilt
SECTIO 3
SOFTWARE
HMI:
The interface is a form object coded in VB6 Enterprise Edition,
incorporating Microsoft Communication Control Toolbox ver 6. The HMI is an
intuitively designed interface which allows the user to easily control Xabre by using
the k/b and a joystick. The interface is shown
below:
The joystick interface needs to be calibrated for different PCs and for
different temperature regions, since this tends to affect the potentiometers which are
integral to the construction of the joystick. To compensate for change in the
potentiometer resistance and allow the proper operation, we use the joystick
calibration form called Calib as a child form of the main Zeus form. This form is
shown below:
Since we are using RS-232 serial output port viz. Com1 or any other
available Com port (usually Com 2), the satisfactory operation of the Com port has
to be verified before starting communication with Xabre. For this we use the ‘Serial
Settings Select’ form. This form is shown below:
The code for the same consists of 2 .bas modules and 3 form objects. The
code listing for the same is as follows next.
TX_label.BackColor = vbGreen
TX_label.ForeColor = vbBlack '>>> Save Button states <<<'
If MSComm1.PortOpen = False Then For i = 1 To 4
MSComm1.PortOpen = True joyb_states(i) = joyb_pressed(i)
End If Next i
End If
End Sub '>>> if state has changed, options are"
' 1. both off
Private Sub Joyread() ' 2. u on
Dim state_changed(4) As Boolean ' 3. d on
Dim msg1 As String ' 4. both on is not possible
Dim msg2 As String
Dim frwd As Integer If state_changed(1) Or state_changed(2) Then
Dim side As Integer If Not joyb_states(1) And Not joyb_states(2) Then
Dim run_locomotion_command As Boolean msg1 = "STOP"
run_locomotion_command = True If joyb_states(1) And Not joyb_states(2) Then msg1
rc = GetJoystickPos(JOYSTICK1, JoyInfo) = "UP"
If rc = 0 Then If Not joyb_states(1) And joyb_states(2) Then msg1
= "DOWN"
'>>> Process Button changes <<<' Else
'>>> Transfer Button pressed info from joyinfo to array msg1 = "DO NOTHING"
<<<' End If
For i = 1 To 4
If JoyInfo.ButtonDown(i) Then If state_changed(3) Or state_changed(4) Then
joyb_pressed(i) = True If Not joyb_states(3) And Not joyb_states(4) Then
Else msg2 = "STOP"
joyb_pressed(i) = False If joyb_states(3) And Not joyb_states(4) Then msg2
End If = "LEFT"
Next i If Not joyb_states(3) And joyb_states(4) Then msg2
= "RIGHT"
'>>> Filter the array for opposite button pressed Else
conflicts <<<' msg2 = "DO NOTHING"
For i = 1 To 4 End If
If joyb_pressed(i) Then
If Not joyb_states(4 - (i + 1) Mod 4) Then If state_changed(1) Or state_changed(2) Or
joyb_pressed(i) = True state_changed(3) Or state_changed(4) Then
Else Call joy_command(msg1, msg2)
joyb_pressed(i) = False run_locomotion_command = False
End If End If
End If End If
Next i
'>>> EO INcomplete code list <<<' 'If the key is already pressed then do nothing
If key = 1 And kbb_states(1) Then GoTo l_jump
'>>> TX Label <<<' If key = 2 And kbb_states(2) Then GoTo l_jump
Private Sub TX_label_Click() If key = 3 And kbb_states(3) Then GoTo l_jump
If Not MSComm1.CTSHolding Then If key = 4 And kbb_states(4) Then GoTo l_jump
If TX_on Then
TX_label.BackColor = vbRed 'Key pressed passes above two test so is a valid
TX_label.ForeColor = vbWhite keypress
MSComm1.PortOpen = False kbb_states(key) = True
TX_on = False Kb_Button(key).Picture = LoadPicture(App.Path +
"\k" + CStr(key) + "on.bmp")
Else
TX_label.BackColor = vbGreen Else
TX_label.ForeColor = vbBlack 'Event is a keyup event
MSComm1.PortOpen = True 'Keyup is a key conflicting with previously pressed key
TX_on = True so do nothing
End If If key = 5 And kbb_states(2) Then GoTo l_jump
End If If key = 6 And kbb_states(1) Then GoTo l_jump
End Sub If key = 7 And kbb_states(4) Then GoTo l_jump
If key = 8 And kbb_states(3) Then GoTo l_jump
'>>> BYTE COMMAND WRITER SUB <<<'
Private Sub TX_write(command As Byte) kbb_states(key - 4) = False
Dim bytes(1) As Byte Kb_Button(key - 4).Picture = LoadPicture(App.Path +
Dim tx_buf As Variant "\k" + CStr(key - 4) + "off.bmp")
bytes(1) = command End If
tx_buf = bytes
If TX_on Then '>>> Read the stored states and determine required action
tx_buf(1) = command <<<'
MSComm1.Output = tx_buf If kbb_states(1) Then
End If msg1 = "UP"
End Sub Else
If kbb_states(2) Then
Private Sub kb_frame_event(key As Integer) msg1 = "DOWN"
'>>> For keyboard keys: E,S,D,X <<<' Else
'>>> Key = 1 to 4 => key pressed event <<<' If Not kbb_states(1) And Not kbb_states(2) And
'>>> Key = 5 to 8 => key released event <<<' (key = 5 Or key = 6) Then
Dim msg1 As String msg1 = "STOP"
Dim msg2 As String Else
msg1 = "DO NOTHING"
If key < 5 Then End If
'IF key pressed conflicts with previously pressed key End If
so do nothing End If
If key = 1 And kbb_states(2) Then GoTo l_jump
If key = 2 And kbb_states(1) Then GoTo l_jump If kbb_states(3) Then
If key = 3 And kbb_states(4) Then GoTo l_jump msg2 = "LEFT"
If key = 4 And kbb_states(3) Then GoTo l_jump Else
If kbb_states(4) Then
End Select
'>>> KeyUp Handler 2 <<<'
Private Sub Joy_Button_KeyUp(Index As Integer, End Sub
KeyCode As Integer, Shift As Integer)
Call Form_KeyUp(KeyCode, Shift) '>>> Form KeyDown Event Handle <<<'
End Sub Private Sub Form_KeyDown(KeyCode As Integer, Shift
As Integer)
'>>> KeyUp Handler 3 <<<' Select Case KeyCode
Private Sub Kb_pics_KeyUp(Index As Integer, KeyCode '>>> Cases for normal kb keys <<<'
As Integer, Shift As Integer) '>>> KB Frame Control Keys <<<'
Call Form_KeyUp(KeyCode, Shift) Case vbKeyE: ' ^ '
End Sub Call kb_frame_event(1)
Case vbKeyX: ' v '
'>>> KeyUp Handler 4 <<<' Call kb_frame_event(2)
Private Sub Kb_Button_KeyUp(Index As Integer, Case vbKeyS: ' < '
KeyCode As Integer, Shift As Integer) Call kb_frame_event(3)
Call Form_KeyUp(KeyCode, Shift) Case vbKeyD: ' > '
End Sub Call kb_frame_event(4)
Case vbKey1 To vbKey7, 192:
'>>> KeyUp Handler 5 <<<' Call ext_ops_event(KeyCode, Shift, False)
Private Sub Light_Pic_KeyUp(KeyCode As Integer, Shift '>>> Light Control Key <<<"
As Integer) Case vbKeyL:
Call Form_KeyDown(KeyCode, Shift) Call light_toggle
End Sub '>>> Cases for Function Keys <<<'
'>>> Extension Ops Toggles E1, E4 and E5 <<<'
'>>> KeyUp Handler 6 <<<' '>>> Ext_Op# passed byVal to Keycode <<<'
Private Sub ext_op_pics_KeyUp(Index As Integer, '>>> Ext_Picture# passed byVal to Shift <<<'
KeyCode As Integer, Shift As Integer) '>>> Toggle operation is true as passed byVal to Toggle
Call Form_KeyDown(KeyCode, Shift) <<<'
End Sub Case vbKeyF2:
Call ext_ops_event(1, 5, True)
'>>> Form KeyUp Event Handler <<<' Case vbKeyF3:
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Call ext_ops_event(4, 6, True)
Integer) Case vbKeyF4:
'>>> Required to send stop signal to <<<' Call ext_ops_event(5, 7, True)
'>>> the currently active kb-controlled <<<'
'>>> module subsystem <<<' '>>> User asks to shutdown Zeus <<<'
Select Case KeyCode Case vbKeyF10:
'>>> Check which key has been released <<<' 'Set confirm and then unload code here'
Case vbKeyE: ' ^ ' If Not gCalib_form_loaded And Not
Call kb_frame_event(5) gSerial_Settings_Sel_loaded Then
Case vbKeyX: ' v ' '>>> Ensure shutdown(=reset) command is fired and only
Call kb_frame_event(6) then shutdown
Case vbKeyS: ' < ' Debug.Print "Fire shutdown command"
Call kb_frame_event(7) Unload_Check:
Case vbKeyD: ' > ' If check_buffer_empty() Then
Call kb_frame_event(8) Unload Me
'>>> Load Default Pictures to the Ext_Ops Frame <<<' Private Sub show_joy_buttons_pressed()
The Vbjoy32.bas module takes care of reading the joystick’s potentiometers using
the Windows API called winmm.dll. The code listing for the same is as follows:
' Joystick Capabilities Declare Function joyGetPos Lib "winmm.dll" (ByVal
Const MAXPNAMELEN = 32 IDDevice As Integer, JPos As tJoyInfo) As Integer
Const MAXOEMVXD = 128 Function GetJoystickPos(IDDevice As Long, JoyInfo As
Type tJoyCaps tJoyInfo) As Integer
Mid As Integer '-------------------------------------------------------
Pid As Integer ' This function is a wrapper around the joyGetPos API
Pname As String * MAXPNAMELEN ' call. That call returns coordinates as unsigned
Xmin As Long ' long integers, which VB doesn't support. We move
Xmax As Long ' these coordinates into long values so that they
Ymin As Long ' can be easily evaluated.
Ymax As Long '-------------------------------------------------------
Zmin As Long Dim rc As Integer
Zmax As Long Static NotFirstTime As Integer
NumButtons As Long If Not NotFirstTime Then
PeriodMin As Long NotFirstTime = False
PeriodMax As Long rc = joyGetDevCaps(IDDevice, JoyCaps,
wRmin As Long Len(JoyCaps))
wRmax As Long If rc <> 0 Then
wUmin As Long GetJoystickPos = rc
wUmax As Long Exit Function
wVmin As Long End If
wVmax As Long End If
wCaps As Long rc = joyGetPos(IDDevice, JoyInfo)
wMaxAxes As Long GetJoystickPos = rc
wNumAxes As Long If rc <> 0 Then Exit Function
wMaxButtons As Long JoyInfo.ButtonDown(1) = (JoyInfo.ButtonStates And
szRegKey As String * MAXPNAMELEN JOY_BUTTON1) = JOY_BUTTON1
szOEMVxD As String * MAXOEMVXD JoyInfo.ButtonDown(2) = (JoyInfo.ButtonStates And
End Type JOY_BUTTON2) = JOY_BUTTON2
Global JoyCaps As tJoyCaps JoyInfo.ButtonDown(3) = (JoyInfo.ButtonStates And
' Joystick API Calls JOY_BUTTON3) = JOY_BUTTON3
Declare Function joyGetDevCaps Lib "winmm.dll" Alias JoyInfo.ButtonDown(4) = (JoyInfo.ButtonStates And
"joyGetDevCapsA" (ByVal IDDevice As Integer, JCaps JOY_BUTTON4) = JOY_BUTTON4
As tJoyCaps, ByVal CapSize As Integer) As Integer End Function
The global declarations of variables accessed all over the program are declared in
globalvariables.bas as shown below:
Attribute VB_Name = "Module2"
Public Type JoyVariables
Xmin As Long
Xmax As Long
Ymin As Long
Ymax As Long
XCntr As Long
YCntr As Long
X_Upper_Range As Long
X_Lower_Range As Long
Y_Upper_Range As Long
Y_Lower_Range As Long
X_Upper_Scale As Long
X_Lower_Scale As Long
Y_Upper_Scale As Long
Y_Lower_Scale As Long
Set_val As Boolean
End Type
Public OP_tf_vals As JoyVariables
Global gCalib_form_loaded As Boolean
Global gSerial_Settings_Sel_loaded As Boolean
Global gSerial_first_init As Boolean
Global joy_control As String
The serial port settings are done through the Serial port settings form object which
has the following code listing
2. SRM Manual
IF Command=Open_CW_manual
ROTATE cw;
ROTATE TILL Command = Stop_Rotation;
IF Command=Open_ACW_manual
ROTATE acw;
ROTATE TILL Command = Stop_Rotation;
IF Command=Open_CW_auto
ROTATE cw;
ROTATE TILL lock_in = close; ‘SR arm is locked-in
IF Command=Open_ACW_auto
ROTATE acw;
ROTATE TILL lock_in = close; ‘SR arm is locked-in;
3. P/T Operation
a. Command Operation
IF PLL = open
ON PL_Command: Pan Left;
IF PRL = open
ON PR_Command: Pan Right;
IF TUL = open
ON TU_Command: Tilt Up;
IF TDL = open
ON TD_Command: Tilt Down;
4. Light Operation:
ON Light_ON_Command: Light = ON;
ON Ligth_OFF_Command: Light = OFF;
Function flowcharts:
HARDWARE
A PCB for the implementation of the circuit was manufactured. The
schematic design was prepared in Orcad V9.0 and the final layout was generated
using Protel V3.0.
This sub section includes the PCB layout diagrams.
6
EXT 12V 5V 12V U8 LMD18200T U11 LMD18200T
R10 10K
D1 U7 7805/TO 9 2 R17 9 2
VCC
VCC
5V 5V 5V TH OUT OUT1 LM1 TH OUT OUT1 RM1
1 3 8 6K8 8
GND
J1 VIN VOUT C30 0.1uF C33 0.1uF CS OUT CS OUT
U1 SRM LATCH U4 1 C7 1 C16
1N4007 R11 6K8 BS1 BS1
1 C2 R1 R 39 1 3 2
C1 R2 R P0.0 P1.0/T2 D0 Q0
2 10uF 38 P0.1 P1.1/T2X 2 4 D1 Q1
5 LDRV MOTOR RDRV MOTOR
2
10uF R3 R 37 3 7 6 3 10 3 10
R4 R P0.2 P1.2 D2 Q2 DIR BS2 C8 DIR BS2 C17
36 4 8 9 5 5
GND
GND
HEADER 2 P0.3 P1.3 D3 Q3 PWM 10nF PWM 10nF
35 P0.4 P1.4 5 13 D4 Q4 12 4 11 LM2 4 11 RM2
BRAKE OUT2 BRAKE OUT2
34 P0.5 P1.5 6 14 D5 Q5 15
33 P0.6 P1.6 7 17 16
D6 Q6
7
32 P0.7 P1.7 8 18 19
D7 Q7
D D
J9 12 21 11
INT0 P2.0 LE
13 22 1
INT1 P2.1 OE
1 17 23
5V RD P2.2 74LS373
2 10 24
RXD P2.3 12V
3 14 25
T0 P2.4 5V 12V LS1 LS2
4 15 26
T1 P2.5 U5 C34 0.1uF
11
TXD P2.6
27 G-PT LATCH 12V D12 RELAY DPDT RELAY DPDT
16 28 3 2 100uF C9 12V 4 4
HEADER 4 WR P2.7 D0 Q0 R12
4 D1 5 1N4007 3 3 SRM1
Q1 10K
19 30 7 6 5 5
6
X1 ALE/P D2 Q2 U9 LMD18200T 12V
18 X2 PSEN
29 8 D3 Q3
9 8 8 SRM MOTOR
13 12 R13 9 Q2
OUT1 2
6 6
VCC
5V D4 Q4 TH OUT PM1 SRM2
31 14 15 6K8 8 D11 2N2222 7 7 J5
EA/VP D5 Q5 CS OUT C10
9 RST 17 D6 16 1 1 1
Q6 BS1 RM1
18 19 1N4007 2 2 1
D7 Q7 5V RM2
DS89C420 PAN MOTOR LM1
2
11 3 10 3
LE RESISTOR SIP 10 5K DIR BS2 C11 Q3 LM2
1 5 4
GND
1
C3 XTAL C4 OE RS3 PWM 10nF PM1
4 11 PM2 2N2222 5
30pF 11.0592 Mhz 30pF 74LS373 BRAKE OUT2 PM2 6
G2M1 7
5V 12V G2M2
7
C35 0.1uF 8
EOPs LATCH U6 12V G1M1 9
3 2 100uF C18 G1M2 10
C5 D0 Q0 R18 SRM1
4 5 11
10
D1 Q1 SRM2
2
3
4
5
6
7
8
9
10uF 7 6 10K 12
6
D2 Q2 U12 LMD18200T TM1
VCC 8 9 13
D3 Q3 R19 TM2
13 12 9
OUT1 2
14
VCC
D4 Q4 12V TH OUT TM1
R5 R6 14 15 D3 6K8 8
10K 100E 5V 5V D5 Q5 LED 12V CS OUT C19
C31 0.1uF 17 16 1
U2 D6 Q6 D4 100uF C12 BS1 HEADER 14
18 19
PB D7 Q7 LED R14
1
EN Vcc
20 TILT MOTOR
5V 2 19 11 D5 10K 3 10
0
6
IN1 OUT1 LE LED U10 LMD18200T DIR BS2 C20
3 18 1 2 1 5
GND
IN2 OUT2 OE D6 R15 PWM 10nF
4 17 9 OUT1 2 4 11
VCC
IN3 OUT3 TH OUT G2M1 BRAKE OUT2 TM2
5 16 74LS373 LED 6K8 8
IN4 OUT4 J12 D7 CS OUT C13
6 15 1
IN5 OUT5 BS1
7
7 14 JUMPER1 LED
IN6 OUT6 R9 1K D8
8
IN7 OUT7 13 G2 MOTOR
J4 9 12 LED 3 10
IN8 OUT8 5V D9 DIR BS2 C14
10 11 5
GND
C C
GND CH J13 LED PWM 10nF 12V
4 11 G2M2
D10 BRAKE OUT2 12V
1 MAX6818
2 1 LED 100uF C21
7
to SRM 3 2 R20
5V
4 3 10K
LIMIT
6
5 4 U13 LMD18200T
SENSORS 6 5 R21 9 OUT1 2
VCC
TH OUT G1M1
6 6K8 8 CS OUT C22
7 1
BS1
8
HEADER 6 9 G1 MOTOR
10 3 10
DIR BS2 C23
11 5
GND
5V 5V 12V PWM 10nF
C32 0.1uF 12 4 11 G1M2
U3 5V BRAKE OUT2
J11 13
1 20 14
EN Vcc
7
1 2 19 15
IN1 OUT1 D17
2 3 IN2 OUT2 18 J3
3 4 17
IN3 OUT3 HEADER 15 1N4007
to various 4 5
IN4 OUT4 16 1
5 6 15 2
LIMIT 6 7
IN5 OUT5
14
IN6 OUT6 Q1
SENSORS 7 8
IN7 OUT7 13 HEADER 2
8 9 12
IN8 OUT8
9 10 11
GND CH 2N2222
10
10
MAX6818
2
3
4
5
6
7
8
9
HEADER 10
RESISTOR SIP 10 5K
VCC RS1
1
B B
VIN VOUT E1
D15
DATA IN
VCC
10K C24
ANT
2
0.1uF 5V
GND
Ant
1
RECEIVER CARD
J7 U15 RLP916F
5V
8
CTS U17 HIN232 Ant
DOut
1
LOut
Gnd
Gnd
Gnd
Vcc
Vcc
2 RXD CTS TTL 11 14
GND RXD TTL T1IN T1OUT
3 10 T2IN T2OUT 7
4 SW2 SW DPDT U14
1
6
7
4
5
13 12
TXD R1IN R1OUT
8 9 3 2
HEADER 4 R2IN R2OUT RXD TTL VIN VOUT
C25
1uF 1 1
C1+ ADJ R8
3 C1- CTS TTL LM317/TO220 330E
C26 4 R7
C2+ 5V VAR R
1uF 5
C2- D16 J8 RLP916F Conn.
2 LED
GND
VCC
C27 V+
6 1
2.2uF V-
2
0
C28 3
16
15
2.2uF R24 4
10K
5V
C29
A A
C
(On PC Side)
Title
XABRE HARDWARE
Size Document Number Rev
1 1
5 4 3 2 1
Project Report
7th Sem I.C.
SECTIO 5
Phase 3
Phase 2
Phase 1
Small_Val Diff
Big_Val Delay
FFh
On RD command
Save value to Right Locomotion Reg. M4M3M2M1-D-000
Call Set_Timer
Set_Timer:
Load L magnitude to temp1
Load R magnitude to temp2
Compare both magnitudes
If L_Mag=R_Mag
Set Drv_bit2
Clr Drv_bit1
Small_val=L_mag
Big_val=R_mag
Diff=01h
Delay=255-Big_val
If L_Mag<R_Mag
Clr Drv_bit2
Set Drv_bit1
Small_val=255-L_mag
Big_val=R_mag
Diff=Small_val-Big_val)
Delay=255-Big_val
If L_Mag>R_Mag
Clr Drv_bit2
Clr Drv_bit1
Small_val=255-R_mag
Big_val=L_mag
Diff=Small_val-Big_val)
Delay=255-Big_val
H-Bridge Logic
(Extracted from Mag I.C. ’03, the annual magazine of IC Dept irma Institute of
Technology. Authored by Abhijit Karnik.)
There’s this nice idea you have floating about in your mind about a tank style
robot you would like to build. All goes well till you decide to have the ability to
reverse and there you have a nice pitfall. You can’t find a way to make your motor
to get voltage in the reverse direction except use cumbersome relays with a number
of switches. If you have been using a digital logic operation mode then again even
relays are difficult to use. So what do you do? The answer lies in the H-bridge.
The H-Bridge is basically a configuration which allows you to run the D.C.
motor in any direction you want. The D.C. motor has 2 terminals. If one of the
terminals is given positive D.C and the second terminal is grounded, the motor
rotates in one direction. If the connections are reversed then, the motor rotates in the
other direction. Now this means we need a circuit which allows either terminal to be
connected to positive supply and the other one to ground as per our wish. As in
figure 1 we have path A indicating connection for CCW motion, and path B for CW
motion and arrangement that at a time only one path is
active, then the resulting configuration is the basic H-bridge.
The blocks marked 1, 1’, 2 and 2’ in the figure are devices
which allow the above requirement to be fulfilled.
The simplest option would be to use n-channel
MOSFETs, as the blocks, which have the adequate power
rating. The gate signal would be delivered from a logic gate
that turns ON FETs 1 and 1’ while FETs 2 and 2’ would be
OFF. This can be achieved by connecting the gates of FETs
Figure 1 1 and 1’ directly to gate output while the gates of FETs 2
and 2’ are connected to the inverted output of the same gate.
The operation of the H-Bridge is then as follows: If the gate output is high, FETs 1
and 1’ are ON and FETs 2 and 2’ are OFF. Path A is open while path B is closed
and we have CCW motion. When the gate output is low, FETs 2 and 2’ are ON and
FETs 1 and 1’ are OFF. Path B is open while path A is closed and we have CW
motion.
This arrangement is seemingly quite simple and easy to setup. So there should be
some problems too. The 2 most basic problems in this arrangement are speed control
and switching transients.
For the first problem, we see that the H-bridge has no arrangements for
controlling the speed of the motor. Either the motor is rotating CCW or CW at full
power. The solution to this problem lies in pulse width modulation or PWM method.
In short this method varies the operational duty cycle, i.e. the on time of the motor.
The average DC delivered to the motor is varied by providing to the gate, pulses of
variable time duration, ensuring that the motor speed is controlled. If we ‘AND’ the
output of the control gate before it is supplied to any of the FET gate terminals, with
a variable pulse width generator, PWM input is available to the FET gate terminals.
The variable pulse width generator can be an IC555 in monostable mode with the
time constant being varied by a pot and another IC555 in astable mode providing
trigger input. The duty cycle can be varied from nearly 0% to ~99% of the frequency
of the astable IC555. Accordingly the motor speed varies from 0 rpm to full rated
value.
The second problem (which is a bigger problem) is the switching transients.
The motor coil can be considered to be an inductor. An inductor tries to oppose
changes in current magnitude flowing through it. Abruptly switching off the current
supply induces large transient spikes in voltage due to the collapsing magnetic field
in the motor coil. This transient voltage and current can fry your FETs if they are not
built to handle the voltages. Another possible source of transient current is known as
‘free wheeling’. Due to motor inertia, the rotation of the motor may not stop
immediately. During this time the motor can act as a generator sourcing large
current values. These problems are more complicated and need more control
circuitry that keep both FETs 1’ and 2’ ON during switching and allow transients to
run to ground. Another option would be to use zener diodes with knee voltage
greater than supply and with enough power dissipation ratings connected between
ground and both terminals (Cathodes towards motor). In any case the FETs tend to
dissipate a lot of heat while switching, which needs to be diverted to a sink properly.
Another solution to this problem is using one of the H-bridge ICs that are
available. These ICs come with internal arrangements for transient protection and
thermal shutdown. There is simple arrangement for direction control and speed
control in form of separate pins. Normally you would find a pin labeled PWM input
and another labeled direction. Their limitations are in terms of peak voltages and
current ratings. Another limitation is cost. They are a trifle bit too expensive. One of
the H-bridge ICs is LMD18200T from National Semiconductor. I have mentioned
this IC since it allows 3A and 55V and best of all, National sends free samples (it
costs $8.5) so experiments are easier to conduct. Texas Instruments also has similar
ICs. Specific part numbers of FETs are not mentioned since it depends on your
motor and supply and mostly because I haven’t used any. I learnt about the existence
of H-bridge and directly headed for National’s website to search for a related IC and
found the LMD18200T.
The H-bridge is a very good solution for speed-direction control of a DC
motor and if your motor is not going to take large currents, even FETs without
arrangements for transient bypassing can do the job satisfactorily. With the H-
Bridge, direction and speed control should never come in way of realizing the dream
of your very own bot!
DS89C420
Ultra-High-Speed Microcontroller
www.maxim-ic.com
Note: Some revisions of this device may incorporate deviations from published specifications known as errata. Multiple revisions of any device
may be simultaneously available through various sales channels. For information about device errata, click here: www.maxim-ic.com/errata.
1 of 47 REV: 102203
DS89C420 Ultra-High-Speed Microcontroller
PIN CONFIGURATIONS
33 23
6 1 40
7 39
34 22
Dallas
Dallas Semiconductor
Semiconductor DS89C420
DS89C420
44 12
17 29
18 28
1 11
PLCC
TQFP
TOP VIEW
P1.0/T2 1 40 VCC
P1.1/T2EX 2 39 P0.0
P1.2/RXD1 3 38 P0.1
P1.3/TXD1 4 37 P0.2
P1.4/INT2 5 36 P0.3
P1.5/INT3 6 35 P0.4
P1.6/INT4 7 34 P0.5
P1.7/INT5 8 33 P0.6
RST 9 32 P0.7
P3.0/RXD0 10 DS89C420 31 EA/VPP
P3.1/TXD0 11 30 ALE/PROG
P3.2/INT0 12 29 PSEN
P3.3/INT1 13 28 P2.7
P3.4/T0 14 27 P2.6
P3.5/T1 15 26 P2.5
P3.6/WR 16 25 P2.4
P3.7/RD 17 24 P2.3
XTAL2 18 23 P2.2
XTAL1 19 22 P2.1
VSS 20 21 P2.0
DIP
46 of 47
Ultra-High-Speed Flash
Microcontroller User’s Guide
53 _____________________________________________________________________________________________
Ultra-High-Speed Flash
Microcontroller User’s Guide
the watchdog reset function automatically. Other bits of this register are undefined and are at logic 1 when read. The value of this reg-
ister can be read at address FCh in parallel programming mode or by executing the verify option control register instruction in ROM
Loader or in-application programming mode.
FFFF FFFF
INTERNAL
MEMORY
03FF
1kB x 8
SRAM External External
Program Data
INTERNAL SCRATCH Data OR Memory Memory
REGISTERS PAD prog mem
addr from
128 Bytes SFR 0000
400–7FF
4000
FF 3FFF
8kB x 8
128 Bytes Flash
Indirect Memory
Addressing (Program)
2000
80
7F
1FFF
2F
20 Bit Addressable 8kB x 8
1F Flash
Bank 3
Memory 03FF
Bank 2 Non-usable if
(Program)
Bank 1 Internal SRAM
Bank 0 is activated
00 0000 0000 0000
_____________________________________________________________________________________________ 56
Ultra-High-Speed Flash
Microcontroller User’s Guide
Mode 1
Mode 1 is asynchronous and full duplex, using a total of 10 bits. The 10 bits consist of a start bit (logic 0), 8 data bits, and 1 stop bit
(logic 1) as illustrated in Figure 12-2. The data is transferred LSb first. As described above, the baud rates for mode 1 are generated
by either a divide-by-16 of timer 1 rollover, a divide-by-16 of the timer 2 rollover, or a divide-by-32 of timer 1 rollover. The UART begins
transmission after the first rollover of the divide-by-16 counter following a software write to SBUF. Transmission takes place on the TXD
pin. It begins by the start bit being placed on the pin. Data is then shifted out onto the pin, LSb first. The stop bit follows. The TI bit is
set by hardware after the stop bit is placed on the pin. All bits are shifted out at the rate determined by the baud-rate generator.
Once the baud-rate generator is active, reception can begin at any time. The REN bit (SCON0.4 or SCON1.4) must be set to a logic 1
to allow reception. The falling edge of a start bit on the RXD pin begins the reception process. Data is shifted in at the selected baud
rate. At the middle of the stop bit time, certain conditions must be met to load SBUF with the received data:
• RI must = 0, and either
• If SM2 = 0, the state of the stop bit does not matter, or
• If SM2 = 1, the state of the stop bit must = 1.
If these conditions are true, then SBUF (hex address 99h or C1h) is loaded with the received byte, the RB8 bit (SCON0.2 or SCON1.2)
is loaded with the stop bit, and the RI bit (SCON0.0 or SCON1.0) is set. If these conditions are false, then the received data is lost
(SBUF and RB8 not loaded) and RI is not set. Regardless of the receive word status, after the middle of the stop bit time, the receiver
goes back to looking for a 1 to 0 transition on the RXD pin.
Each data bit received is sampled on the 7th, 8th, and 9th clock used by the divide-by-16 counter. Using majority voting, two equal
samples out of the three determine the logic level for each received bit. If the start bit was determined to be invalid ( = 1), then the
receiver goes back to looking for a 1 to 0 transition on the RXD pin in order to start the reception of data.
Mode 2
Mode 2 uses a total of 11 bits in asynchronous full-duplex communication, as illustrated in Figure 12-3. The 11 bits consist of 1 start
bit (a logic 0), 8 data bits, 1 programmable 9th bit, and one stop bit (a logic 1). Like mode 1, the transmissions occur on the TXD sig-
nal pin and receptions on RXD. For transmission purposes, the 9th bit can be stuffed as a logic 0 or 1. A common use is to put the par-
ity bit in this location. The 9th bit is transferred from the TB8 bit position in the SCON register (SCON0.3 or SCON1.3) during the write
to SBUF. Baud rates are generated as a fixed function of the crystal frequency, as described earlier in this section. Like mode 1, mode
2’s transmission begins after the first rollover of the divide-by-16 counter following a software write to SBUF. It begins by the start bit
being placed on the TXD pin. The data is then shifted out onto the pin LSb first, followed by the 9th bit, and finally the stop bit. The TI
bit (SCON0.1 or SCON1.1) is set when the stop bit is placed on the pin.
Reception begins when a falling edge is detected as part of the incoming start bit on the RXD pin. The RXD pin is then sampled accord-
ing to the baud-rate speed. The 9th bit is placed in the RB8 bit location in SCON (SCON0.2 or SCON1.2). When a stop bit has been
received, the data value is transferred to the SBUF receive register (hex address 99 or C1). The RI bit (SCON0.0 or SCON1.0) is set to
indicate that a byte has been received. At this time, the UART can receive another byte.
Once the baud-rate generator is active, reception can begin at any time. The REN bit (SCON0.4 or SCON1.4) must be set to a logic 1
to allow reception. The falling edge of a start bit on the RXD pin begins the reception process. Data must be shifted in at the selected
baud rate. At the middle of the 9th bit time, certain conditions must be met to load SBUF with the received data.
• RI must = 0, and either
• If SM2 = 0, the state of the 9th bit does not matter, or
• If SM2 = 1, the state of the 9th bit must = 1.
If these conditions are true, then SBUF is loaded with the received byte, RB8 is loaded with the 9th bit, and RI is set. If these condi-
tions are false, then the received data is lost (SBUF and RB8 not loaded) and RI is set. Regardless of the receive word status, after the
middle of the stop bit time, the receiver goes back to looking for a 1 to 0 transition on RXD.
Data is sampled in a similar fashion to mode 1 with the majority voting on three consecutive samples. Mode 2 uses the sample divide-
by-16 counter with either the oscillator divided by 2 or 4.
____________________________________________________________________________________________ 114
Ultra-High-Speed Flash
Microcontroller User’s Guide
SBUF
TRANSMIT SHIFT REGISTER
TIMER 2 P3.1 TXD
CLOCK
S0
START
TIMER 1 OVERFLOW LATCH PIN
LOAD
STOP
OVERFLOW
D7
D6
D5
D4
D3
D2
D1
D0
AVAILABLE TO SERIAL
1 0
DIVIDE-
PORT 0 ONLY
BY-2
SMOD_0 =
PCON.7 0 1
OR
SMOD_1 = DATA BUS
WDCON.7 LDSBUF
RDSBUF
0 1
TCLK = LOAD SHIFT
T2CON.4 SBUF
SERIAL
READ
SERIAL I/O
BUFFER CONTROL RD RECEIVE DATA BUFFER WR
SERIAL
DIVIDE- BUFFER
BAUD
RCLK = BY-16
CLOCK
T2CON.5 0 1 LOAD
RESET
RB8 =
INTS
SCONx.2
T1 R1
START
CLOCK
FLAG = FLAG = STOP
D7
D6
D5
D4
D3
D2
D1
D0
SCONx.1 SCONx.0
SI
SERIAL
INTERRUPT RECEIVE SHIFT REGISTER
TRANSMIT TIMING
LDSBUF
SHIFT
TXD
START D0 D1 D2 D3 D4 D5 D6 D7 STOP
TI
RECEIVE TIMING
RXD
START D0 D1 D2 D3 D4 D5 D6 D7 STOP
BIT DETECTOR
SAMPLING
SHIFT
RI
115 ____________________________________________________________________________________________
Ultra-High-Speed Flash
Microcontroller User’s Guide
127 ____________________________________________________________________________________________
Ultra-High-Speed Flash
Microcontroller User’s Guide
PROGRAM EXECUTION
INTERNAL MEMORY DISABLED EA\ =0
INTERNAL MEMORY ENABLED EA\ =1
N
RST = 1
N
DEVICE IN RESET
EA\ = 0 (INTERNAL MEMORY ENABLED)
N
DEVICE IN RESET
PSEN\ = 0 (INTERNAL MEMORY DISABLED)
AUTOBAUD ROUTINE
AWAITING <CR> CHARACTER ON RXD OF SERIAL PORT 0
Y
SERIAL COMMUNICATION WITH THE ROM LOADER CAN PSEN\
PROCEED AS ESTABLISHED ON SERIAL PORT 0 TOGGLED 0 1
N Y
POWER-ON
RESET
____________________________________________________________________________________________ 128
Ultra-High-Speed Flash
Microcontroller User’s Guide
TO PC
TD
ROIN ROOUT RXDO
RD
TOOUT DS232A TOIN TXDO
DTR
R1IN R1OUT
DS89C420
EA
PSEN
HC/AC125
AUTOBAUD-RATE DETECTION
The serial bootstrap loader can automatically detect, within certain limits, the external baud rate and configure itself to that speed. The
loader controls serial port 0 in mode 1 (asynchronous, 1 start bit, 8 data bits, no parity, 1 stop bit, full duplex), using timer 1 in 8-bit
autoreload mode with the serial port 0 doubler bit (PCON.7) set. For these settings, an equation to calculate possible serial loader
baud rates is provided as a function of crystal frequency and timer reload value. Table 15-1 shows baud rates generated using the
equation:
Crystal Frequency
Serial Loader_Baud rate =
192 x ( 256-Timer Reload )
** Timer reload values attempted by the loader:
FF, FE, FD, FC, FB, FA, F8, F6, F5, F4, F3, F0, EC, EA, E8,
E6, E0, DD, D8, D4, D0, CC, C0, BA, B0, A8, A0, 98, 80, 60, 40
When communicating with a PC COM port having a standard 8250/16450 UART, attempt to match the loader baud rate and PC COM
port baud rate within 3% in order to maintain a reliable communication channel. If baud rates cannot be matched exactly, it is suggest-
ed configuring the loader to the faster baud rate to avoid the possibility of overflowing the DS89C420 serial input buffer.
129 ____________________________________________________________________________________________
LMD18200 3A, 55V H-Bridge
December 1999
LMD18200
3A, 55V H-Bridge
General Description n No “shoot-through” current
n Thermal warning flag output at 145˚C
The LMD18200 is a 3A H-Bridge designed for motion control
n Thermal shutdown (outputs off) at 170˚C
applications. The device is built using a multi-technology pro-
cess which combines bipolar and CMOS control circuitry n Internal clamp diodes
with DMOS power devices on the same monolithic structure. n Shorted load protection
Ideal for driving DC and stepper motors; the LMD18200 ac- n Internal charge pump with external bootstrap capability
commodates peak output currents up to 6A. An innovative
circuit which facilitates low-loss sensing of the output current Applications
has been implemented.
n DC and stepper motor drives
n Position and velocity servomechanisms
Features n Factory automation robots
n Delivers up to 3A continuous output n Numerically controlled machinery
n Operates at supply voltages up to 55V n Computer printers and plotters
n Low RDS(ON) typically 0.3Ω per switch
n TTL and CMOS compatible inputs
Functional Diagram
DS010568-1
DS010568-2
DS010568-25
www.national.com 2
LMD18200
Electrical Characteristics Notes
Note 1: Absolute Maximum Ratings indicate limits beyond which damage to the device may occur. DC and AC electrical specifications do not apply when op-
erating the device beyond its rated operating conditions.
Note 2: See Application Information for details regarding current limiting.
Note 3: The maximum power dissipation must be derated at elevated temperatures and is a function of TJ(max), θJA, and TA. The maximum allowable power dis-
sipation at any temperature is PD(max) = (TJ(max) − TA)/θJA, or the number given in the Absolute Ratings, whichever is lower. The typical thermal resistance from junc-
tion to case (θJC) is 1.0˚C/W and from junction to ambient (θJA) is 30˚C/W. For guaranteed operation TJ(max) = 125˚C.
Note 4: Human-body model, 100 pF discharged through a 1.5 kΩ resistor. Except Bootstrap pins (pins 1 and 11) which are protected to 1000V of ESD.
Note 5: All limits are 100% production tested at 25˚C. Temperature extreme limits are guaranteed via correlation using accepted SQC (Statistical Quality Control)
methods. All limits are used to calculate AOQL, (Average Outgoing Quality Level).
Note 6: Output currents are pulsed (tW < 2 ms, Duty Cycle < 5%).
Note 7: Regulation is calculated relative to the current sense output value with a 1A load.
Note 8: Selections for tighter tolerance are available. Contact factory.
DS010568-16 DS010568-17
DS010568-18
DS010568-19
DS010568-20 DS010568-21
DS010568-22 DS010568-23
www.national.com 4
LMD18200
Test Circuit
DS010568-8
DS010568-9
Pinout Description (See Connection Diagram) it is also necessary to apply logic high to PWM input, pin 5.
The drivers that short the motor are determined by the logic
Pin 1, BOOTSTRAP 1 Input: Bootstrap capacitor pin for half level at the DIRECTION input (Pin 3): with Pin 3 logic high,
H-bridge number 1. The recommended capacitor (10 nF) is both current sourcing output transistors are ON; with Pin 3
connected between pins 1 and 2. logic low, both current sinking output transistors are ON. All
Pin 2, OUTPUT 1: Half H-bridge number 1 output. output transistors can be turned OFF by applying a logic high
Pin 3, DIRECTION Input: See Table 1. This input controls to Pin 4 and a logic low to PWM input Pin 5; in this case only
the direction of current flow between OUTPUT 1 and OUT- a small bias current (approximately −1.5 mA) exists at each
PUT 2 (pins 2 and 10) and, therefore, the direction of rotation output pin.
of a motor load. Pin 5, PWM Input: See Table 1. How this input (and DIREC-
Pin 4, BRAKE Input: See Table 1. This input is used to TION input, Pin 3) is used is determined by the format of the
brake a motor by effectively shorting its terminals. When PWM Signal.
braking is desired, this input is taken to a logic high level and
5 www.national.com
LMD18200
Pinout Description
(See Connection Diagram) (Continued)
Application Information
TYPES OF PWM SIGNALS
The LMD18200 readily interfaces with different forms of
PWM signals. Use of the part with two of the more popular DS010568-5
forms of PWM is described in the following paragraphs.
FIGURE 3. Sign/Magnitude PWM Control
Simple, locked anti-phase PWM consists of a single, vari-
able duty-cycle signal in which is encoded both direction and SIGNAL TRANSITION REQUIREMENTS
amplitude information (see Figure 2). A 50% duty-cycle To ensure proper internal logic performance, it is good prac-
PWM signal represents zero drive, since the net value of tice to avoid aligning the falling and rising edges of input sig-
voltage (integrated over one period) delivered to the load is nals. A delay of at least 1 µsec should be incorporated be-
zero. For the LMD18200, the PWM signal drives the direc- tween transitions of the Direction, Brake, and/or PWM input
tion input (pin 3) and the PWM input (pin 5) is tied to logic signals. A conservative approach is be sure there is at least
high. 500ns delay between the end of the first transition and the
beginning of the second transition. See Figure 4.
www.national.com 6
19-4770; Rev 1; 1/99
MAX6816/MAX6817/MAX6818
The MAX6816/MAX6817/MAX6818 are single, dual, and ♦ Robust Inputs can Exceed Power Supplies
octal switch debouncers that provide clean interfacing up to ±25V
of mechanical switches to digital systems. They accept
one or more bouncing inputs from a mechanical switch ♦ ESD Protection for Input Pins
and produce a clean digital output after a short, preset ±15kV—Human Body Model
qualification delay. Both the switch opening bounce ±8kV—IEC 1000-4-2, Contact Discharge
and the switch closing bounce are removed. Robust ±15kV—IEC 1000-4-2, Air-Gap Discharge
switch inputs handle ±25V levels and are ±15kV ESD-
♦ Small SOT Packages (4 and 6 pins)
protected for use in harsh industrial environments. They
feature single-supply operation from +2.7V to +5.5V. ♦ Single-Supply Operation from +2.7V to +5.5V
Undervoltage lockout circuitry ensures the output is in
the correct state upon power-up. ♦ Single (MAX6816), Dual (MAX6817), and Octal
(MAX6818) Versions Available
The single MAX6816 and dual MAX6817 are offered in
SOT packages and require no external components. ♦ No External Components Required
Their low supply current makes them ideal for use in ♦ 6µA Supply Current
portable equipment.
The MAX6818 octal switch debouncer is designed for ♦ Three-State Outputs for Directly Interfacing
data-bus interfacing. The MAX6818 monitors switches Switches to µP Data Bus (MAX6818)
and provides a switch change-of-state output (CH), ♦ Switch Change-of-State Output Simplifies
simplifying microprocessor (µP) polling and interrupts. Polling and Interrupts (MAX6818)
Additionally, the MAX6818 has three-state outputs con-
trolled by an enable (EN) pin, and is pin-compatible ♦ Pin-Compatible with ’LS573 (MAX6818)
with the ‘LS573 octal latch (except for the CH pin),
allowing easy interfacing to a digital data bus. Ordering Information
PIN- SOT
Applications PART TEMP. RANGE
PACKAGE TOP MARK
µP Switch Interfacing MAX6816EUS-T -40°C to +85°C 4 SOT143 KABA
Industrial Instruments MAX6817EUT-T -40°C to +85°C 6 SOT23-6 AAAU
PC-Based Instruments MAX6818EAP -40°C to +85°C 20 SSOP —
Note: There is a minimum order increment of 2500 pieces for
Portable Instruments SOT packages.
Automotive Applications
Membrane Keypads
Pin Configurations
Typical Operating Circuit TOP VIEW
VCC VCC
4
GND 1
MAX6816
MAX6816 µP
MECHANICAL
SWITCH 0.1µF
For free samples & the latest literature: http://www.maxim-ic.com, or phone 1-800-998-8800.
For small orders, phone 1-800-835-8769.
±15kV ESD-Protected, Single/Dual/Octal,
CMOS Switch Debouncers
Pin Description
MAX6816/MAX6817/MAX6818
PIN
NAME FUNCTION
MAX6816 MAX6817 MAX6818
1 2 10 GND Ground
2 — — IN Switch Input
— 1, 3 — IN1, IN2 Switch Inputs
— — 2–9 IN1–IN8 Switch Inputs
3 — — OUT CMOS Debounced Output
— 4, 6 — OUT2, OUT1 CMOS Debounced Outputs
— — 12–19 OUT8–OUT1 CMOS Debounced Outputs
4 5 20 VCC +2.7V to +5.5V Supply Voltage
Active-Low, Three-State Enable Input for outputs. Resets CH.
— — 1 EN
Tie to GND to “always enable” outputs.
Change-of-State Output. Goes low on switch input change of
— — 11 CH
state. Resets on EN. Leave unconnected if not used.
D Q OUT
VCC
VCC
D Q LOAD
VCC COUNTER
OSC. R
RPU
UNDER-
IN VOLTAGE
LOCKOUT
MAX6816
ESD MAX6817
PROTECTION MAX6818
_______________Detailed Description input does not equal the output, the XNOR gate issues
a counter reset. When the switch input state is stable
Theory of Operation for the full qualification period, the counter clocks the
The MAX6816/MAX6817/MAX6818 are designed to flip-flop, updating the output. Figure 2 shows the typical
eliminate the extraneous level changes that result from opening and closing switch debounce operation. On
interfacing with mechanical switches (switch bounce). the MAX6818, the change output (CH) is updated
Virtually all mechanical switches bounce upon opening simultaneously with the switch outputs.
or closing. These switch debouncers remove bounce
when a switch opens or closes by requiring that Undervoltage Lockout
sequentially clocked inputs remain in the same state for The undervoltage lockout circuitry ensures that the out-
a number of sampling periods. The output does not puts are at the correct state on power-up. While the sup-
change until the input is stable for a duration of 40ms. ply voltage is below the undervoltage threshold
(typically 1.9V), the debounce circuitry remains trans-
The circuit block diagram (Figure 1) shows the func-
parent. Switch states are present at the logic outputs
tional blocks consisting of an on-chip oscillator,
without delay.
counter, exclusive-NOR gate, and D flip-flop. When the
4 _______________________________________________________________________________________
±15kV ESD-Protected, Single/Dual/Octal,
CMOS Switch Debouncers
MAX6816/MAX6817/MAX6818
tDP
EN tEN
IN1 1/2 VCC 1/2 VCC
tPE
1/2 VCC OUT NORMALLY VOH - 0.5V
IN2 OUT1–OUT8
HIGH
tPD
tPC
CH 1/2 VCC
OUT2
+VCC
IN1 EN I/O µP
CH IRQ
20V
IN MAX6818
0
(20V/div) OUT1 D0
-20V
IN8 OUT8 D7
SW8
4V
OUT
(2V/div)
0 Figure 5. MAX6818 Typical µP Interfacing Circuit
_______________________________________________________________________________________ 5
±15kV ESD-Protected, Single/Dual/Octal,
CMOS Switch Debouncers
meets Level 4 (the highest level) of IEC1000-4-2, with- Machine Model
MAX6816/MAX6817/MAX6818
out the need for additional ESD-protection compo- The Machine Model for ESD tests all pins using a
nents. 200pF storage capacitor and zero discharge resis-
The major difference between tests done using the tance. Its objective is to emulate the stress caused by
Human Body Model and IEC1000-4-2 is higher peak contact that occurs with handling and assembly during
current in IEC1000-4-2, because series resistance is manufacturing.
lower in the IEC1000-4-2 model. Hence, the ESD with- MAX6818 µP Interfacing
stand voltage measured to IEC1000-4-2 is generally The MAX6818 has an output enable (EN) input that
lower than that measured using the Human Body allows switch outputs to be three-stated on the µP data
Model. Figure 7a shows the IEC1000-4-2 model and bus until polled by the µP. Also, state changes at the
Figure 7b shows the current waveform for the 8kV, switch inputs are detected, and an output (CH) goes low
IEC1000-4-2, Level 4, ESD Contact-Discharge test. after the debounce period to signal the µP. Figure 4
The Air-Gap test involves approaching the device with shows the timing diagram for enabling outputs and read-
a charged probe. The Contact-Discharge method ing data. If the output enable is not used, tie EN to GND
connects the probe to the device before the probe is to “always enable’’ the switch outputs. If EN is low, CH is
energized. always high. If a change of state is not required, leave
CH unconnected.
TOP VIEW
EN 1 20 VCC
IN1 2 19 OUT1
IN2 3 18 OUT2
IN1 1 6 OUT1
IN3 4 17 OUT3
IN6 7 14 OUT6
IN2 3 4 OUT2
IN7 8 13 OUT7
IN8 9 12 OUT8
SOT23-6
GND 10 11 CH
SSOP
___________________Chip Information
MAX6816 TRANSISTOR COUNT: 284
MAX6817 TRANSISTOR COUNT: 497
MAX6818 TRANSISTOR COUNT: 2130
_______________________________________________________________________________________ 7
SN54LS373, SN54LS374, SN54S373, SN54S374,
SN74LS373, SN74LS374, SN74S373, SN74S374
OCTAL D-TYPE TRANSPARENT LATCHES AND EDGE-TRIGGERED FLIP-FLOPS
SDLS165B – OCTOBER 1975 – REVISED AUGUST 2002
VCC
OC
implementing buffer registers, I/O ports,
1Q
8Q
1D
bidirectional bus drivers, and working registers.
3 2 1 20 19
The eight latches of the ’LS373 and ’S373 are 2D 4 18 8D
transparent D-type latches, meaning that while 2Q 5 17 7D
the enable (C or CLK) input is high, the Q outputs 3Q 6 16 7Q
follow the data (D) inputs. When C or CLK is taken 3D 7 15 6Q
low, the output is latched at the level of the data 4D 8 14 6D
that was set up. 9 10 11 12 13
5Q
5D
GND
edge-triggered D-type flip-flops. On the positive C
transition of the clock, the Q outputs are set to the C for ’LS373 and ’S373;
logic states that were set up at the D inputs.
Schmitt-trigger buffered inputs at the enable/clock lines of the ’S373 and ’S374 devices simplify system design
as ac and dc noise rejection is improved by typically 400 mV due to the input hysteresis. A buffered
output-control (OC) input can be used to place the eight outputs in either a normal logic state (high or low logic
levels) or the high-impedance state. In the high-impedance state, the outputs neither load nor drive the bus lines
significantly.
OC does not affect the internal operation of the latches or flip-flops. That is, the old data can be retained or new
data can be entered, even while the outputs are off.
Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of
Texas Instruments semiconductor products and disclaimers thereto appears at the end of this data sheet.
PRODUCTION DATA information is current as of publication date. Copyright 2002, Texas Instruments Incorporated
Products conform to specifications per the terms of Texas Instruments On products compliant to MIL-PRF-38535, all parameters are tested
standard warranty. Production processing does not necessarily include unless otherwise noted. On all other products, production
testing of all parameters. processing does not necessarily include testing of all parameters.
Function Tables
’LS373, ’S373
(each latch)
INPUTS OUTPUT
OC C D Q
L H H H
L H L L
L L X Q0
H X X Z
1 1
OC OC
11 11
C CLK
C1 2 C1 2
3 1Q 3 1Q
1D 1D 1D 1D
C1 5 C1 5
4 2Q 4 2Q
2D 1D 2D 1D
C1 6 C1 6
7 3Q 7 3Q
3D 1D 3D 1D
C1 9 C1 9
8 4Q 8 4Q
4D 1D 4D 1D
C1 12 C1 12
13 5Q 13 5Q
5D 1D 5D 1D
C1 15 C1 15
14 6Q 14 6Q
6D 1D 6D 1D
C1 16 C1 16
17 7Q 17 7Q
7D 1D 7D 1D
C1 19 C1 19
18 8Q 18 8Q
8D 1D 8D 1D
Pin numbers shown are for DB, DW, J, N, NS, and W packages.
AVAILABLE OPTIONS
PACKAGED DEVICES
VO(NOM) PLASTIC HEAT-SINK
TJ
(V) FLANGE MOUNT MOUNTED
(KC) (KTE)
5 µA7805CKC µA7805CKTE
8 µA7808CKC µA7808CKTE
10 µA7810CKC µA7810CKTE
0°C to 125°C
12 µA7812CKC µA7812CKTE
15 µA7815CKC µA7815CKTE
24 µA7824CKC µA7824CKTE
The KTE package is only available taped and reeled. Add the suffix R to the
device type (e.g., µA7805CKTER).
Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of
Texas Instruments semiconductor products and disclaimers thereto appears at the end of this data sheet.
PRODUCTION DATA information is current as of publication date. Copyright 2001, Texas Instruments Incorporated
Products conform to specifications per the terms of Texas Instruments
standard warranty. Production processing does not necessarily include
testing of all parameters.
APPLICATION INFORMATION
+V µA78xx +VO
0.33 µF 0.1 µF
IN OUT
+ µA78xx G
VI IL
COM
– –VO
R1
IO
0.33 µF 0.1 µF
R2
VO +V )
xx ǒ )Ǔ
NOTE A: The following formula is used when Vxx is the nominal output voltage (output to common) of the fixed regulator:
V xx
R1
I Q R2
Input µA78xx
R1
0.33 µF VO(Reg)
Output
IO
IO = (VO/R1) + IO Bias Current
Applications
• Any System Requiring RS-232 Communication Ports
- Computer - Portable, Mainframe, Laptop
- Peripheral - Printers and Terminals
- Instrumentation
- Modems
Selection Table
NUMBER OF NUMBER OF LOW POWER
PART POWER SUPPLY RS-232 RS-232 EXTERNAL SHUTDOWN/TTL NUMBER OF
NUMBER VOLTAGE DRIVERS RECEIVERS COMPONENTS THREE-STATE LEADS
HIN232 +5V 2 2 4 Capacitors No/No 16
1 CAUTION: These devices are sensitive to electrostatic discharge; follow proper IC Handling Procedures.
1-888-INTERSIL or 321-724-7143 | Intersil (and design) is a registered trademark of Intersil Americas Inc.
Copyright © Intersil Americas Inc. 2003. All Rights Reserved.
All other trademarks mentioned are the property of their respective owners.
HIN232, HIN236, HIN237, HIN238, HIN239, HIN240, HIN241
Pin Descriptions
PIN FUNCTION
V+ Internally generated positive supply (+10V nominal), HIN239 requires +7.5V to +13.2V.
TIN Transmitter Inputs. These leads accept TTL/CMOS levels. An internal 400kΩ pull-up resistor to VCC is connected to each lead.
RIN Receiver Inputs. These inputs accept RS-232 input levels. An internal 5kΩ pull-down resistor to GND is connected to each input.
EN Enable input. This is an active low input which enables the receiver outputs. With EN = 5V, the receiver outputs are placed
in a high impedance state.
SD Shutdown Input. With SD = 5V, the charge pump is disabled, the receiver outputs are in a high impedance state and the
transmitters are shut off.
Ordering Information
PART TEMP.
NUMBER RANGE (oC) PACKAGE PKG. DWG. #
HIN232CB 0 to 70 16 Ld SOIC M16.3
HIN232CB-T 0 to 70 Tape and Reel
HIN232CP 0 to 70 16 Ld PDIP E16.3
HIN232IB -40 to 85 16 Ld SOIC M16.3
HIN232IP -40 to 85 16 Ld PDIP E16.3
HIN236CB 0 to 70 24 Ld SOIC M24.3
HIN236IB -40 to 85 24 Ld SOIC M24.3
HIN237CB 0 to 70 24 Ld SOIC M24.3
HIN237CB-T 0 to 70 Tape and Reel
HIN238CB 0 to 70 24 Ld SOIC M24.3
HIN238CB-T 0 to 70 Tape and Reel
HIN238CP 0 to 70 24 Ld PDIP E24.3
HIN238IB -40 to 85 24 Ld SOIC M24.3
HIN239CB 0 to 70 24 Ld SOIC M24.3
HIN239CB-T 0 to 70 Tape and Reel
HIN239CP 0 to 70 24 Ld PDIP E24.3
HIN240CN 0 to 70 44 Ld MQFP Q44.10X10
HIN241CA 0 to 70 28 Ld SSOP M28.209
HIN241CB 0 to 70 28 Ld SOIC M28.3
HIN241IB -40 to 85 28 Ld SOIC M28.3
2
HIN232, HIN236, HIN237, HIN238, HIN239, HIN240, HIN241
Pinouts
HIN232 (PDIP, SOIC) HIN236 (SOIC)
TOP VIEW TOP VIEW
C1+ 10 15 V-
V+ 11 14 C2-
C1- 12 13 C2+
+5V +5V
+ 9
1µF 10 1µF
16 C1+ VCC +
+ 11
1µF +5V TO 10V V+
12
C1- VOLTAGE DOUBLER
VCC 13
1 NOTE 1 C2+
C1+ + + +10V TO -10V
NOTE 1
+ +5V TO 10V 2 1µF
14 V- 15
V+ VOLTAGE INVERTER
3 VOLTAGE DOUBLER C2- 1µF
C1- +
4 +5V T1
C2+ 7 400kΩ 2
+ +10V TO -10V T1IN T1OUT
NOTE 1
5 V- 6
VOLTAGE INVERTER
C2- NOTE 1 +5V T2
+ 6 400kΩ 3
T2IN T2OUT
+5V T1
11 400kΩ 14 +5V
T1IN T1OUT T3
18 400kΩ 1
T3IN T3OUT
+5V T2 +5V
10 400kΩ 7 T4
T2IN T2OUT 19 400kΩ 24
T4IN T4OUT
5 4
12 13 R1OUT R1IN
R1OUT R1IN
R1 5kΩ
R1 5kΩ
22 23
R2OUT R2IN
9 8
R2OUT R2IN R2 5kΩ
R2 5kΩ
17 16
R3OUT R3IN
15 R3 5kΩ 21
20
EN SD
NOTE: 8
1. Either 0.1µF or 1µF capacitors may be used. The V+ capacitor
may be terminated to VCC or to GND.
3
HIN232, HIN236, HIN237, HIN238, HIN239, HIN240, HIN241
Electrical Specifications Test Conditions: VCC = +5V ±10%, TA = Operating Temperature Range (Continued)
TIMING CHARACTERISTICS
Transition Region Slew Rate, SRT RL = 3kΩ, CL = 2500pF Measured from +3V to -3V or - 3 - V/µs
-3V to +3V, 1 Transmitter Switching
TRANSMITTER OUTPUTS
RS-232 Output Short Circuit Current, ISC TOUT shorted to GND - ±10 - mA
NOTE:
4. Guaranteed by design.
+ + + +
C1 C3 C2 C4
- - - -
GND VCC GND V- = -(V+)
S3 C1- S4 S7 C2- S8
RC
OSCILLATOR
Detailed Description to 5.5V. The output impedance of the voltage doubler section
(V+) is approximately 200Ω, and the output impedance of the
The HIN232 thru HIN241 family of RS-232
voltage inverter section (V-) is approximately 450Ω. A typical
transmitters/receivers are powered by a single +5V power
application uses 1µF capacitors for C1-C4, however, the
supply (except HIN239), feature low power consumption, and
value is not critical. Increasing the values of C1 and C2 will
meet all ElA RS-232C and V.28 specifications. The circuit is
lower the output impedance of the voltage doubler and
divided into three sections: The charge pump, transmitter, and
inverter, increasing the values of the reservoir capacitors, C3
receiver.
and C4, lowers the ripple on the V+ and V- supplies.
Charge Pump
During shutdown mode (HIN236, HIN240 and HIN241),
An equivalent circuit of the charge pump is illustrated in SHUTDOWN control line set to logic “1”, the charge pump is
Figure 1. The charge pump contains two sections: the voltage turned off, V+ is pulled down to VCC , V- is pulled up to GND,
doubler and the voltage inverter. Each section is driven by a and the supply current is reduced to less than 10µA. The
two phase, internally generated clock to generate +10V and transmitter outputs are disabled and the receiver outputs are
-10V. The nominal clock frequency is 16kHz. During phase placed in the high impedance state.
one of the clock, capacitor C1 is charged to VCC . During
phase two, the voltage on C1 is added to VCC , producing a
signal across C3 equal to twice VCC . During phase one, C2 is
also charged to 2VCC , and then during phase two, it is
inverted with respect to ground to produce a signal across C4
equal to -2VCC . The charge pump accepts input voltages up
8
HIN232, HIN236, HIN237, HIN238, HIN239, HIN240, HIN241
Transmitters Receivers
The transmitters are TTL/CMOS compatible inverters which The receiver inputs accept up to ±30V while presenting the
translate the inputs to RS-232 outputs. The input logic threshold required 3kΩ to 7kΩ input impedance even if the power is off
is about 26% of VCC , or 1.3V for VCC = 5V. A logic 1 at the (VCC = 0V). The receivers have a typical input threshold of
input results in a voltage of between -5V and V- at the output, 1.3V which is within the ±3V limits, known as the transition
and a logic 0 results in a voltage between +5V and (V+ -0.6V). region, of the RS-232 specifications. The receiver output is
Each transmitter input has an internal 400kΩ pullup resistor so 0V to VCC . The output will be low whenever the input is
any unused input can be left unconnected and its output greater than 2.4V and high whenever the input is floating or
remains in its low state. The output voltage swing meets the driven between +0.8V and -30V. The receivers feature 0.5V
RS-232C specifications of ±5V minimum with the worst case hysteresis to improve noise rejection. The receiver Enable
conditions of: all transmitters driving 3kΩ minimum load line EN, when set to logic “1”, (HIN236, 239, 240, and 241)
impedance, VCC = 4.5V, and maximum allowable operating disables the receiver outputs, placing them in the high
temperature. The transmitters have an internally limited output impedance mode. The receiver outputs are also placed in
slew rate which is less than 30V/µs. The outputs are short the high impedance state when in shutdown mode.
circuit protected and can be shorted to ground indefinitely. The
powered down output impedance is a minimum of 300Ω with VCC
V-
FIGURE 2. TRANSMITTER
TIN
OR
RIN
TOUT VOL
OR
ROUT VOL
tPHL tPLH
tPHL + tPLH
Average Propagation Delay =
2
9
HIN232, HIN236, HIN237, HIN238, HIN239, HIN240, HIN241
Applications +5V
-
The HIN2XX may be used for all RS-232 data terminal and +
communication links. It is particularly useful in applications 1 16 DTR (20) DATA
where ±12V power supplies are not available for C1 + 2 TERMINAL READY
1µF - 3 DSRS (24) DATA
conventional RS-232 interface circuits. The applications HIN232 SIGNALING RATE
presented represent typical interface configurations. 4 6 SELECT
C2 + -
1µF - 5 + RS-232
A simple duplex RS-232 port with CTS/RTS handshaking is INPUTS AND OUTPUTS
T1
illustrated in Figure 9. Fixed output signals such as DTR TD
11 14
TD (2) TRANSMIT DATA
(data terminal ready) and DSRS (data signaling rate select) T2
10 7
TTL/CMOS RTS RTS (4) REQUEST TO SEND
is generated by driving them through a 5kΩ resistor
INPUTS AND 12 13
connected to V+. OUTPUTS RD RD (3) RECEIVE DATA
R2 R1
9 8
In applications requiring four RS-232 inputs and outputs CTS CTS (5) CLEAR TO SEND
(Figure 10), note that each circuit requires two charge pump
15 SIGNAL GROUND (7)
capacitors (C1 and C2) but can share common reservoir
capacitors (C3 and C4). The benefit of sharing common
reservoir capacitors is the elimination of two capacitors and FIGURE 9. SIMPLE DUPLEX RS-232 PORT WITH CTS/RTS
HANDSHAKING
the reduction of the charge pump source impedance which
effectively increases the output swing of the transmitters.
1 4
C1 + + C2
HIN232
1µF - 3 5 - 1µF
11 T1 14
TD TD (2) TRANSMIT DATA
T2
10 7
TTL/CMOS RTS RTS (4) REQUEST TO SEND
INPUTS AND 12 13
OUTPUTS RD RD (3) RECEIVE DATA
R2 R1
9 8
CTS CTS (5) CLEAR TO SEND
15
16
6 2
C4 C3 +5V
- -
+
V- V+
2µF 2µF RS-232
6 2 INPUTS AND OUTPUTS
16
HIN232
1 4
C1 + + C2
1µF - 3 5 - 1µF
11 T1 14
DTR DTR (20) DATA TERMINAL READY
T2
10 7
TTL/CMOS DSRS DSRS (24) DATA SIGNALING RATE SELECT
INPUTS AND 12 13
OUTPUTS DCD DCD (8) DATA CARRIER DETECT
R2 R1
9 8
R1 R1 (22) RING INDICATOR
FIGURE 10. COMBINING TWO HIN232s FOR 4 PAIRS OF RS-232 INPUTS AND OUTPUTS
11
Wireless Video Camera 208CV
LYD208CV (Wireless)
Manual-modulated receiver
• High receive sensitivity : +18DB
• Receive frequency : 0.9G/1.2G
• Receive signal : Video Only
• Voltage : DC 9V
• Current : 500mA
• Size : 115X60X20(mm)