WO2014023247A1 - 嵌入式设备和基于该设备进行数据通信的控制方法 - Google Patents

嵌入式设备和基于该设备进行数据通信的控制方法 Download PDF

Info

Publication number
WO2014023247A1
WO2014023247A1 PCT/CN2013/081080 CN2013081080W WO2014023247A1 WO 2014023247 A1 WO2014023247 A1 WO 2014023247A1 CN 2013081080 W CN2013081080 W CN 2013081080W WO 2014023247 A1 WO2014023247 A1 WO 2014023247A1
Authority
WO
WIPO (PCT)
Prior art keywords
control
output
input
pin
bus
Prior art date
Application number
PCT/CN2013/081080
Other languages
English (en)
French (fr)
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 中兴通讯股份有限公司
Publication of WO2014023247A1 publication Critical patent/WO2014023247A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity

Definitions

  • the present invention relates to the field of communications, and in particular to an embedded device and a control method for data communication based on the device.
  • BACKGROUND At present, a number of Subscriber Identity Modules (SIMs) card hardware and software modules are added to embedded devices such as home gateways to implement authentication of operators on home gateway devices, as well as voice, video, and The storage of key data such as Quality of Service (QoS) enables operators to manage home gateway devices.
  • SIMs Subscriber Identity Modules
  • QoS Quality of Service
  • Universal Asynchronous Receiver/Transmitter Universal Asynchronous Receiver/Transmitter, referred to as
  • UART is a general-purpose serial data bus used primarily for asynchronous communication.
  • the bus has a two-way communication function that enables full-duplex data transmission and reception.
  • the UART is typically used to communicate with a personal computer (PC), primarily for communication with a monitoring debugger or other device (eg, EEPROM).
  • PC personal computer
  • EEPROM eg. EEPROM
  • the SIM card is a "smart card" conforming to the IS07816 specification.
  • the SIM card contains a microprocessor chip. It has five internal modules: microprocessor CPU, program memory ROM, working memory RAM, data memory EEPROM and Serial communication unit, each module corresponds to one of its own functions. These five modules are glued to the SIM card copper interface and are packaged in the same way as ordinary IC cards.
  • the SIM card conforms to the IS07816-2 specification and has 8 electrical contacts.
  • the ICC is located in the standard position of the SIM card. Some of the contacts are connected to the microprocessor chip embedded in the SIM card. Other contacts are not currently used, and will be used for future expansion. .
  • the UART uses an asynchronous full-duplex mode with two data buses for input and output, while the SIM card is asynchronous half-duplex mode, and the input and output are single-bus. Therefore, it is difficult to implement data interaction between the UART and the SIM card. In response to the above problems, no effective solution has been proposed yet.
  • the present invention provides an embedded device and a control method for data communication based on the device, so as to at least solve the prior art, since the UART has two data buses of input and output, and the SIM card input and output are single bus. The technical problem caused by the way of data interaction between the UART and the SIM card is difficult to implement.
  • an embedded device including: a CPU, a SIM card control chip, and a SIM card
  • the CPU includes: a universal asynchronous receiver and a transmitter UART module and a control pin, wherein The input bus and the output bus of the UART module are connected to the input/output bus of the SIM card through the input/output control port on the SIM card control chip; the control pin is connected to the input/output control port of the SIM card control chip, and is set to And outputting a control signal, wherein the control signal is used to control an on/off state between the input/output bus and an input bus and/or an output bus of the URAT module.
  • the control pin includes a first pin and a second pin, wherein the first pin is configured to output a first control signal, wherein the first control signal is used to input the output bus and the The on/off state between the input buses of the URAT is controlled; the second pin is configured to output a second control signal, wherein the second control signal is used between the input/output bus and the output bus of the URAT The on-off state is controlled.
  • a first enable control logic device is connected between the first pin and the input/output control interface, wherein an output end of the first enable control logic device is connected to the input bus, An input end of an enable control logic device is coupled to the input/output control interface, and an enable control terminal of the first enable control logic device is coupled to the first pin.
  • a second enable control logic device is connected between the second pin and the input/output control interface, wherein an input end of the second enable control logic device is connected to the output bus, The output end of the second enable control logic device is connected to the input/output control interface, and the enable control end of the second enable control logic device is connected to the second pin.
  • the device further includes: a software control module configured to control a level signal output by the first pin and the second pin, wherein the level signal output by the first pin is the first The control signal, the level signal output by the second pin is the second control signal.
  • the input/output bus of the SIM card is connected to the input bus of the URAT, and the input and output of the SIM card The bus is disconnected from the output bus of the above URAT.
  • the input/output bus of the SIM card is connected to the output bus of the URAT, and the input and output of the SIM card The bus is disconnected from the input bus of the above URAT.
  • the above SIM card control chip is an ST8024 chip.
  • a control method for data communication based on the above embedded device including: determining a required data transmission direction between a current UART module and a SIM card; according to the determined data transmission direction Control signals output from the above control pins are controlled.
  • controlling the control signal output by the control pin according to the determined data transmission direction comprises: controlling the first pin to output a low level signal when determining that the UART module needs to read data from the SIM card, The second pin outputs a high level signal to enable the input/output bus of the SIM card to be connected to the input bus of the URAT; and/or to control the first when the UART module needs to output data to the SIM card.
  • the pin outputs a high level signal, and the second pin outputs a low level signal to realize that the input/output bus of the SIM card is connected to the output bus of the URAT.
  • a control pin is added to the CPU, and a control signal is sent through the added pin to realize switching of the input bus and the output bus of the UART module and the input/output bus of the SIM card during data transmission, thereby solving the present problem.
  • the UART since the UART has two data buses of input and output, and the SIM card input and output are in a single bus manner, it is difficult to realize the technical interaction between the UART and the SIM card, and the additional problem is achieved.
  • the technical effect of effective interaction of data between the UART and the SIM card in the case of a chip.
  • FIG. 1 is a schematic diagram of a preferred structure of an embedded device according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of another preferred structure of an embedded device according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a preferred connection of each module of the embedded device according to an embodiment of the present invention
  • FIG. 5 is a preferred schematic diagram of a data frame format of a UART according to an embodiment of the present invention
  • FIG. 6 is a preferred schematic diagram of a data frame format of a SIM card.
  • the input bus S2 and the output bus S3 of the UART module are respectively connected to the input/output bus S5 of the SIM card through the input/output control port S4 on the SIM card control chip; the control pin S1 is connected to the input/output control port S4 of the SIM card control chip. And set as an output control signal, wherein the control signal is used to control an on-off state between the input/output bus S5 and the input bus S2 and/or the output bus S3 of the URAT module.
  • a control pin is added to the CPU, and a control signal is sent through the added pin to implement switching between the input bus and the output bus of the UART module and the input/output bus of the SIM card during data transmission.
  • the basic hardware configuration of the embedded device includes: a CPU (internal integrated UART hardware module and GPIO pin), a SIM card control chip, and a SIM card, wherein the CPU uses two GPIOs as control pins.
  • the invention solves the data interaction problem between the UART asynchronous double bus communication mode and the SIM synchronous single bus communication mode in the prior art, and the GPIO of the CPU is used as a control pin to realize the data path between the UART and the SIM card, thereby The technical effect of realizing the application of the SIM card by effectively utilizing the resources of the embedded CPU.
  • two control pins can be provided, one for controlling the input and one for controlling the output.
  • the control pin includes the first pin and a second pin, wherein the first pin is configured to output a first control signal, wherein the first control signal is used for The on/off state between the input bus and the input bus of the URAT is controlled; the second pin is configured to output a second control signal, wherein the second control signal is used between the input and output bus and the output bus of the URAT
  • the on-off state is controlled.
  • the on-off state can be controlled by a simple logic device for enabling control. As shown in FIG. 2, a first connection is made between the first pin S1-1 and the input/output control interface S4.
  • the control logic device 202 wherein the output end of the first enable control logic device 202 is connected to the input bus S2, and the input end of the first enable control logic device 202 is connected to the input/output control interface S4, the first The enable control terminal (ENB) of the controllable logic device is connected to the first pin S1-1.
  • a second enable control logic device 204 is connected between the second pin S1-2 and the input/output control interface, wherein the input end of the second enable control logic device 204 is connected to the output bus S3, and the second The output of the controllable logic device 204 is coupled to the input and output control interface S4, and the enable control terminal (ENB) of the second enable control logic device 204 is coupled to the second pin S1-2.
  • the embedded device further includes: a software control module configured to control a level signal output by the first pin and the second pin, wherein the level signal output by the first pin It is the first control signal, and the level signal output by the second pin is the second control signal.
  • the high and low levels can be used as control signals for control.
  • the following methods can be used to control the continuity of the line, for example:
  • the input and output bus of the SIM card is connected to the input bus of the URAT, and the input and output bus of the SIM card and the output bus of the URAT disconnect.
  • the embodiment of the present invention further provides a data communication control method. As shown in FIG. 3, the foregoing method includes the following steps: Step S302: Determine the required data transmission direction between the current UART module and the SIM card. Step S304: Control the control signal outputted by the control pin according to the determined data transmission direction.
  • the embedded device determines the data transmission direction between the UART module and the SIM card according to the software to transmit and receive data, and correspondingly determines the control signal of the control pin to implement the UART module of the CPU to send and receive the dual data bus and the SIM.
  • the switching of the single data bus is turned on.
  • the control signal outputted by the control pin according to the determined data transmission direction may be mainly controlled by the level, thereby determining the on-off between the lines according to the data transmission direction.
  • one of the following two conditions may be included:
  • the first pin When it is determined that the UART module needs to read data from the SIM card, the first pin outputs a low level signal, and the second pin outputs a high level signal to implement the input and output bus of the SIM card and the input bus of the URAT. through.
  • the first pin When it is determined that the UART module needs to output data to the SIM card, the first pin outputs a high level signal, and the second pin outputs a low level signal, so that the input and output bus of the SIM card is connected to the output bus of the URAT. .
  • the communication scheme and data processing method between the UART and the SIM card will be described in detail below in conjunction with specific embodiments.
  • the UART input and output dual bus and SIM card are realized by using the UART hardware module of the embedded CPU to output the level signal of the GPIO pin of the CPU.
  • the switching between the I/O single bus is performed to realize the function of reading and writing and information saving of the SIM card, thereby minimizing the product cost on the basis of ensuring the requirement of the product card separation function by the operator.
  • the hardware mode of the technical solution adopted in this implementation can be implemented as follows: For example, the ST8024 chip is used as an interaction between the control chip of the SIM card and the SIM card, wherein the ST8024 chip is an asynchronous 3V or 5V smart card. With a low-cost analog interface, the ST8024 is connected between the embedded CPU and the SIM card, requiring only a few external components for protection and control.
  • the management functions of the SIM card of ST8024 mainly include: providing external clock, management of input and output of serial data, voltage output of 3V or 5V, dynamic detection of SIM card insertion and removal, and activation of SIM card.
  • the embedded CPU controls the SIM through the GPIO to connect to the ST8024.
  • the functions of the GPIO mainly include:
  • GPIO_SIM_INT Detects the signal input from the SIM card to the GPIO pin.
  • GPIO_SIM_RST Controls the sending of an activation signal to the SIM card.
  • GPIO SIM CMD Controls the voltage applied to the SIM card. Since the UART is an asynchronous full-duplex mode, it has two buses, input and output. However, the SIM card is an asynchronous half-duplex mode, and the input and output use a single bus mode to solve the data interaction problem between the UART dual data line and the SIM card single data line. In the embodiment of the present invention, two GPIO pins are added to solve the above problem. As shown in FIG. 4, the BCM6828 is used as the CPU, and the ST8024 is used as the SIM card control chip, wherein the GPIO is the SIM input and output control described above. Port, /GPIO_RC in the figure is the above first pin, /GPIO_WC is the above second pin, UART1_RXD represents the above input bus, and UART1_TXD represents the above output bus.
  • SIM_RD_ENABLE ie, the first pin above, when the pin outputs a low level signal, the UART input bus is connected to the ST8024 I/OUC pin, thus interacting with the SIM I/O The bus (ie, the input/output bus of the SIM card above) is turned on.
  • SIM_WR_ENABLE ie, the second pin above, when the pin outputs a low level signal, the UART output bus is connected to the ST8024 I/OUC pin, thus interacting with the SIM I/O The bus is connected.
  • the data communication between the SIM card and the SIM card can be implemented by using the original UART driver of the LINUX platform based on the LINUX platform.
  • the implementation of the software part mainly includes the following steps:
  • S 1 Control two GPIO pins, SIM_RD_ENABLE and SIM_WR_ENABLE. Specifically, when the UART needs to read the data of the SIM card, SIM_RD_ENABLE outputs a low level, and SIM_WR_ENABLE outputs a high level. At this time, the UART input bus turns on the I/O bus of the SIM card. When the UART needs to output data to the SIM card, SIM_RD_ENABLE outputs a high level and SIM_WR_ENABLE outputs a low level. At this point, the UART output bus turns on the I/O bus of the SIM card.
  • the SIM card can be activated, read or written in accordance with the IS07816-4 specification. Specifically, when performing operations such as card activation, read operation, and write operation on the SIM card, the data frame format of the UART may be first configured to ensure the consistency of the data frame of the UART and the SIM card communication.
  • the UART data frame is shown in Figure 5.
  • the SIM card data frame is shown in Figure 6.
  • the UART data frame can be configured in the following format: 8 bit data bits, 1 even parity bit (Parity Bit), 2 stop bits,
  • the above configuration of the data frame ensures that the UART data frame format can meet the requirements of the SIM card.
  • Step SI The output of the GPIO SIM CMD changes from a high level to a low level, and the ST8024 starts to supply power to the SIM card VCC contact.
  • the voltage can be selected to be 3V, so GPIO_SIM_3/5V outputs a low level.
  • Step S2 The GPIO SIM RST output is low.
  • the SIM card read operation can include the following steps: Step SI: SIM_RD_ENABLE outputs a low level, and the SIM card I/O bus is connected to the UART input bus. Step S2: The SIM_WR_ENABLE output is high, and the SIM card I/O bus is disconnected from the UART output bus. Step S3: Receive data from the serial port above the UART, and parse the received data according to the IS07816-4 specification.
  • the SIM card write operation may include the following steps: Step SI: SIM_WR_ENABLE outputs a low level, and the SIM card I/O bus is connected to the UART output bus. Step S2: SIM_RD_ENABLE outputs a high level to ensure that the SIM card I/O bus is disconnected from the UART input bus. Step S3: Encapsulate and operate the transmission data according to the IS07816-4 specification, and send the data to the UART serial port.
  • software is also provided for performing the technical solutions described in the above embodiments and preferred embodiments.
  • a storage medium is provided, the software being stored, including but not limited to: an optical disk, a floppy disk, a hard disk, a rewritable memory, and the like.
  • a control pin is added to the CPU, and a control signal is sent through the added pin to implement an input bus and an output bus and a SIM card to the UART module.
  • the switching of the input/output bus during data transmission solves the problem in the prior art that the UART has two input and output data buses, and the SIM card input and output are in a single bus manner, which is difficult to implement between the UART and the SIM card.
  • the technical problem of data interaction achieves the technical effect of realizing effective interaction of data between the UART and the SIM card without adding additional chips.
  • modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.

