KR900002629B1 - Apparatus and method for reading switch settings in micom - Google Patents

Apparatus and method for reading switch settings in micom Download PDF

Info

Publication number
KR900002629B1
KR900002629B1 KR1019870011395A KR870011395A KR900002629B1 KR 900002629 B1 KR900002629 B1 KR 900002629B1 KR 1019870011395 A KR1019870011395 A KR 1019870011395A KR 870011395 A KR870011395 A KR 870011395A KR 900002629 B1 KR900002629 B1 KR 900002629B1
Authority
KR
South Korea
Prior art keywords
switches
microcomputer
bit
shift
setting values
Prior art date
Application number
KR1019870011395A
Other languages
Korean (ko)
Other versions
KR890007167A (en
Inventor
김광석
Original Assignee
삼성전자 주식회사
안시환
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 삼성전자 주식회사, 안시환 filed Critical 삼성전자 주식회사
Priority to KR1019870011395A priority Critical patent/KR900002629B1/en
Publication of KR890007167A publication Critical patent/KR890007167A/en
Application granted granted Critical
Publication of KR900002629B1 publication Critical patent/KR900002629B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units

Abstract

The circuit for reading the switch setting value with 3 I/O port pins comprises a number of switches (S1-24) selecting the system mode, a microprocessor (100) reading the switch setting value one bit by one bit sequentially by generating the load and shift signals, and registers (201-203) connected in parallel. The registers are transfered to the shift mode after loading the switch setting value with the load and shift signals. The loaded value is shifted one bit by one bit and provided to the microprocessor one by one.

Description

마이콤에서 스위치 세팅을 읽어들이는 장치 및 방법Apparatus and method for reading switch settings from Micom

제 1 도는 본 발명에 따른 시스템도.1 is a system diagram according to the present invention.

제 2 도는 본 발명의 흐름도.2 is a flow chart of the present invention.

* 도면의 주요부분에 대한 부호의 설명* Explanation of symbols for main parts of the drawings

100 : 마이크로컴퓨터 201-203 : 레지스터회로100: microcomputer 201-203: register circuit

SW1-SW24 : 스위치 R1-R24 : 저항SW1-SW24: Switch R1-R24: Resistance

본 발명은 마이크로컴퓨터를 이용한 컴퓨터나 프린터 시스템에 관한 것으로 특히 시스템의 작동모드를 선택하는 스위치들의 세팅값을 읽어들이는 장치 및 방법에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a computer or printer system using a microcomputer, and more particularly, to an apparatus and method for reading setting values of switches for selecting an operation mode of a system.

통상적으로 컴퓨터(Computer)나 프린터(Printer)장치를 설계할 때에는 시스템이 작동하는 모드(Mode)나 여러 옵션(Option)장치들을 설치 작동시키는데 있어서 모든 선택에 스위치를 이용하고 있다. 이때 운용자가 원하는 모드의 스위치를 세팅해 놓으면 컴퓨터나 프린터시스템은 그 스위치의 세팅값을 읽어들여 그 모드에 해당하는 소프트웨어(Soft ware)를 사용 시스템을 작동한다.In general, when designing a computer or a printer device, a switch is used for all selections in the mode in which the system operates or in the operation of various option devices. At this time, if the operator sets the desired mode switch, the computer or printer system reads the setting value of the switch and uses the software corresponding to the mode to operate the system.

그러나 종래의 마이크로컴퓨터를 응용하는 시스템은 스위치 세팅값을 읽어들이기 위하여 병렬 인터페이스(Interface) 입출력 칩을 이용 직접스위치의 세팅값을 읽어들이는 방법과 입출력포트와 메모리 어드레스 구간중의 일부를 할당하여 어드레스 디코딩 방식에 따라 읽어들이는 방법이 있으나 상기와 같이 스위치 세팅값을 읽어들이는 방법에는 전원공급시(Power-on time)에 한번 읽어들이면 전원차단시(Power-off time)까지 다시 읽어들일 필요가 없기 때문에 값비싼 입출력 칩을 사용 직접 입출력단자들과 스위치들을 1 : 1로 대응시켜 읽어들이는 것은 원가상승 및 자원의 낭비를 초래하는 문제점과 어드레스 디코딩을 행함으로 많은 메모리를 필요로 하는 시스템에서는 메모리맵 설계상의 제약조건이 되는 문제점이 있었다.However, a system using a conventional microcomputer uses a parallel interface I / O chip to read a switch's setting value directly by using a parallel interface I / O chip, and allocates a portion of an input / output port and a memory address section. There is a method of reading according to the decoding method, but the method of reading the switch setting value as described above does not need to read again until the power-off time when it is read once at power-on time. Using expensive I / O chips, the direct readout of I / O terminals and switches in a one-to-one correspondence can cause cost increases and waste of resources and address decoding. There is a problem that becomes a constraint on the map design.

따라서 본 발명의 목적은 마이크로컴퓨터의 입출력포트중 3개의 입출력포트핀을 이용하여 스위치의 세팅값을 읽어들일 수 있는 장치 및 방법을 제공함에 있다.Accordingly, an object of the present invention is to provide an apparatus and method for reading a setting value of a switch using three input / output port pins of an input / output port of a microcomputer.

이하 본 발명을 첨부한 도면을 참조하여 상세히 설명한다.Hereinafter, the present invention will be described in detail with reference to the accompanying drawings.

제 1 도는 발명에 따른 시스템도로서 100은 마이크로컴퓨터, 201-203은 레지스터회로, SW1-SW24는 스위치, R1-R24는 저항이며, 작동모드를 선택하기 위한 다수의 스위치(SW1-SW24)와, 시스템을 제어하기 위한 클럭펄스와 로오드 및 쉬프트신호를 각각 발생하여 상기 스위치들(SW1-SW24)의 세팅값을 1개씩 순차적으로 읽어들이는 마이크로컴퓨터(100)와, 상기 로오드 및 쉬프트신호를 병렬로오드 및 쉬프트단자로 클럭펄스를 클럭단자로 입력하여 상기 로오드 및 쉬프트신호에 의해 다수의 병렬입력단자에 각각 접속된 다수의 스위치(SW1-SW24)의 세팅값을 로오드한 후 쉬프트모드로 전환 상기 클럭펄스에 의해 한비트씩 쉬프트하므로서 스위치의 세팅값은 마이크로컴퓨터(100)로 출력하는 종속접속된 다수의 제 1-3 레지스터회로(201-203)들로 구성된다.1 is a system diagram according to the invention, 100 is a microcomputer, 201-203 is a register circuit, SW1-SW24 is a switch, R1-R24 is a resistor, a plurality of switches (SW1-SW24) for selecting an operation mode, The microcomputer 100 generates a clock pulse, a rod and a shift signal for controlling the system, and sequentially reads the setting values of the switches SW1 to SW24 one by one, and the rod and shift signals. Shift mode after inputting clock pulses into the clock and output terminals of the parallel output terminals and the shift terminals, and loading the set values of the switches (SW1-SW24) respectively connected to the plurality of parallel input terminals by the rod and shift signals. By shifting the clock pulse by one bit, the setting value of the switch is composed of a plurality of cascaded first to third register circuits 201 to 203 which are output to the microcomputer 100.

제 2 도는 본 발명의 흐름도로서 마이크로컴퓨터(100)에서 로오드 및 쉬프트신호를 발생하므로서 다수의 스위치(SW1-SW24)의 세팅값을 제 1-3 레지스터(201-203)의 다수 비트에 각각 저장하는 제 1 단계와, 상기 마이크로컴퓨터(100)는 다시 쉬프트신호를 발생하여 제 1- 제 3 레지스터회로(201-203)들을 쉬프트모드로 전환함과 동시에 마이크로컴퓨터(100)내에 있는 카운트의 계수를 다수의 스위치(SW1-SW24)수로 같게 카운팅하는 제 2 단계와, 마이크로컴퓨터(100)로 하여금 클럭펄스들을 발생 제 1-3 레지스트회로(201-203)에 저장된 다수의 스위치(SW1-SW24)의 세팅값을 1비트씩 쉬프트하여 1비트의 데이터를 순차적으로 읽어들이고 1비트의 데이터를 읽어들일 때마다 카운터의 계수를 "1"씩 감산하므로 카운터의 계수가 "0'가 될때까지 반복 수행하여 스위치(SW1-SW24)들의 세팅값을 읽어들이는 제 3 단계와, 제 3 단계중 카운터의 계수가 "0"일시 리드(READ)동작을 종료하게 되는 제 4 단계로 이루어진다.FIG. 2 is a flow chart of the present invention, which generates the load and shift signals in the microcomputer 100 and stores the setting values of the plurality of switches SW1-SW24 in the plurality of bits of the first to third registers 201 to 203, respectively. In the first step, the microcomputer 100 generates a shift signal again to switch the first-third register circuits 201-203 to the shift mode, and at the same time counts the counts of the counts in the microcomputer 100. A second step of counting the same number of switches SW1-SW24, and causing the microcomputer 100 to generate clock pulses of the plurality of switches SW1-SW24 stored in the first to third resist circuits 201-203. Shifting the setting value by 1 bit to read 1 bit of data sequentially and subtracting the counter coefficient by "1" every time 1 bit of data is read, so it repeats until the counter count reaches "0". Setting value of (SW1-SW24) And a fourth step of terminating the read operation when the count of the counter is " 0 " during the third step.

따라서 본 발명을 상기 제 1 제 2 도를 참조하여 상세히 설명한다. 먼저 발명의 시스템중 마이크로컴퓨터(100)는 입출력 병렬 인터페이스회로와 입출력포트(Port)를 구비하고 있음을 명시해 둔다.Accordingly, the present invention will be described in detail with reference to the first and second drawings. First, it is noted that the microcomputer 100 of the system of the present invention has an input / output parallel interface circuit and an input / output port.

최초 운용자가 다수의 스위치(SW1-SW24)중 소정스위치(SW1)를 선택조작하였다면 상기 소정 스위치(SW1)는 온(ON)되어 저항(R1)을 통해 공급되는 제 1 전원(VCC)를 제 2 전원(GND)와 도통하여 라인(4) 상에 로우(Low)상태를 유지하게되며 오프(OFF)상태로 남아 있게되면 상기 저항(R1)을 통해 라인(4)에 공급되는 제 1 전원(VCC)와 제 2 전원(GND)는 단락되어 라인(4)상에 하이(High)상태를 발생함으로서 모든작동을 실행케한다.If the first operator selects the predetermined switch SW1 among the plurality of switches SW1-SW24, the predetermined switch SW1 is turned on to supply the first power VCC supplied through the resistor R1 to the second power supply. The first power source VCC supplied to the line 4 through the resistor R1 is maintained in the low state on the line 4 in conduction with the power source GND. ) And the second power supply GND are short-circuited to generate a high state on the line 4 to perform all operations.

