Home
User Manual
Contents
1. Command Op Code Header Byte Hex FE For example the following hex representation of a command will set the stepper pulse duration to 100 ms FE 54 64 EF 3 2 Command Set The complete list all SPI Exec commands and responses can be found at the end of this manual Please note that even though the list shows commands and responses as two digit hex numbers actual commands and any data carried within the frames are simply 8 bit binary numbers The Mnemonic representations of the op codes are only used for documentation purposes and can be handy for use as programming constants literals Copyright 2006 Unistep Technologies SPI LM USR 004 User Manual SPI Serial Port Interface 9 4 SPI CONTROL PANEL SPI Control Panel application is designed to facilitate functional testing of the SPI module as well as to provide an easy to use interface that can be used as the front end for simple experiments and demo setups Count Volts Ch 0 56 fi 09 Ch 1 84 fi 1 64 Ch 2 112 m Ch3 140 1200 3600 19200 57600 P GAMM cha 168 Ch5 Parity None Odd Even 5 6 T O Comm Errors 58 iC Frame Pulse i x1 3 us Pulse 19 x1 0 ms S Parity Cir _Start _Start Period 40 x53us E Period 100 x1 0 ms E am Apply Tx FE 3005 EF Rx fc FE 30 05 C4 EF Exit 4 1 Installation The computer disk included with the SPI package has three directories at the root level 1 Control Panel 2 Us
2. Output clock pulsed 1 C 14 CLH Set Output Clock to HIGH 1 R 14 Output clock set to HIGH 1 C 15 CLL Clear Output Clock to LOW 1 R 15 Output Clock set to LOW 1 Digital Input C 20 INP Read Digital Input Port 1 R 20 nn Read lt nn gt from Input Port 2 C 21 INC Read Input Clock Line 1 R 21 nn Read lt nn gt on input clock line 2 Analog Input C 30 nn RAC nn Read Analog Channel lt nn gt 2 R 30 nn mm Count lt mm gt read from Channel lt nn gt 3 C 31 INV Select Internal Vref 1 R 31 ADC configured for internal Vref 1 C 32 EXV Select External Vref 1 R 32 ADC configured for External Vref 1 PWM Output C 40 PWO Start PWM Output 1 R 40 PWM output Started 1 C 41 PWF Stop PWM Output 1 R 41 PWM output stopped 1 C 42 PDH Set PWM Direction Line to HIGH 1 R 42 PWM Direction line set to HIGH 1 C 43 PDL Set PWM Direction Line to LOW 1 R 43 PWM Direction Line cleared to LOW 1 C 44 nn PWD nn Set PWM signal ON Duration to lt nn gt 2 R 44 PWM signal ON duration set 1 C 45 nn PWP nn Set PWM Period to lt nn gt 2 R 45 PWM Period set 1 Copyright 2006 Unistep Technologies SPI LM USR 004 User Manual SPI Serial Port Interface oa STEPPER Output C 50 STO Start Stepper Output 1 R 50 Stepper started 1 C 51 STF Stop Stepper Output 1 R 51 Stepper stopped 1 C 52 SDH Set Ste
3. A ANO AN4 ANS Vref PWM Analog Input Channels This input is the Analog Input Channel 5 AN5 at its default setting It can also function as the external reference input Vref that will be used for A to D conversions The function of this input can be selected with SPI Exec commands MPU normally uses the Vcc supply voltage as its internal reference for the A to D converter If more stability accuracy or a different input range is desired this pin can be selected as the input for an external voltage reference source When external reference is selected MPU will use the voltage at this pin as the reference for all A to D conversion functions on all analog inputs Pulse Width Modulator output Copyright 2006 Unistep Technologies SPI LM USR 004 User Manual PDIR SPI Serial Port Interface 7 Pulse Width Modulator Direction output when PWM signal is used for DC motor speed control If required this output can be used as a general purpose digital output line 2 10 Digital Input Port Port B 2 11 DIO DI7 CLKI Digital input lines for TTL compatible digital logic signals An octal buffer circuit is used to buffer and isolate the input lines from the bi directional MPU bus Clock line for clocked read operations Can be read with a command and can also be used as a general purpose digital input line Digital Output Port Port C DOO DO7 CLKO SDIR STEP Buffered Digital output lines A bank
4. H i i i ch 1 23 456 i Ee gt O Auto Transmission O q TE CDD EE gt C ParityDisable ch i i LIL LI LILI GE gt O Parity Enable 3 4 5 i i LIL LIL PR PS nasa ore ree gt CC 1200Baud QA A 2 8 HAHHOH ae Eeer eg 1 2 3 4 5 6 gt OC 9600 Baud H CH i LILLI SSS eho tas gt CO 19200 Baud Dr Zen ss Hi 1 2 3 4 5 6 dun ota gt OO 57600 Baud g CH CTIE Copyright 2006 Unistep Technologies SPI LM USR 004 User Manual Interpreter Mode Transparent Mode Normal Transmission Auto Count SPI Serial Port Interface 6 This is the Normal mode of operation SPI Exec program receives commands from the host application through the serial port and executes the command s In this mode SPI Exec treats all transmissions from the host application as binary data and writes them to the Digital Output Port Each write operation is followed by a negative pulse on the CIKO line In this mode SPI Exec also continuously monitors the CIKI line for any transitions When a transition is detected it reads the signals at the Digital Input Port and sends the data as a single byte to the host application A transmission from the SPI Module to the host application takes place only as a response to a command received from the host application The configuration switches control the serial transmission parameters In this transmission mode SPI Exec configures the SPI Module for communication at 1200 BAUD 8 Bits N
5. Program is run it immediately carries out the following actions Initialize the PC serial port and open the communication channel Initialize various internal parameters Contact the SPI module and get the SPI Exec version number Initialize the SPI module with the internal parameters Clear SPI digital output port bits and stop any PWM or Stepper activity Turn the red Power light next to the Reset button from red to green to indicate that all is well Once the Power indicator turns green the SPI Control Panel is ready to communicate with the SPI Exec 4 4 Digital Output Port The status of the 8 buffered digital output lines can be viewed and changed with the Digital Output Port indicators The dull red color indicates a logic LOW output A bright red color indicates a logic HIGH output on that line The SPI Control Panel Digital Output Port data bit indicators and the CIKO line indicator can be clicled on with the mouse to turn the corresponding bit and the associated LED lamp on and off The A ONT and A OFF buttons can turn all bits on and off respectively all at the same time 4 5 Digital Input Port The SPI Control Panel digital input port section has indicators to show the status of the 8 buffered digital input lines A dull red color indicates a logic LOW and the bright red color indicates a logic HIGH Digital Input Port indicators are display only indicators naturally and can not be clicked on The upper Read butto
6. below Pin 1 can be identified in two ways 1 Pin numbers 1 2 15 and 16 are printed on the board 2 On the solder side pin number 1 has a square solder pad instead of the usual oval pad It is recommended that you connect the ribbon cables so that the colored marker conductor indicates circuit 1 J3 J5 J4 Vcc AN 0 Vcc DIG INO Vcc DIG OUT 0 Vcc AN 1 Vcc DIG IN 1 Vec DIG OUT 1 Gnd AN 2 Gnd DIG IN 2 Gnd DIG OUT 2 Gnd AN 3 Gnd DIG IN 3 Gnd DIG OUT 3 AN 4 DIG IN 4 DIG OUT 4 AN 5 Vref CLKI DIG IN 5 CLKO DIG OUT 5 PWM DIG IN6 STEP DIG OUT 6 PWM DIR DIG IN7 STEP DIR DIG OUT 7 PortA Port B Port C Analog Input Digital Input Digital Output 2 4 Power Input This is the circuit built around the Q1 Power MOSFET It does three functions a Reverse power polarity protection with Q1 and R1 b Power Good indication with R2 and D12 and c Power supply filtering and decoupling with C1 C2 and C10 C13 2 5 Processor U1 is a PIC16F74 MPU that manages the serial port all host communications and all I O lines on board the SPI It runs the SPI Exec control program that interprets and executes the commands received from the controller application running on the host computer U1 runs at a clock frequency of 12 MHz as determined by the X1 oscillator crystal MPU reads the DIP switches S1 1 thru S1 6 for configuration information and provides status indicators with LED lamps D8 D11 There are two indicators that display informa
7. nie 10 Frame ElEVAETe CN 11 Section 5 Support Internet WWW sise daniel at entiere ecrans nel ele let nantes tenant annees de 12 CONICS airain E ces lens emma ann ss ege EES EES esse 12 Section 6 Appendices Command Reference ME 13 Circuit el RE 15 Parts List amp Component Placement Diagram cccececececeeeeeeeeeeeeeeeeneeeneneneneeees 16 Copyright 2006 Unistep Technologies SPI LM USR 004 User Manual SPI Serial Port Interface 3 1 INTRODUCTION Thank you for purchasing the LabMaster SPI Module This is a very capable circuit with powerful hardware and firmware features We hope that you will find the SPI module very helpful for your serial port interfacing automatic control and digital experimentation needs 1 1 Features 8 1 Channel digital output port 8 bit latched data 1 clock 8 1 Channel digital input port 8 bit buffered data 1 clock 5 1 Channel Analog input port 2 Stepper motor control outputs 2 PWM and DC motor control outputs LED indicators for digital outputs 16 Pin dual row headers for all UO channels 9 Pin D Sub RS 232 Interface for communicating with the host PC Serial communication configuration switches MPU configuration and reset switches Auto transmit mode for initial system checking Ready Activity LED indicator DIP switch selectable 1200 9600 19200 and 57600 Baud transmission speeds Parity enable disable and parity type selection LED lamps indicators for Parity and Framing er
8. M OCIO EE TECHNOLOGIES LabMaster Series Unistep LabMaster Series SPI SERIAL PORT INTERFACE MODULE USER MANUAL Copyright 2006 Unistep Technologies User Manual SPI Serial Port Interface 2 SPI SERIAL PORT INTERFACE USER MANUAL Section 1 Introduction SR aE aaaea aa adna Ea Nees 3 Package Contents 52 nenennnt este aa aaia a aa a 3 Instalati M essere oaa EA ee O ek 3 Section 2 Circuit Description lte dl el ET 4 Parts List and the Component Placement Diagram ccccceeeeeeeeeeeeeeeeeeeeeeeetees 4 T O Pin ASSIgNnMENtS sassssissssran ennnesennaslennarenns an dana anaana amet entend delest ane 4 POWEP nl TT 4 PrOC SSON TE 4 Serial RONG sonering seanang a Ea araa secc rae aea a Eai 5 Belle ele EE aaa aa aa E E A uum ANA AG 5 ill le 6 Analog Input POr dE 6 Digital Input dE 6 Digital Output POM EE 6 Section 3 Command Interpreter Command Kg le TE 7 Command Set vcscccscesesieaveedecvstecuevasvernccsviete Wa ennnneste ENEE EES nesrennus iii 7 Section 4 Control Panel Installaatiot 5555520 ee 2e ct eeees xa vais thes ronn css ss sen ees 8 Serial Port S ttiNgs ege edeegee eege ENEE EES 8 SPL EX G 2isss5rs2rcrr esse Ee eER nn ne Secs ZER csns an Ee ZER ERER EERSE de ied 9 DigitalOUtDUt POM EP aaa aaa daa anian 9 T6 1e LL eet dE 9 Analog Bil 9 PWM OUUU geess eddeee deeedek eege Weed Eege gente ns tete ENER See Eege ted 10 SLEPPEM OULDUE sercar naaa ses RR denses secs ere nN sente eds anus etienne
9. er manual 3 Data Sheets The Control Panel directory contains one exe file and at least one ocx file The exe file is the Control Panel program and can be copied to any directory of your choice The ocx file however needs to be copied to the windows system directory For most PC installations and MS Windows versions one common system directory is c windows system If the ocx file is copied into this directory the main Control Panel program can be run from any location 4 2 Serial Port Settings Serial Port setup and configuration controls of the SPI Control Panel program are grouped on the right hand side section Remember that you need to push click on the Apply button to activate any changes made to the serial port settings Of course SPI settings also need to be matched to the control panel settings for any successful communication to take place Copyright 2006 Unistep Technologies SPI LM USR 004 User Manual SPI Serial Port Interface 10 Comm Port You can use any of the Comm Ports 1 4 to communicate with the SPI module depending on which com port hardware is present on your computer Speed You can select 1200 9600 19200 or 57600 BAUD Parity Parity bit can be disabled or odd even parity can be selected Comm Errors Any communication errors in the transmissions received from the SPI module will be indicated by these error indicators They can be cleared using the C r button 4 3 SPI Exec When the SPI Control
10. lse period therefore the frequency it will not prevent you from entering invalid combinations One such example is to enter a pulse duration that is longer than the period of the signal The behaviour of the SPI Module for such invalid data can be unpredictable Responsibility for ensuring the validity of the configuration data rests with the user 4 8 Stepper Output The Stepper Motor section of the SPI Control Panel is used to configure and control the Stepper Motor Control signals generated by the SPI Module much like the PWM section Duration of the step pulse its repetition rate and the direction signal can all be individually controlled Pulse Duration This parameter is shown in the text box named Pulse The value cannot be entered directly but it can be incremented and decremented in steps of 1 and 10 using the buttons with the arrows Each count represents a duration of 1 0 ms and can be between 0 and 255 Pulse Period The text box named Period shows the pulse period of the stepper signal Each count represents 1 0 ms and can be incremented and decremented in steps of 1 and 10 using the buttons with the blue arrows The valid values are between 1 and 255 Direction The SDIR signal level can be controlled with the direction buttons Selecting the H or L buttons sets the SDIR signal to the High and Low levels respectively If this signal is not being used to control the direction of a stepper motor it can serve perfectly a
11. n reads and displays all Digital Input Port data bits The lower Read button is used only to read the input clock line CIKI 4 6 Analog Input Port This section of the SPI Control Panel manages the analog input port configuration and displays the values of the analog input signals e The reference voltage source selection defaults to Int Internal This means that the SPI module will use the 5 V DC supply line Vcc as its voltage reference e If an external reference is used the Ext button should be selected and the exact voltage of the reference should be entered into the Vref text box e When Ext is selected as the reference source Channel 5 AN5 is no longer available as an analog input channel and its corresponding Count and Volts text boxes show e The first column Count of 6 text boxes show the 8 bit digital values read from each of the 6 Analog Input Lines e The Volts column shows the voltage reading that corresponds to the count value when the reference voltage has the value indicated in the Vref text box Analog inputs are polled once each time the Read button is pressed Copyright 2006 Unistep Technologies SPI LM USR 004 User Manual SPI Serial Port Interface 11 4 7 PWM Output The PWM section of the SPI Control Panel is used to configure and control the PWM signals generated by the SPI Module The period duration of the on or high portion of the waveform and a Direction signal can be
12. o parity and one stop bit 1200 N 8 1 and continuously transmits single byte characters that count up from 00h to FFh The purpose of this mode is to provide a continuous stream of characters so that a terminal program can be used to confirm successful serial transmission between the host PC and the SPI Module Note SPI Module needs to be reset to recognize any configuration changes since these switches are only read during the initial power up or when a Reset operation is initiated 2 8 2 9 Indicators Power D12 On Indicates that power is on and the polarity is right MPU Mode Dii Off MPU is in the Command Interpreter mode It will receive commands from the host application carry out the commands and send a response back with a return code On MPU is in the Transparent Mode Any character received by the SPI module will be written to the Digital Output Port followed by a clock pulse on the CLKO line Also the data at the Digital Input port will be read upon detection of a READ pulse on the CLKI line and will be sent to the host application as a single byte Ready D10 On SPI has been initialized and the MPU is ready Off MPU is not running Pressing the RESET button should start the MPU Blink Command has been received and processed by the MPU Parity Error D9 On Incorrect parity bit detected Frame Error D8 On Invalid async frame received Usually indicates mismatch in BAUD rates Analog Input Port Port
13. of 8 LED lamps are used to show the status of each line Lamp is ON when the corresponding digital output line is HIGH Clock output line Can be set reset and pulsed with commands Not buffered Direction control bit for the stepper motor control applications Can be used as a general purpose digital output line with stepper output commands Not buffered Step pulse for stepper motor control applications Duration of the pulse and the pulse repetition period can be preset and the pulse generation can be started and stopped with stepper commands Not buffered Copyright 2006 Unistep Technologies SPI LM USR 004 User Manual SPI Serial Port Interface 8 3 COMMAND INTERPRETER SPI MPU manages communications controls all hardware resources on board and also runs the SPI Exec command interpreter when the MPU MODE switch S1 6 is in closed position and the MPU Mode indicator is OFF In this mode MPU always watches the serial port and immediately executes any commands received from the host Except for the System Reset command it also sends an acknowledgement response back to the host as soon as the command is executed If errors were detected an Error Response may be sent back 3 1 Command Structure Commands and responses are carried by Command frames and have identical structures Command frames are made up of four sections as shown below hh op nn mm tt LC Trailer Byte Hex EF Data Bytes as many as required by the Op Code
14. pper Direction to HIGH 1 R 52 Stepper direction set to HIGH 1 C 53 SDL Set Stepper Direction to LOW 1 R 53 Stepper direction set to LOW 1 C 54 nn STD Set Stepper Pulse Duration to lt nn gt ms 2 R 54 Stepper pulse duration set 1 C 55 nn STP Set Stepper Pulse Period to lt nn gt ms 2 R 55 Stepper pulse period set 1 12C Port NOT IMPLEMENTED IN VERSION 1 0 C 60 nn DIC Download 12C Packet of lt nn gt bytes nn 2 R 60 12C packet downloaded 1 C 61 TIC Transmit 12C Packet from Buffer 1 R 61 IC Packet Transmitted 1 C 62 RIC Receive DC Packet 1 R 62 12C Packet Received 1 C 63 UIC Upload 12C Packet 1 R 63 nn Uploading H packet of lt nn gt bytes nn 2 ERROR Response R FO CNR Command not Recognized 1 R F1 CFE Command Framing Error 1 R F2 CRE Parameter Range Error 1 R F3 ETO Event Time Out 1 R F4 OVR Command Buffer Overrun 1 Command Response Operation Op Codes indicated as C are the commands that would be sent to the SPI module to carry out the desired operation SPI unit will always acknowledge the command with a response Op Code These response Op Codes are the ones indicated with an R in the Cmnd Resp column It is up to the user application to make use of these response codes Copyright 2006 Unistep Technologies SPI LM USR 004
15. precisely controlled to obtain the desired PWM operation Pulse Duration This parameter is shown in the text box named Pulse The value cannot be entered directly but it can be incremented and decremented in steps of 1 and 10 using the buttons with the arrows Each count represents a duration of 1 3 us and can be between 0 and 255 Pulse Period The text box named Period shows the pulse period of the PWM signal Each count represents 5 3 us and can be incremented and decremented in steps of 1 and 10 using the buttons with the blue arrows The valid values are between 1 and 255 Direction Even though a PWM signal has no direction associated with it since a major class of applications for PWM involves DC motor control the SPI module provides a direction signal for a DC motor that might be driven with the PWM output Selecting the H or L controls the level of the PDIR signal and can be utilized to provide direction control for the DC motor For any application that does not require a direction output this signal can be utilized as a general purpose digital output Start Stop Once the pulse configuration parameters are set the PWM signal can be started and stopped with these buttons The stop start operations do not affect the configuration settings Program will retain the configuration information until it is terminated Note Even though the SPI Control Panel lets you individually and independently adjust the pulse duration and pu
16. rors Transparent mode of operation for simple I O needs Powerful SPI Exec Command Interpreter for sophisticated control functions LED lamp indicator for MPU command mode Support for external voltage reference input Fully configurable PWM output channel Reverse polarity input power protection Fully socketed IC s Vcc and Gnd power lines included in I O headers for powering external circuits 1 2 Package Contents Please make sure that you have the following items in the SPI package 1 The SPI Module 1 2 Flat ribbon cable segments with 16 Pin IDC connector at one end 3 3 Software and Documentation CD 1 1 3 Installation No assembly is required as the SPI module is shipped fully assembled and tested Copyright 2006 Unistep Technologies SPI LM USR 004 User Manual SPI Serial Port Interface 4 2 CIRCUIT DESCRIPTION 2 1 Circuit Diagram Full circuit diagram is included at the end of this manual You may find it useful to keep it open while reading the following sections about the circuit details 2 2 Parts List and the Component Placement Diagram At the end of this manual you will also find one page with the Parts List and Component Placement Diagram These will be useful if you need to locate a component on the SPI board or if you need to find replacement parts 2 3 I O Pin Assignments All 1 0 lines of the SPI circuit are brought out on 16 Pin dual row header strips These pins are numbered as shown in the figures
17. s a general purpose digital output Start Stop Once the pulse configuration parameters are set the stepper signal can be started and stopped with these buttons The stop start operations do not affect the configuration settings Program will retain the configuration information until it is terminated Note Even though the SPI Control Panel lets you individually and independently adjust the pulse duration and pulse period therefore the repetition rate it will not prevent you from entering invalid combinations One such example is to enter a pulse duration that is longer than the period of the signal The behaviour of the SPI Copyright 2006 Unistep Technologies SPI LM USR 004 User Manual SPI Serial Port Interface 12 Module for such invalid data can be unpredictable Responsibility for ensuring the validity of the configuration data rests with the user 4 9 Frame Display Boxes The Tx and Rx text boxes are provided as a visual confirmation of the command frames exchanged between the SPI Control Panel and the SPI Module These also work well to illustrate the use of the command frames for various control actions Tx Box The Tx text box at the bottom of the SPI Control Panel screen show the control frames transmitted to the SPI Module when on screen controls are used to control the SPI Module Rx Box The Rx text box at the bottom of the SPI Control Panel screen show the command frames received from the SPI Module Copyrigh
18. t 2006 Unistep Technologies SPI LM USR 004 User Manual SPI Serial Port Interface 13 5 SUPPORT We are here to help if you need assistance in using or troubleshooting the SPI Module or the SPI Control Panel Please do not hesitate to contact Unistep Tech Support using any of the means listed below Internet Our web site www unistep ca has some support information and we are adding new material all the time E Mail Please use our e mail support address support unistep ca for any questions comments or recommendations you may wish to send our way We strive to reply within two days Phone Please contact us at 416 619 9308 if you need immediate help Copyright 2006 Unistep Technologies SPI LM USR 004 User Manual SPI Serial Port Interface 14 SPI Exec Command Summary v1 0 oup Op Code Da d Op System amp Config C 01 RST System Reset 1 R 01 System Reset Proceeding 1 C 02 SID Report SPI Exec ID 1 R 02 nn mm SPI Exec version follows lt nn mm gt 3 Digital Output C 10 nn OUB nn Write Output Byte lt nn gt 2 R 10 Byte written to Output Port 1 C 11 nn mm OUW Write Output Word lt mm nn gt 3 nn mm R 11 Word written to Output Port 1 C 12 nn SCD Set Output Clock Duration to lt nn gt ms 2 R 12 Output clock duration set 1 C 13 CLP Pulse Output Clock 1 R 13
19. tion about the processor MPU Mode Di1 Works in conjunction with S1 6 switch to indicate that the MPU is in the Command Interpreter Mode SPI Ready D10 Steady ON SPI is ready to accept commands Blinking A reset operation underway or commands are being executed 2 6 Serial Comm Port Copyright 2006 Unistep Technologies SPI LM USR 004 User Manual SPI Serial Port Interface 5 All communication with the host PC takes place via the serial Port J2 connector is a 9 Pin female socket that is wired as a DCE Data Communication Equipment interface so that a single 9 conductor M F serial cable can be used without requiring gender changers or null modem adapters J2 provides null modem functionality by shorting RTS line with CTS and DSR line with DTR Figure 3 Data Set Ready DSR CD Carrier Detect DCE wired DB 09 socket Request To Send RTS RxD Receive Data Clear To Send CTS TxD Transmit Data Ring Indicator RI DTR Data Terminal Ready SG Signal Ground connector pin assignments 2 7 Configuration DIP Switch Bank S1 is used to set the SPI communication parameters as follows C Closed ON O Open OFF pa SSSR EE esse gt C Even Parity UEL lei SR UU Lei Cle Lie ie Jej Je Le gt O Odd Parity EE oy ee ee SE 723 4 5 6 i SE k C Transparent Mode IT E i i i i LIL LILILI ooi 1 2 3 4 5 6 Ge gt O Interpreter Mode H C HH Hg 1 2 3 4 5 6 Pre gt C Normal Transmission H c L
Download Pdf Manuals
Related Search
Related Contents
家庭用生ごみ処理機 (微生物分解型) MANUAL DEL PROPIETARIO Oracle Inventory User's Guide 取扱説明書 内蔵セキュリティチップ(TPM)ご利用の手引き the PDF - Support nova230 for M-Bus DELL Vostro 270s Sunix SER4033A Ours manipuler médias Copyright © All rights reserved.
Failed to retrieve file