Abstract

本发明公开了一种嵌入式设备和基于该设备进行数据通信的控制方法,其中,该嵌入式设备包括:CPU、SIM卡控制芯片和SIM卡,其中,CPU包括:UART模块和控制管脚;控制管脚,与SIM卡控制芯片的输入输出端口相连,设置为输出控制信号,其中,控制信号用于对输入输出总线与URAT模块的输入总线和/或输出总线之间的通断状态进行控制。本发明的CPU通过两个GPIO作为控制管脚,通过控制管脚高低电平的输出,以实现CPU的UART模块收发双数据总线和SIM单数据总线的切换接通,达到了有效利用嵌入式CPU的资源实现SIM卡的应用的技术效果。

Description

嵌入式设备和基于该设备进行数据通信的控制方法 技术领域 本发明涉及通信领域, 具体而言, 涉及一种嵌入式设备和基于该设备进行数据通 信的控制方法。 背景技术 目前, 很多家庭网关等嵌入式设备中都增加了客户识别模块 (Subscriber Identity Module, 简称为 SIM) 卡硬件和软件模块, 以实现家庭网关设备上对运行商的认证, 以及语音、 视频和服务质量(Quality of Service, 简称为 QoS)等关键数据的保存, 从 而实现运营商对家庭网关设备的管理。 通用异步接收器和发送器 (Universal Asynchronous Receiver/Transmitter, 简称为
UART) 是一种通用串行数据总线, 主要用于异步通信。 该总线具有双向通信的功能, 可以实现全双工的数据传输和接收。 在嵌入式设计中, UART—般是用来与个人电脑 (Personal Computer,简称为 PC)进行通信,主要用于与监控调试器或者其它器件(例 如, EEPROM) 进行通信。 SIM卡是一张符合 IS07816规范的 "智慧卡", SIM卡内部装有微处理器的芯片, 它的内部有 5个模块: 微处理器 CPU、 程序存储器 ROM、 工作存储器 RAM、 数据存 储器 EEPROM和串行通信单元,每个模块都对应自己的一个功能。这 5个模块被胶封 在 SIM卡铜制接口后与普通 IC卡封装方式相同。 SIM卡外形符合 IS07816-2规范, 具有 8电器触点 ICC位于 SIM卡的标准位置, 其中一些触点与嵌在 SIM卡的微处理 器芯片相连, 另一些触点目前没有应用, 作为未来扩展使用。 然而, UART采用的是异步全双工模式, 具有输入、 输出两根数据总线, 而 SIM 卡是异步半双工模式,输入和输出是采用单总线的方式。因此,难以实现 UART与 SIM 卡之间的数据交互。 针对上述的问题, 目前尚未提出有效的解决方案。 发明内容 本发明提供了一种嵌入式设备和基于该设备进行数据通信的控制方法, 以至少解 决现有技术中由于 UART具有输入和输出两根数据总线而 SIM卡输入和输出是采用单 总线的方式而造成的难以实现 UART与 SIM卡之间的数据交互的技术问题。 根据本发明的一个方面, 提供了一种嵌入式设备, 包括: CPU、 SIM卡控制芯片 和 SIM卡, 其中, 上述 CPU包括: 通用异步接收器和发送器 UART模块和控制管脚, 其中,上述 UART模块的输入总线和输出总线通过上述 SIM卡控制芯片上的输入输出 控制端口与上述 SIM卡的输入输出总线连接; 上述控制管脚,与上述 SIM卡控制芯片 的输入输出控制端口相连, 设置为输出控制信号, 其中, 上述控制信号用于对上述输 入输出总线与上述 URAT模块的输入总线和 /或输出总线之间的通断状态进行控制。 优选地, 上述控制管脚包括第一管脚和第二管脚, 其中, 上述第一管脚, 设置为 输出第一控制信号, 其中, 上述第一控制信号用于对上述输入输出总线与上述 URAT 的输入总线之间的通断状态进行控制; 上述第二管脚, 设置为输出第二控制信号, 其 中, 上述第二控制信号用于对上述输入输出总线与上述 URAT的输出总线之间的通断 状态进行控制。 优选地, 在上述第一管脚与上述输入输出控制接口之间连接有第一使能控制的逻 辑器件, 其中, 上述第一使能控制的逻辑器件的输出端与上述输入总线相连, 上述第 一使能控制的逻辑器件的输入端与上述输入输出控制接口相连, 上述第一使能控制的 逻辑器件的使能控制端与上述第一管脚相连。 优选地, 在上述第二管脚与上述输入输出控制接口之间连接有第二使能控制的逻 辑器件, 其中, 上述第二使能控制的逻辑器件的输入端与上述输出总线相连, 上述第 二使能控制的逻辑器件的输出端与上述输入输出控制接口相连, 上述第二使能控制的 逻辑器件的使能控制端与上述第二管脚相连。 优选地, 上述设备还包括: 软件控制模块, 设置为对上述第一管脚和上述第二管 脚输出的电平信号进行控制, 其中, 上述第一管脚输出的电平信号是上述第一控制信 号, 上述第二管脚输出的电平信号是上述第二控制信号。 优选地, 当上述第一管脚输出低电平信号, 且上述第二管脚输出高电平信号时, 上述 SIM卡的输入输出总线与上述 URAT的输入总线接通, 上述 SIM卡的输入输出 总线与上述 URAT的输出总线断开。 优选地, 当上述第一管脚输出高电平信号, 且上述第二管脚输出低电平信号时, 上述 SIM卡的输入输出总线与上述 URAT的输出总线接通, 上述 SIM卡的输入输出 总线与上述 URAT的输入总线断开。 优选地, 上述 SIM卡控制芯片为 ST8024芯片。 根据本发明的另一方面, 提供了一种基于上述的嵌入式设备进行数据通信的控制 方法, 包括: 判断当前 UART模块与 SIM卡之间所需的数据传输方向; 根据确定的上 述数据传输方向对上述控制管脚输出的控制信号进行控制。 优选地, 根据确定的上述数据传输方向对上述控制管脚输出的控制信号进行控制 包括: 当确定上述 UART模块需要从上述 SIM卡读取数据时, 控制上述第一管脚输出 低电平信号, 上述第二管脚输出高电平信号, 以实现上述 SIM卡的输入输出总线与上 述 URAT的输入总线接通; 和 /或当确定上述 UART模块需要向上述 SIM卡输出数据 时, 控制上述第一管脚输出高电平信号, 上述第二管脚输出低电平信号, 以实现上述 SIM卡的输入输出总线与上述 URAT的输出总线接通。 在本发明中, 在 CPU上增加了控制管脚, 通过增加的管脚发送控制信号以实现对 UART模块的输入总线和输出总线与 SIM卡的输入输出总线在数据传输时的切换, 解 决了现有技术中由于 UART具有输入和输出两根数据总线而 SIM卡输入和输出是采用 单总线的方式而造成的难以实现 UART与 SIM卡之间的数据交互的技术问题,达到了 在不增加额外的芯片的情况下实现 UART与 SIM卡之间的数据的有效交互的技术效 果。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部分, 本发 明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的不当限定。 在附图 中- 图 1是根据本发明实施例的嵌入式设备的一种优选结构示意图; 图 2是根据本发明实施例的嵌入式设备的另一种优选结构示意图; 图 3是根据本发明实施例的基于上述嵌入式设备进行数据通信的控制方法的一种 优选流程图; 图 4是根据本发明实施例的嵌入式设备的各个模块的一种优选的连接示意图; 图 5是根据本发明实施例的 UART的数据帧格式的一种优选示意图; 图 6是 SIM卡的数据帧格式的一种优选示意图。 具体实施方式 下文中将参考附图并结合实施例来详细说明本发明。 需要说明的是, 在不冲突的 情况下, 本申请中的实施例及实施例中的特征可以相互组合。 如图 1所示, 本发明实施例提供了一种优选的嵌入式设备, 包括: CPU102、 SIM 卡控制芯片 104和 SIM卡 106, 其中, CPU102包括: UART模块和控制管脚 Sl, 其 中,
UART模块的输入总线 S2和输出总线 S3通过 SIM卡控制芯片上的输入输出控制 端口 S4分别与 SIM卡的输入输出总线 S5连接; 控制管脚 Sl, 与 SIM卡控制芯片的输入输出控制端口 S4相连, 设置为输出控制 信号,其中,控制信号用于对输入输出总线 S5与 URAT模块的输入总线 S2和 /或输出 总线 S3之间的通断状态进行控制。 在上述优选实施方式中, 在 CPU上增加了控制管脚, 通过增加的管脚发送控制信 号以实现对 UART模块的输入总线和输出总线与 SIM卡的输入输出总线在数据传输时 的切换,解决了现有技术中由于 UART具有输入和输出两根数据总线而 SIM卡输入和 输出是采用单总线的方式而造成的难以实现 UART与 SIM卡之间的数据交互的技术问 题,达到了在不增加额外的芯片的情况下实现 UART与 SIM卡之间的数据的有效交互 的技术效果。 即, 在本发明实施例中, 嵌入式设备基本硬件配置包括: CPU (内部集成 UART 硬件模块和 GPIO管脚)、 SIM卡控制芯片以及 SIM卡,其中, 该 CPU通过两个 GPIO 作为控制管脚, 通过控制管脚高低电平的输出, 以实现 CPU的 UART模块收发双数 据总线和 SIM单数据总线的切换接通。本发明解决了现有技术中 UART异步双总线通 信方式和 SIM同步单总线通信方式之间的数据交互问题,通过 CPU的 GPIO作为控制 管脚, 以实现 UART和 SIM卡之间的数据通路, 从而达到有效利用嵌入式 CPU的资 源实现 SIM卡的应用的技术效果。 为了更好地对切换进行控制, 可以设置两个控制管脚, 一个管脚用于对输入进行 控制一个用于对输出进行控制, 在一个优选实施方式中, 控制管脚包括第一管脚和第 二管脚, 其中, 第一管脚, 设置为输出第一控制信号, 其中, 第一控制信号用于对输 入输出总线与 URAT的输入总线之间的通断状态进行控制; 第二管脚, 设置为输出第 二控制信号, 其中, 第二控制信号用于对输入输出总线与 URAT的输出总线之间的通 断状态进行控制。 在对通断状态进行控制的时候, 可以采用简单的使能控制的逻辑器件进行控制, 如图 2所示, 在第一管脚 S1-1与输入输出控制接口 S4之间连接有第一使能控制的逻 辑器件 202, 其中, 第一使能控制的逻辑器件 202的输出端与输入总线 S2相连, 第一 使能控制的逻辑器件 202的输入端与输入输出控制接口 S4相连,第一使能控制的逻辑 器件的使能控制端 (ENB) 与第一管脚 S1-1相连。 在第二管脚 S1-2与输入输出控制接口之间连接有第二使能控制的逻辑器件 204, 其中,第二使能控制的逻辑器件 204的输入端与输出总线 S3相连,第二使能控制的逻 辑器件 204的输出端与输入输出控制接口 S4相连,第二使能控制的逻辑器件 204的使 能控制端 (ENB) 与第二管脚 S1-2相连。 即, 通过对该第一和第二使能控制的逻辑器件的控制实现对 SIM卡的输入输出总 线与 URAT的输出总线和输入总线之间的切换。 当该使能控制的逻辑器件的使能端处 于工作状态时, 该线路就处于导通状态, 当使能端处于非工作状态时, 该线路就属于 断开状态, 从而实现两者之间简单有效的切换。 在一个优选实施方式中, 上述嵌入式设备中还包括: 软件控制模块, 设置为对第 一管脚和第二管脚输出的电平信号进行控制, 其中, 第一管脚输出的电平信号是第一 控制信号, 第二管脚输出的电平信号是第二控制信号。 可以采用高低电平作为控制信号进行控制, 优选地, 可以采用以下方式来控制线 路的通断, 例如:
1 )当第一管脚输出低电平信号, 且第二管脚输出高电平信号时, SIM卡的输入输 出总线与 URAT的输入总线接通, SIM卡的输入输出总线与 URAT的输出总线断开。
2)当第一管脚输出高电平信号, 且第二管脚输出低电平信号时, SIM卡的输入输 出总线与 URAT的输出总线接通, SIM卡的输入输出总线与 URAT的输入总线断开。 在上述各个优选实施方式中, SIM卡控制芯片可以选择 ST8024芯片。 基于上述的嵌入式设备, 本发明实施例还提供了一种数据通信的控制方法, 如图 3所示, 上述方法包括以下步骤: 步骤 S302: 判断当前 UART模块与 SIM卡之间所需数据传输方向。 步骤 S304: 根据确定的数据传输方向对控制管脚输出的控制信号进行控制。 即, 该嵌入式设备根据软件发送、接收数据的需要, 并确定 UART模块和 SIM卡 之间数据传输方向, 以对应确定控制管脚的控制信号, 以实现 CPU的 UART模块收 发双数据总线和 SIM单数据总线的切换接通。 在上述步骤 S304中,根据确定的数据传输方向对控制管脚输出的控制信号进行控 制主要可以是对电平的控制, 从而实现按照数据传输方向来确定线路之间的通断。 优 选地, 可以包括以下两种情况之一:
1 )当确定 UART模块需要从 SIM卡读取数据时, 控制第一管脚输出低电平信号, 第二管脚输出高电平信号, 以实现 SIM卡的输入输出总线与 URAT的输入总线接通。
2)当确定 UART模块需要向 SIM卡输出数据时, 控制第一管脚输出高电平信号, 第二管脚输出低电平信号, 以实现 SIM卡的输入输出总线与 URAT的输出总线接通。 下面将结合具体的实施方式对 UART和 SIM卡之间的通信方案和数据处理方法进 行详细说明。 在本发明实施例中, 在家庭网关等嵌入式设备上, 利用嵌入式 CPU已有的 UART 硬件模块, 通过 CPU的 GPIO引脚的电平信号的输出, 实现 UART输入、输出双总线 与 SIM卡 I/O单总线之间通断的切换, 以此实现对 SIM卡的读写和信息保存功能, 从 而在保证运用商对产品机卡分离功能要求的基础上, 实现产品成本的最小化。 在本实 施方式中, 不需要增加额外的控制芯片对两者之间的切换进行控制, 因此, 较少了产 品的成本。 本实施所采用的技术方案的硬件方式可以按照以下方式实现: 例如, 采用 ST8024芯片作为对 SIM卡的控制芯片与 SIM卡之间进行交互, 其中 上述的 ST8024芯片是一个针对异步 3V或者 5V智能卡的完善的低成本的模拟接口, ST8024连接在嵌入式 CPU和 SIM卡之间, 只需要很少的外部部件来实现保护和控制 功能。 ST8024对 SIM卡的管理功能主要包括: 提供外部时钟、 对串行数据的输入和 输出的管理、 3V或者 5V的电压输出、 对 SIM卡插拔的动态检测以及实现对 SIM卡 的激活操作。 嵌入式 CPU通过 GPIO连接 ST8024以对 SIM进行控制, 其中 GPIO的功能主要 包括:
1 ) GPIO SIM 3/5V: 控制 SIM卡输出 3/5V电压输入。
2) GPIO_SIM_INT: 检测 SIM卡拔插的信号输入到该 GPIO引脚。 3 ) GPIO_SIM_RST: 控制对 SIM卡发送激活信号。
4) GPIO SIM CMD: 控制对 SIM卡加载电压。 鉴于 UART是异步全双工模式, 具有输入、 输出两根总线。 然而, SIM卡是异步 半双工模式, 输入和输出使用单总线方式, 为了解决 UART双数据线和 SIM卡单数据 线之间的数据交互问题。 在本发明实施例中采用增加两个 GPIO引脚的方式来解决上 述问题, 如图 4所示, 是采用 BCM6828作为 CPU, 以 ST8024作为 SIM卡控制芯片, 其中, GPIO即上述的 SIM输入输出控制端口, 图中的 /GPIO_RC即上述的第一管脚, /GPIO_WC即上述的第二管脚, UART1_RXD代表上述的输入总线, UART1_TXD代 表上述的输出总线。
1 ) SIM_RD_ENABLE (/GPIO RC), 即, 上文的第一管脚, 当该管脚输出低电平 信号时, UART输入总线与 ST8024 I/OUC管脚接通, 从而与 SIM的 I/O总线 (即, 上文的 SIM卡的输入输出总线) 接通。
2) SIM_WR_ENABLE (/GPIO WC), 即, 上文的第二管脚, 当该管脚输出低电 平信号时, UART输出总线与 ST8024 I/OUC管脚接通, 从而与 SIM的 I/O总线接通。 在软件控制方面,优选地,可以基于 LINUX平台,利用 LINUX平台原有的 UART 驱动实现和 SIM卡之间的数据通信, 其中, 软件部分的实现主要包括以下步骤:
S 1: 控制 SIM_RD_ENABLE和 SIM_WR_ENABLE两个 GPIO引脚。 具体的, 当 UART需要读取 SIM卡的数据时, SIM_RD_ENABLE输出低电平, SIM_WR_ENABLE输出高电平。 此时, UART输入总线接通 SIM卡的 I/O总线。 当 UART 需要输出数据到 SIM 卡时, SIM_RD_ENABLE 输出高电平, SIM_WR_ENABLE输出低电平。 此时 UART输出总线接通 SIM卡的 I/O总线。 优选地, 可以按照 IS07816-4规范来激活、 读或者写 SIM卡。 具体的, 在对 SIM卡进行诸如卡激活、 读操作以及写操作等操作时, 可以先配置 UART的数据帧格式, 从而保证 UART和 SIM卡通信数据帧的一致性。
UART数据帧如图 5所示, SIM卡数据帧如图 6所示, 可以配置 UART数据帧为 以下格式: 8 bit数据位、 1个偶校验位 (Parity Bit)、 2个停止位, 通过上述对数据帧 的配置保证了 UART数据帧格式可以符合 SIM卡的要求。 在对 SIM卡进行读写操作之前, 还需要对卡进行激活操作, 具体包括以下步骤: 步骤 SI : GPIO SIM CMD的输出由高电平转变为低电平, ST8024开始对 SIM卡 VCC触点供电, 优选地, 可以将电压选择为 3V, 因此 GPIO_SIM_3/5V输出低电平。 步骤 S2: GPIO SIM RST输出低电平。 步骤 S3: GPIO_SIM_RST输出高电平, SIM卡会回复 ATR (Answer to reset) 数 据报报文, 完成 SIM卡的激活。
SIM卡的读操作可以包括以下步骤: 步骤 SI : SIM_RD_ENABLE输出低电平, SIM卡 I/O总线与 UART输入总线接 通。 步骤 S2: SIM_WR_ENABLE输出高电平, SIM卡 I/O总线与 UART输出总线断 开。 步骤 S3: 从 UART上文串口接收数据, 对接收到的数据按照 IS07816-4规范进行 解析。
SIM卡的写操作可以包括以下步骤: 步骤 SI : SIM_WR_ENABLE输出低电平, SIM卡 I/O总线与 UART输出总线接 通。 步骤 S2: SIM_RD_ENABLE输出高电平, 确保 SIM卡 I/O总线与 UART输入总 线断开。 步骤 S3: 按照 IS07816-4规范对发送数据进行封装和操作, 发送数据给 UART串 Π。 在另外一个实施例中, 还提供了一种软件, 该软件用于执行上述实施例及优选实 施方式中描述的技术方案。 在另外一个实施例中, 还提供了一种存储介质, 该存储介质中存储有上述软件, 该存储介质包括但不限于: 光盘、 软盘、 硬盘、 可擦写存储器等。 从以上的描述中, 可以看出, 本发明实现了如下技术效果: 在 CPU上增加了控制 管脚, 通过增加的管脚发送控制信号以实现对 UART 模块的输入总线和输出总线与 SIM卡的输入输出总线在数据传输时的切换, 解决了现有技术中由于 UART具有输入 和输出两根数据总线而 SIM 卡输入和输出是采用单总线的方式而造成的难以实现 UART与 SIM卡之间的数据交互的技术问题, 达到了在不增加额外的芯片的情况下实 现 UART与 SIM卡之间的数据的有效交互的技术效果。 显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可以用通用 的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布在多个计算装置所 组成的网络上, 可选地, 它们可以用计算装置可执行的程序代码来实现, 从而, 可以 将它们存储在存储装置中由计算装置来执行, 并且在某些情况下, 可以以不同于此处 的顺序执行所示出或描述的步骤, 或者将它们分别制作成各个集成电路模块, 或者将 它们中的多个模块或步骤制作成单个集成电路模块来实现。 这样, 本发明不限制于任 何特定的硬件和软件结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本领域的技 术人员来说, 本发明可以有各种更改和变化。 凡在本发明的精神和原则之内, 所作的 任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。