그리고 다른스위치(SW2-SW24)들로 상기 스위치(SW1)과 같이 동작한다.The other switches SW2-SW24 operate as the switches SW1.

상기와 같이 동작하는 스위치들(SW1-SW24)중의 어느하나를 선택하여 모든 작동을 운용자가 입력하였을 경우 마이크로컴퓨터(100)는 출력단자(P1)를 통해 라인(1)상에 로오드신호를 발생 출력한다. 상기 라인(1)상의 로오드신호를 로오드 및 쉬프트단자로 입력하는 제 1-3 레지스터회로(201-203)들은 상기 로오드신호에 의해 다수의 병렬 입력단자(PD0-PD23)에 각각 접속된 다수의 스위치(SW1-SW24)의 세팅값을 내부의 다수비트에 각각 로오딩하므로서 저장한다.When the operator inputs all the operations by selecting any one of the switches SW1-SW24 operating as described above, the microcomputer 100 generates a raw signal on the line 1 through the output terminal P1. Output The first to third register circuits 201 to 203 for inputting the low signal on the line 1 to the low and shift terminals are respectively connected to a plurality of parallel input terminals PD0 to PD23 by the low signal. The setting values of the plurality of switches SW1-SW24 are stored by loading each of the plurality of internal bits.

이때 마이크로컴퓨터(100)는 다시 출력단자(P1)을 통해 라인(1)상에 쉬프트신호를 발생 출력함과 동시에 자체내에 있는 카운터의 계수를 스위치(SW1-SW24)들의 수량과 같게 카운팅한다. 상기 라인(1)상의 쉬프트신호를 로오드 및 쉬프트단자로 입력하는 제 1-3 레지스트회로(201-203)들은 쉬프트모드로 전환한다.At this time, the microcomputer 100 again generates and outputs a shift signal on the line 1 through the output terminal P1 and counts the count of the counter within the same number as the switches SW1-SW24. The first to third resist circuits 201 to 203 for inputting the shift signal on the line 1 to the rod and the shift terminal switch to the shift mode.

