Transcript s Guide
Technology for Imaginations Multi 232_4 User ‘s Guide User ‘s Guide Rev. 1.0 2009. 03. 01 Copyright SangSangDom, All Rights Reserved. www.SangSangDom.com Technology for Imaginations Preface Read This First About This Manual This users guide describes the characteristics, operation, and use of the Multi 232_4 Toolkit board. A complete circuit description as well as schematic diagram is included. How to Use This Manual This document contains the following chapters: Chapter 1 - Introduction and Description Chapter 2 - User Control Chapter 3 - Schematics Chapter 4 - VHDL Code for CPLD Related Documentation From SangSangDom This document contains the following chapters: SangSangDom Technology for Imaginations Contents 1. Introduction & Description 1.1 Features 1.2 Layout & Dimension 1.3 Functionality 2. User Control 2.1 RS232 Channel Interface 2.2 Operating Mode Selection 3. Schematics 4. VHDL Code for CPLD SangSangDom Technology for Imaginations 1. Introduction & Description 1.1 Features Multi 232-4 PLD를 통하여 사용자의 목적에 따라 serial Channel control 기능 제공 - 송신 시 1:1, 1:2 1:3, 1:4 통신 가능 - 수신 시 1:1 통신 가능 1.2 Layout & Dimension - 배치도 SangSangDom Technology for Imaginations 1.3 Functionality - 4 Channel 의 Serial 통신 가능 - mode, dec, sel0-3 의 설정을 통해 각 Channel 조작 가능 - 1 : 1~4 방식의 Serial 통신 가능 Multi 232_4 2 3 2 User Channel1 Channel2 1:1, 1:2 1:3, 1:4 통신 가능 PLD 2 3 2 Channel3 Channel4 SangSangDom Technology for Imaginations 2. User Control 2.1 RS232 Channel Interface RS232 Driver를 통하여 외부의 RS232 Terminal과 연결되는 Connector로써 4개의 채널을 동시에 연결하여 사용할 수 있다. 1 2 3 Tx0 Rx0 1 2 Tx1 Rx1 3 1 2 3 Tx2 Rx2 1 2 3 Tx3 Rx3 GND Table 1-1 Connector ECH Pinout Pin Number Signal Description CH1 - 1 CH1 TX RS232 채널 1번의 TX 포트 CH1 - 2 CH1 RX RS232 채널 1번의 RX 포트 CH1 - 3 CH1 GND RS232 채널 1번의 GND CH2 - 1 CH1 TX RS232 채널 2번의 TX 포트 CH2 - 2 CH1 RX RS232 채널 2번의 RX 포트 CH2 - 3 CH1 GND RS232 채널 2번의 GND CH3 - 1 CH3 TX RS232 채널 3번의 TX 포트 CH3 - 2 CH3 RX RS232 채널 3번의 RX 포트 CH3 - 3 CH1 GND RS232 채널 3번의 GND CH4 - 1 CH4 TX RS232 채널 4번의 TX 포트 CH4 - 2 CH4 RX RS232 채널 4번의 RX 포트 CH4 - 3 CH4 GND RS232 채널 4번의 GND SangSangDom Technology for Imaginations 2.2 Operating Mode Selection Multi_232_4는 Mode, DEC, SEL control 하여 각각의 Channel 과 연결 할 수 있다. MODE Mode Pin 설정은 Pin 1,2번과 연결 하면 ‘H ‘값을 갖게 되고 Pin 2,3번과 연결 하면 “L’값을 갖게 된다. (‘H’값 : 1 2 3 ‘L’값 일 때 : 1 2 3 ) Mode가 ‘H’일 때 SEL0~3 까지 선택하여 각 Cannel을 연결 할 수 있으며 ‘L’일 때는 4 Channel 모두 연결 가능 하지만 수신은 SEL0~3 까지 선택하여 각 Channel을 연결 한다. 1 2 3 Table 1-2 Operating Mode Selection Pinout Pin Number Signal Description 1 VCC Power 2 MODE Mode Select 3 GND Graund DEC DEC Pin 설정은 Pin 1,2번과 연결 하면 ‘H ‘값을 갖게 되고 Pin 2,3번과 연결 하면 “L’값을 갖게 된다. (‘H’값 일 때 : 1 2 3 ‘L’값 일 때 : 1 2 3 ) DEC가 ‘H’일 때 SEL0~1 까지 만 선택하여 각 Cannel을 연결 할 수 있으며 ‘L’일 때는 SEL0~3 까지 선택하여 각 Channel을 연결 할 수 있다. 1 2 3 Table 1-3 Operating DED Selection Pinout Pin Number Signal Description 1 VCC Power 2 MODE Mode Select 3 GND Graund SangSangDom Technology for Imaginations Control Mode, DEC Pin이 설정 되어 있을 때 SEL0~3 까지 값을 선택하여 각각의 Channel을 연결할 수 있다. Pin IND0~3는 LED Control 해주며 SEL0~3 값에 따라 LED 점등을 확인 할 수 있다. 13 11 9 7 5 3 1 14 12 10 8 6 41 2 Table 1-4 Operating CTRL Selection Pinout Pin Number Signal Description 1 TX Transmit Pin 2 RX Receive Pin 3, 4 GND Ground 5~8 SEL0~3 Channel Selector 9~12 IND0~3 LED Controller 13 MODE Mode Select 14 DEC DEC Select Mode, DEC Pin이 설정 되어 있을 때 SEL0~3 까지 값을 선택하여 각각의 Channel을 연결할 수 있다. Pin IND0~3는 LED Control 해주며 SEL0~3 값에 따라 LED 점등을 확인 할 수 있다. 회로 설계 시 1번 Pin과 2번 Pin 은 1:1 대응으로 연결 하여 준다. (TX=>TX, RX=>RX) POWER - DC 5 v - 상단 (화살표) : VCC -하 단 : GND SangSangDom Technology for Imaginations Multi_232_4 Control Mode = ‘L’ DEC = ‘L’ 일 때 Table 1-5 Operating Multi_232_4 Selection (MDO=‘L, DEC=‘L’) SEL0 SEL1 SEL2 SEL3 송신 수신 L L L L 4 Channel 송신 가능 수신 불가능 H L L L 송신 불가능 Channel 1 수신 가능 L H L L 송신 불가능 Channel 2 수신 가능 L L H L 송신 불가능 Channel 3 수신 가능 L L L H 송신 불가능 Channel 4 수신 가능 Mode = ‘H’ DEC = ‘L’ 일 때 Table 1-5 Operating Multi_232_4 Selection (MDO=‘H’, DEC=‘L’) SEL0 SEL1 SEL2 SEL3 송신 수신 H L L L Channel 1 송신 가능 Channel 1 수신 가능 L H L L Channel 2 송신 가능 Channel 2 수신 가능 L L H L Channel 3 송신 가능 Channel 3 수신 가능 L L L H Channel 4 송신 가능 Channel 4 수신 가능 Mode = ‘L’ DEC = ‘H’ 일 때 Table 1-5 Operating Multi_232_4 Selection (MDO=‘L’, DEC=‘H’) SEL0 SEL1 SEL2 SEL3 송신 수신 L L L L 4 Channel 송신 가능 수신 불가능 H L L L 송신 불가능 Channel 1 수신 가능 L H L L 송신 불가능 Channel 2 수신 가능 L L H L 송신 불가능 Channel 3 수신 가능 L L L H 송신 불가능 Channel 4 수신 가능 SangSangDom Technology for Imaginations Mode = ‘H’ DEC = ‘H’ 일 때 Table 1-5 Operating Multi_232_4 Selection (MDO=‘H’, DEC=‘H’) SEL0 SEL1 SEL2 SEL3 송신 수신 L L L L Channel 1 송신 가능 수신 불가능 H L L L Channel 3 송신 가능 Channel 1 수신 가능 L H L L Channel 2 송신 가능 Channel 2 수신 가능 L L H L 송신 불가능 Channel 3 수신 가능 L L L H 송신 불가능 Channel 4 수신 가능 H H L L Channel 4 송신 가능 수신 불가능 SangSangDom Technology for Imaginations 3. Schematics SangSangDom Technology for Imaginations SangSangDom Technology for Imaginations 4. VHDL Code for CPLD RX 송신 코드 -- DCE -> 232 Driver -> PLD -> AVR -> DTE library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity MULRX_232 is port ( RXD0,RXD1,RXD2,RXD3 SEL0,SEL1,SEL2,SEL3 MODE IND0,IND1,IND2,IND3 RX : in std_logic; : in std_logic; : in std_logic; : out std_logic; : out std_logic ); end MULRX_232; architecture MULRX_232_BODY of MULRX_232 is begin process(RXD0,RXD1,RXD2,RXD3,MODE) begin if MODE='1' then -- MODE = '1', selective RX if SEL0='1' and SEL1='0' and SEL2='0' and SEL3='0' then RX <= RXD0; IND0 <= '1'; elsif SEL0='0' and SEL1='1' and SEL2='0' and SEL3='0' then RX <= RXD1; IND1 <= '1'; elsif SEL0='0' and SEL1='0' and SEL2='1' and SEL3='0' then RX <= RXD2; IND2 <= '1'; elsif SEL0='0' and SEL1='0' and SEL2='0' and SEL3='1' then RX <= RXD3; IND3 <= '1'; else RX <= 'Z'; IND0 IND1 IND2 IND3 <= <= <= <= '0'; '0'; '0'; '0'; end if; else SangSangDom Technology for Imaginations ------ MODE = '0', broadcast RX -> selective RX ------if SEL0='1' and SEL1='0' and SEL2='0' and SEL3='0' then RX <= RXD0; IND0 <= '1'; elsif SEL0='0' and SEL1='1' and SEL2='0' and SEL3='0' then RX <= RXD1; IND1 <= '1'; elsif SEL0='0' and SEL1='0' and SEL2='1' and SEL3='0' then RX <= RXD2; IND2 <= '1'; elsif SEL0='0' and SEL1='0' and SEL2='0' and SEL3='1' then RX <= RXD3; IND3 <= '1'; else RX <= 'Z'; IND0 IND1 IND2 IND3 <= <= <= <= '0'; '0'; '0'; '0'; end if; ----------------------------------------------RX <= 'Z'; IND0 <= '0'; IND1 <= '0'; IND2 <= '0'; IND3 <= '0'; end if; end process; end MULRX_232_BODY; SangSangDom Technology for Imaginations TX 수신 코드 -- DTE -> AVR -> PLD -> 232 Driver -> DCE library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity MULTX_232 is port ( TX MODE DEC SEL0,SEL1,SEL2,SEL3 TXD0,TXD1,TXD2,TXD3 ); end MULTX_232 ; : : : : in in in in std_logic; std_logic; std_logic; std_logic; : out std_logic architecture MULTX_232_BODY of MULTX_232 is begin process(TX, MODE, DEC) begin if MODE = '1' and DEC = '1' then -- selective transmit , decoder O if SEL0 = '0' and SEL1 = '0' then TXD0 <= TX; elsif SEL0 = '0' and SEL1 = '1' then TXD1 <= TX; elsif SEL0 = '1' and SEL1 = '0' then TXD2 <= TX; elsif SEL0 = '1' and SEL1 = '1' then TXD3 <= TX; else TXD0 <= 'Z'; TXD1 <= 'Z'; TXD2 <= 'Z'; TXD3 <= 'Z'; end if; elsif MODE = '1' and DEC = '0' then -- selective transmit , decoder X if SEL0 = '1' and SEL1 = '0' and SEL2 = '0' and SEL3 = '0' then TXD0 <= TX; elsif SEL0 = '0' and SEL1 = '1' and SEL2 = '0' and SEL3 = '0' then TXD1 <= TX; elsif SEL0 = '0' and SEL1 = '0' and SEL2 = '1' and SEL3 = '0' then TXD2 <= TX; elsif SEL0 = '0' and SEL1 = '0' and SEL2 = '0' and SEL3 = '1' then TXD3 <= TX; end if; SangSangDom Technology for Imaginations elsif MODE = '0' and DEC = '0' then -- broadcast transmit , decoder X if SEL0 = '0' and SEL1 = '0' and SEL2 = '0' and SEL3 = '0' then TXD0 <= TX; TXD1 <= TX; TXD2 <= TX; TXD3 <= TX; else TXD0 <= 'Z'; TXD1 <= 'Z'; TXD2 <= 'Z'; TXD3 <= 'Z'; end if; elsif MODE = '0' and DEC = '1' then if SEL0 = '0' and SEL1 TXD0 TXD1 TXD2 TXD3 else TXD0 TXD1 TXD2 TXD3 end if; -- broadcast transmit , decoder X = '0' and SEL2 = '0' and SEL3 = '0' then <= TX; <= TX; <= TX; <= TX; <= <= <= <= 'Z'; 'Z'; 'Z'; 'Z'; else TXD0 TXD1 TXD2 TXD3 <= <= <= <= 'Z'; 'Z'; 'Z'; 'Z'; end if; end process; END MULTX_232_BODY; SangSangDom