Claims

权 利 要 求 书
1. 一种嵌入式设备, 包括: CPU、 SIM卡控制芯片和 SIM卡, 其中, 所述 CPU 包括: 通用异步接收器和发送器 UART模块和控制管脚, 其中,
所述 UART模块的输入总线和输出总线通过所述 SIM卡控制芯片上的输入 输出控制端口与所述 SIM卡的输入输出总线连接;
所述控制管脚, 与所述 SIM卡控制芯片的输入输出控制端口相连, 设置为 输出控制信号, 其中, 所述控制信号用于对所述输入输出总线与所述 URAT模 块的输入总线和 /或输出总线之间的通断状态进行控制。
2. 根据权利要求 1所述的设备, 其中, 所述控制管脚包括第一管脚和第二管脚, 其中,
所述第一管脚, 设置为输出第一控制信号, 其中, 所述第一控制信号用于 对所述输入输出总线与所述 URAT的输入总线之间的通断状态进行控制; 所述第二管脚, 设置为输出第二控制信号, 其中, 所述第二控制信号用于 对所述输入输出总线与所述 URAT的输出总线之间的通断状态进行控制。
3. 根据权利要求 2所述的设备, 其中, 在所述第一管脚与所述输入输出控制接口 之间连接有第一使能控制的逻辑器件, 其中, 所述第一使能控制的逻辑器件的 输出端与所述输入总线相连, 所述第一使能控制的逻辑器件的输入端与所述输 入输出控制接口相连, 所述第一使能控制的逻辑器件的使能控制端与所述第一 管脚相连。
4. 根据权利要求 2所述的设备, 其中, 在所述第二管脚与所述输入输出控制接口 之间连接有第二使能控制的逻辑器件, 其中, 所述第二使能控制的逻辑器件的 输入端与所述输出总线相连, 所述第二使能控制的逻辑器件的输出端与所述输 入输出控制接口相连, 所述第二使能控制的逻辑器件的使能控制端与所述第二 管脚相连。
5. 根据权利要求 2至 4中任一项所述的设备, 其中, 还包括: 软件控制模块, 设 置为对所述第一管脚和所述第二管脚输出的电平信号进行控制, 其中, 所述第 一管脚输出的电平信号是所述第一控制信号, 所述第二管脚输出的电平信号是 所述第二控制信号。 根据权利要求 5所述的设备, 其中, 当所述第一管脚输出低电平信号, 且所述 第二管脚输出高电平信号时,所述 SIM卡的输入输出总线与所述 URAT的输入 总线接通, 所述 SIM卡的输入输出总线与所述 URAT的输出总线断开。 根据权利要求 5所述的设备, 其中, 当所述第一管脚输出高电平信号, 且所述 第二管脚输出低电平信号时,所述 SIM卡的输入输出总线与所述 URAT的输出 总线接通, 所述 SIM卡的输入输出总线与所述 URAT的输入总线断开。 根据权利要求 1所述的设备, 其中, 所述 SIM卡控制芯片为 ST8024芯片。 一种基于权利要求 1至 8中任一项的嵌入式设备进行数据通信的控制方法, 包 括- 判断当前 UART模块与 SIM卡之间所需的数据传输方向;
根据确定的所述数据传输方向对所述控制管脚输出的控制信号进行控制。 根据权利要求 9所述的方法, 其特征在于, 根据确定的所述数据传输方向对所 述控制管脚输出的控制信号进行控制包括:
当确定所述 UART模块需要从所述 SIM卡读取数据时,控制所述第一管脚 输出低电平信号, 所述第二管脚输出高电平信号, 以实现所述 SIM卡的输入输 出总线与所述 URAT的输入总线接通; 和 /或
当确定所述 UART模块需要向所述 SIM卡输出数据时,控制所述第一管脚 输出高电平信号, 所述第二管脚输出低电平信号, 以实现所述 SIM卡的输入输 出总线与所述 URAT的输出总线接通。
PCT/CN2013/081080 2012-08-10 2013-08-08 嵌入式设备和基于该设备进行数据通信的控制方法 WO2014023247A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210284672.0A CN103581157A (zh) 2012-08-10 2012-08-10 嵌入式设备和基于该设备进行数据通信的控制方法
CN201210284672.0 2012-08-10