상기와 같이 카운터의 계수를 스위치(SW1-SW24)들의 수량과 같게하고 제 1-3 레지스터회로(201-203)들을 쉬프트모드로 한후 마이크로컴퓨터(100)는 클럭펄스를 출력단자(P2)를 통해 라인(2)상에 발생출력한다.As described above, the counter count is equal to the number of switches SW1-SW24 and the first to third register circuits 201-203 are shifted, and then the microcomputer 100 outputs a clock pulse through the output terminal P2. Generated output on the line (2).

그러면 상기 라인(2)상의 클럭펄스를 클럭단자로 입력하는 제 1-3 레지스터회로(201-203)들은 다수의 비트에 저장한 스위치(SW1-SW24)들의 세팅값을 한비트씩 쉬프트하여 제 3 레지스트회로(203)는 스위치(SW17)의 세팅값을 직렬 출력단자를 통해 출력하고 제 2 레지스터회로(202)는 상기 스위치(SW17)의 세팅값을 직렬입력단자로 입력함과 동시에 스위치(SW9)의 세팅값을 직렬출력 단자를 통해 출력하며 또한 제 1 레지스터회로(201)도 상기 스위치(SW9)의 세팅값을 직렬인력단자로 입력함과 동시에 스위치(SW1)의 세팅값을 직렬출력 단자를 통해 라인(3)상으로 출력한다.Then, the first to third register circuits 201 to 203 for inputting the clock pulse on the line 2 to the clock terminal shift the setting values of the switches SW1 to SW24 stored in the plurality of bits bit by bit to form a third register. The circuit 203 outputs the setting value of the switch SW17 through the serial output terminal, and the second register circuit 202 inputs the setting value of the switch SW17 to the serial input terminal and simultaneously Outputs the setting value through the serial output terminal, and the first register circuit 201 also inputs the setting value of the switch SW9 to the serial labor terminal and simultaneously sets the setting value of the switch SW1 through the serial output terminal. (3) Print it out.