Publications (1)

Publication Number Publication Date
WO2014023247A1 true WO2014023247A1 (zh) 2014-02-13

Family

ID=50052092

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/081080 WO2014023247A1 (zh) 2012-08-10 2013-08-08 嵌入式设备和基于该设备进行数据通信的控制方法

Country Status (2)

Country Link
CN (1) CN103581157A (zh)
WO (1) WO2014023247A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104811530A (zh) * 2015-03-02 2015-07-29 西安酷派软件科技有限公司 多系统的通信终端
WO2017049317A1 (en) * 2015-09-18 2017-03-23 Able Device, Inc. Secure data link for subscriber identification module (sim)-based processor
CN111796841A (zh) * 2020-05-20 2020-10-20 哈船光电(武汉)有限公司 一种双路arm远程更新的硬件实现系统及方法
WO2022116074A1 (zh) * 2020-12-03 2022-06-09 黄策 具有双数据总线的sim卡

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108875881A (zh) * 2017-05-11 2018-11-23 展讯通信(上海)有限公司 Sim卡供电控制方法、装置及移动终端
CN109347791B (zh) * 2018-09-02 2021-04-20 黄策 双i/o总线sim卡

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1429462A (zh) * 2000-02-04 2003-07-09 高通股份有限公司 调制解调器与用户接口模块间的接口
CN1770132A (zh) * 2004-10-26 2006-05-10 大唐移动通信设备有限公司 处理器与用户识别卡之间的连接装置
US20060208066A1 (en) * 2003-11-17 2006-09-21 Dpd Patent Trust RFID token with multiple interface controller

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101610470A (zh) * 2009-04-16 2009-12-23 成都众山科技有限公司 一种嵌入式gprs网络无线数据传输终端

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1429462A (zh) * 2000-02-04 2003-07-09 高通股份有限公司 调制解调器与用户接口模块间的接口
US20060208066A1 (en) * 2003-11-17 2006-09-21 Dpd Patent Trust RFID token with multiple interface controller
CN1770132A (zh) * 2004-10-26 2006-05-10 大唐移动通信设备有限公司 处理器与用户识别卡之间的连接装置

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104811530A (zh) * 2015-03-02 2015-07-29 西安酷派软件科技有限公司 多系统的通信终端
WO2017049317A1 (en) * 2015-09-18 2017-03-23 Able Device, Inc. Secure data link for subscriber identification module (sim)-based processor
US10306463B2 (en) 2015-09-18 2019-05-28 Able Device, Inc. Secure data link for subscriber identification module (SIM)-based processor
CN111796841A (zh) * 2020-05-20 2020-10-20 哈船光电(武汉)有限公司 一种双路arm远程更新的硬件实现系统及方法
CN111796841B (zh) * 2020-05-20 2023-10-10 哈船光电(武汉)有限公司 一种双路arm远程更新的硬件实现系统及方法
WO2022116074A1 (zh) * 2020-12-03 2022-06-09 黄策 具有双数据总线的sim卡