상기 라인(3)상의 스위치(SW1)의 세팅값을 입력단자(P0)로 입력하는 마이크로컴퓨터(100)는 상기 스위치(SW1)의 세팅값을 읽어들여 자체내에 있는 버퍼에 저장하고 카운터의 계수를 "1"만큼 감산하며 카운터의 계수가 "0"이 될때까지 클럭펄스를 출력단자(P2)를 통해 라인(2)상으로 출력하여 스위치(SW2-SW24)들의 세팅값을 순차적으로 순차적으로 한비트씩 읽어들여 버퍼에 저장한다.The microcomputer 100 which inputs the setting value of the switch SW1 on the line 3 to the input terminal P0 reads the setting value of the switch SW1, stores the setting value of the switch SW1 in its own buffer, and stores the counter coefficient. Subtract by "1" and output clock pulse on the line 2 through the output terminal P2 until the counter count becomes "0", and sequentially set the values of the switches SW2-SW24 by one bit sequentially. Read and store in buffer.

그리고 마이크로컴퓨터(100)는 카운터의 계수가 "0"되면 클럭 펄스의 발생을 중지하여 리드(Read)동작을 종료하게 된다.When the counter count is 0, the microcomputer 100 stops the generation of the clock pulse to end the read operation.

따라서 본 발명은 입출력포트의 3개의 핀(Pin)만을 사용하여 다수의 스위치(SW1-SW24)의 세팅값을 읽어들임으로 효율적인 입출력포트의 사용과 설계를 행할 수 있는 이점과 또한 메모리내에 어드레스공간을 할당하지 않으므로 어드레스공간의 활용영역을 넓힐 수 있는 이점이 있다.Accordingly, the present invention provides an advantage of efficient use and design of the I / O port by reading the setting values of the plurality of switches SW1-SW24 using only three pins of the I / O port, and also provides an address space in the memory. Since there is no allocation, there is an advantage that the utilization area of the address space can be expanded.