Also Published As

Publication number Publication date
CN103581157A (zh) 2014-02-12

Similar Documents

Publication Publication Date Title
KR100972072B1 (ko) 엔에프씨 호스트 콘트롤러 인터페이스
EP1615135B1 (en) Sharing single host controller with multiple functional devices
US8176230B2 (en) Wireless flash memory card expansion system
WO2014023247A1 (zh) 嵌入式设备和基于该设备进行数据通信的控制方法
US9104816B2 (en) Memory card having plurality of interface ports, memory card system, and data communication method for the memory card
EP2566288B1 (en) Wireless internet access module, communication method for host and wireless internet access module
US8840031B2 (en) Smart card and a method for operating a smart card
JP3599048B2 (ja) データ転送制御システム、電子機器、プログラム及びデータ転送制御方法
US20090106472A1 (en) Virtual SATA port multiplier, virtual SATA device, SATA system and data transfer method in a SATA system
US7281246B1 (en) Method for loading user interface software
JP3655597B2 (ja) 電子機器、電子カード、及びカード識別方法
WO2013007189A1 (zh) 数据处理及存储装置
US20210286743A1 (en) Memory system and information processing system
JP5600740B2 (ja) 応答装置とその集積回路、応答方法、および応答システム
CN117319097A (zh) Pci-e外置系统、会话协商方法及会话协商装置
WO2011134384A1 (zh) 一种无线上网设备、系统及方法
JP2003303058A (ja) 小型カード用pcアダプタ

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13828632

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13828632

Country of ref document: EP

Kind code of ref document: A1