Claims (2)

컴퓨터시스템이나 프린터시스템의 마이크로컴퓨터(100)를 이용한 스위치 세팅을 읽어들이는 장치에 있어서, 시스템의 작동모드를 선택하기 위한 다수의 스위치(SW1-SW24)와, 시스템을 제어하기 위한 클럭펄스와 로오드 및 쉬프트신호를 각각 발생하여 상기 스위치(SW1-SW24)들의 세팅값을 1비트씩 순차적으로 읽어들이는 마이크로컴퓨터(100)와, 상기 로오드 및 쉬프트신호와 클럭펄스열을 입력하여 상기 로오드 및 쉬프트신호에 의해 상기다수의 스위치(SW1-SW24)의 세팅값을 로도드한후 쉬프트모드로 전환하고 상기 클럭펄스열에 의해 로오드된 세팅값을 한비트씩 쉬프트하므로서 스위치(SW1-SW24)의 세팅값을 1개씩 마이크로컴퓨터(100)로 출력하는 종속접속된 다수의 제 1-3 레지스터회로(210-203)로 구성됨을 특징으로 하는 회로.A device for reading switch settings using a microcomputer (100) of a computer system or a printer system, comprising: a plurality of switches (SW1-SW24) for selecting an operation mode of the system, clock pulses and a row for controlling the system A microcomputer 100 which sequentially generates the load and shift signals and sequentially reads the setting values of the switches SW1 to SW24 by 1 bit, and inputs the rod and shift signals and a clock pulse sequence to the rod and Setting values of the switches SW1-SW24 by shifting the setting values of the plurality of switches SW1-SW24 by the shift signal and then shifting to the shift mode and shifting the set values loaded by the clock pulse sequence by one bit. Circuit comprising a plurality of cascaded first to third register circuits (210-203) for outputting one to the microcomputer (100) one by one. 작동모드를 선택하기 위한 다수의 스위치(SW1-SW24)와, 시스템을 제어하기위해 클럭펄스와 로오드 및 쉬프트신호를 발생하여 상기 다수스위치(SW1-SW24)의 세팅값을 읽어들이는 마이크로컴퓨터(100)와, 상기 로오드 및 쉬프트신호와 클럭신호에 의해 상기 다수스위치(SW1-SW24)의 세팅값을 저장하고 한비트씩 쉬프트하여 출력하는 다수의 제 1-3 레지스터회로(201-203)를 구비한 컴퓨터시스템이나 프린터시스템의 스위치 세팅을 읽어들이는 방법에 있어서, 상기 마이크로컴퓨터(100)에서 로오드신호를 발생하여 제 1-3 레지스터회로(210-203)으로 하여금 다수의 스위치(SW1-SW24)의 세팅값을 다수의 각 비트별로 저장하는 제 1 단계와, 상기 마이크로컴퓨터(100)는 다시 쉬프트신호를 발생하여 제 1-3 레지스터회로(201-203)들을 쉬프트모드로 전환시킴과 동시에 자체내의 카운터를 다수의 스위치(SW1-SW24)의 수량과 같게 계수하는 제 2 단계과, 상기 마이크로콤퓨터(100)가 쉬프트 신호를 발생하여 다수의 제1-3레지스터회로(201-203)의 다수의 각비트에 저장된 다수의 스위치(SW1-SW24)의 세팅 값을 1비트만큼 쉬프트시켜 1비트씩 순차적으로 읽어들여 자체내의 비퍼에 저장함과 동시에 카운터의 계수를 "1"씩 감산하여 카운팅의 계수가 "0"이 될때까지 상기과정을 반복하는 제 3 단계와, 상기 제 3 단계에서 카운터의 계수가 "0"로 될때 상기 스위치(SW1-SW24)들의 세팅값을 리드동작을 종료하는 제 4 단계로 구성됨을 특징으로 하는 방법.A plurality of switches (SW1-SW24) for selecting an operation mode, and a microcomputer for generating clock pulses, load and shift signals to read the setting values of the plurality of switches (SW1-SW24) to control the system ( 100 and a plurality of first to third register circuits 201 to 203 for storing the setting values of the plurality of switches SW1 to SW24 and shifting the output bit by bit according to the low and shift signals and the clock signal. In a method of reading a switch setting of a computer system or a printer system, the microcomputer 100 generates a low signal to cause the first to third register circuits 210 to 203 to generate a plurality of switches (SW1-SW24). In the first step of storing the setting value of each of the plurality of bits, the microcomputer 100 generates a shift signal again to switch the first to third register circuits 201-203 to the shift mode, and County The second step of counting the same as the number of the plurality of switches (SW1-SW24), and the microcomputer 100 generates a shift signal to a plurality of bits of each of the plurality of 1-3 register circuits (201-203) By shifting the setting values of the plurality of switches (SW1-SW24) stored by 1 bit and reading them sequentially one bit at a time, they are stored in the beeper and the counter count is decremented by "1". And a fourth step of repeating the above process until the step is completed, and a fourth step of terminating the read operation of the setting values of the switches SW1-SW24 when the counter count becomes "0" in the third step. How to.
KR1019870011395A 1987-10-14 1987-10-14 Apparatus and method for reading switch settings in micom KR900002629B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019870011395A KR900002629B1 (en) 1987-10-14 1987-10-14 Apparatus and method for reading switch settings in micom

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019870011395A KR900002629B1 (en) 1987-10-14 1987-10-14 Apparatus and method for reading switch settings in micom

Publications (2)

Publication Number Publication Date
KR890007167A KR890007167A (en) 1989-06-19
KR900002629B1 true KR900002629B1 (en) 1990-04-21

Family

ID=19265167

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019870011395A KR900002629B1 (en) 1987-10-14 1987-10-14 Apparatus and method for reading switch settings in micom

Country Status (1)

Country Link
KR (1) KR900002629B1 (en)

Also Published As

Publication number Publication date
KR890007167A (en) 1989-06-19

Similar Documents

Publication Publication Date Title
US5111079A (en) Power reduction circuit for programmable logic device
US6614259B2 (en) Configuration memory integrated circuit
US6066961A (en) Individually accessible macrocell
US5455923A (en) Memory system for loading peripherals on power up
US5726584A (en) Virtual high density programmable integrated circuit having addressable shared memory cells
US10971237B2 (en) Semiconductor device
US5349670A (en) Integrated circuit programmable sequencing element apparatus
JPH0668732B2 (en) Sukiyan method for information processing equipment
KR960042749A (en) Programmable binary / interleaved sequence counters
US6839783B2 (en) Programmable state machine interface
KR900002629B1 (en) Apparatus and method for reading switch settings in micom
JP2578144B2 (en) Parallel data port selection method and device
EP0254479A2 (en) Integrated circuit programmable sequencing element apparatus and associated method
KR100207511B1 (en) Method for setting up test mode in semiconductor chip
US5850509A (en) Circuitry for propagating test mode signals associated with a memory array
JPS59112334A (en) Sequence generator
KR0121940B1 (en) Circuit for outputting two-output data of the boundary-scan
KR100186320B1 (en) Dual mode counter
JP2546920B2 (en) Integrated circuit
KR200148658Y1 (en) A circuit selecting input/output card of plc
KR0164128B1 (en) Multi-waiting state for low speed peripheral equipment
KR900002433B1 (en) Circuit of the beginning of a period of automatic of liquid crystal controller
JP3117984B2 (en) Semiconductor nonvolatile memory device
KR950010565B1 (en) Video ram with block selection function
JP3281898B2 (en) Memory mounted semiconductor device and memory test method

Legal Events

Date Code Title Description
A201 Request for examination
G160 Decision to publish patent application
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20030328

Year of fee payment: 14

LAPS Lapse due to unpaid annual fee