TWI648638B - Multi-microcontroller system, internet of things gateway system, and control flow of multi-microcontroller system based on network bridge - Google Patents

Multi-microcontroller system, internet of things gateway system, and control flow of multi-microcontroller system based on network bridge Download PDF

Info

Publication number
TWI648638B
TWI648638B TW106100815A TW106100815A TWI648638B TW I648638 B TWI648638 B TW I648638B TW 106100815 A TW106100815 A TW 106100815A TW 106100815 A TW106100815 A TW 106100815A TW I648638 B TWI648638 B TW I648638B
Authority
TW
Taiwan
Prior art keywords
microcontroller
bridge
slave
communication unit
interface
Prior art date
Application number
TW106100815A
Other languages
Chinese (zh)
Other versions
TW201826139A (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 TW106100815A priority Critical patent/TWI648638B/en
Publication of TW201826139A publication Critical patent/TW201826139A/en
Application granted granted Critical
Publication of TWI648638B publication Critical patent/TWI648638B/en

Links

Landscapes

  • Small-Scale Networks (AREA)

Abstract

一種多微控制器系統、物聯網閘道系統、以及基於橋接器的多微控制器系統之控制方法,其中,多微控制器系統,其包含一主控微控制器與複數個從屬微控制器;其中,主控微控制器係透過一橋接器分別與多個從屬微控制器連接;該橋接器以一第一記憶體界面與一第一SPI界面組成一第一通訊部,多個第一通訊部分別與主控微控制器和等從屬微控制器連接;橋接器主要負責處理主控微控制器和多個從屬微控制器之間控制訊號與資料的傳遞,以及作為共同記憶體的暫存區,藉以自動化管理多個從屬微控制器狀態、指定從屬微控制器地址以及分配記憶體區塊。 A multi-microcontroller system, an internet of things gateway system, and a control method of a bridge-based multi-microcontroller system, wherein the multi-microcontroller system includes a master microcontroller and a plurality of slave microcontrollers The master microcontroller is respectively connected to the plurality of slave microcontrollers through a bridge; the bridge comprises a first memory interface and a first SPI interface to form a first communication part, the plurality of first The communication department is respectively connected with the master microcontroller and the slave microprocessors; the bridge is mainly responsible for handling the transmission of control signals and data between the master microcontroller and the plurality of slave microcontrollers, and as a common memory. The memory area is used to automatically manage multiple slave microcontroller states, specify slave microcontroller addresses, and allocate memory blocks.

Description

多微控制器系統、物聯網閘道系統、以及基於橋接器的多微控制器系統之 控制方法 Multi-microcontroller system, IoT gateway system, and bridge-based multi-microcontroller system Control Method

一種多微控制器系統、物聯網閘道系統、以及雲端連網控制系統之控制方法,尤其涉及一種具有分散式處理的多個微控制器所組成的模組。 The invention relates to a multi-micro controller system, an internet of things gateway system, and a control method of a cloud networked control system, in particular to a module composed of a plurality of micro-controllers with distributed processing.

工業正邁入一個全新的物聯網(Internet of Things,IoT)時代,人與物件、物件與物件之間透過聯網的技術,進行傳遞、接收、處理,提供各樣的控制、偵測識別和服務,這樣的架構創造出一個擁有無限可能大型離散網路。數十億具備嵌入式技術的設備可被管理、無縫互聯、借助網路安全地進行互動。 The industry is entering a new era of Internet of Things (IoT). People, objects, objects and objects are transmitted, received, processed, and provided with various control, detection, and service. This architecture creates a large discrete network with unlimited possibilities. Billions of devices with embedded technology can be managed, seamlessly interconnected, and securely interacted with the Internet.

而在工業物聯網(IIoT)中,描述了機器到機器(M2M)的通訊,也就是機器可以與其他機器、物件、環境和基礎設施等進行互動和通訊。通訊的結果產生大量資料,這些資料經過處理和分析之後,可以為管理和控制提供極具意義的、即時的決策。 In the Industrial Internet of Things (IIoT), machine-to-machine (M2M) communication is described, that is, machines can interact and communicate with other machines, objects, environments, and infrastructure. The results of the communication generate a large amount of information that, after processing and analysis, provides meaningful, immediate decisions for management and control.

在小型、低功耗的物聯網應用架構中,使用微控制器(Microcontroller)作為傳統閘道器的核心,因此微控制器成為推動機器到機器(M2M)通信發展的核心技術。它將CPU、程式記憶體、資料記憶體、Timer/Counter、DI/DO/AI/AO等週邊,整合在一顆晶片上的微型電腦之中。 體積小、功耗低、輸入輸出介面簡單、開發快速,且在沒有作業系統的情況下可靠性高,這些特色使得微控制器適合應用在開發物聯網閘道器中。 In the small, low-power IoT application architecture, the microcontroller is used as the core of the traditional gateway, so the microcontroller is the core technology to promote the development of machine-to-machine (M2M) communication. It integrates the CPU, program memory, data memory, Timer/Counter, DI/DO/AI/AO and other peripherals into a microcomputer on a single chip. Small size, low power consumption, simple input and output interface, fast development, and high reliability in the absence of operating systems make these microcontrollers suitable for use in developing IoT gateways.

傳統物聯網閘道器使用單一微控制器結合周邊的方式來進行開發,單一微控制器結合周邊的方式來進行開發,但因微控制器是針對應用而設計的元件,在市場的需求上,須根據個別應用來設計不同的組合元件。製造商無法以一個單架構來滿足廣大的市場,必須提供不同核心數目、傳輸介面、I/O腳位個數與功能的微控制器。當一個物聯網閘道器無法滿足需求處理器運算速度過慢,或是硬體週邊個數過少等問題時,開發者必須根據應用重新設計微控制器的軟硬體架構,或更換更高階的處理器來面對不同應用情境。 Traditional IoT gateways use a single microcontroller to combine peripheral approaches for development. A single microcontroller is developed in conjunction with the surrounding approach, but because the microcontroller is a component designed for the application, in terms of market demand, Different combination components must be designed according to individual applications. Manufacturers can't satisfy the vast market with a single architecture. Microcontrollers with different core counts, transmission interfaces, I/O pin counts and functions must be provided. When an IoT gateway cannot meet the requirements of slow processor operation or too few hardware peripherals, developers must redesign the hardware and software architecture of the microcontroller according to the application, or replace the higher-order The processor faces different application scenarios.

因此,如何提出一種在大量資料傳輸的情況下,其仍具有較佳的傳輸速度、穩定性以及功能性的微控制器系統以及物聯網閘道控制系統,乃為業界亟欲改善與努力的方向所在。 Therefore, how to propose a microcontroller system and an IoT gateway control system with better transmission speed, stability and functionality in the case of mass data transmission is the direction of the industry's desire to improve and work hard. Where.

有鑒於此,本發明即在提供一種多微控制器系統,其包含一主控微控制器與複數個從屬微控制器;其中,主控微控制器係透過一橋接器分別與多個從屬微控制器連接;該橋接器以一第一記憶體介面與一第一SPI介面組成一第一通訊部,多個第一通訊部分別與主控微控制器和等從屬微控制器連接;橋接器主要負責處理主控微控制器和多個從屬微控制器之間控制訊號與資料的傳遞,以及作為共同記憶體的暫存區,藉以自動化管理多個從屬微控制器狀態、指定從屬微控制器地址以及分配記憶體區塊。 In view of the above, the present invention provides a multi-microcontroller system including a master microcontroller and a plurality of slave microcontrollers; wherein the master microcontroller is respectively connected to a plurality of slave micros through a bridge a controller is connected; the bridge forms a first communication part with a first SPI interface and a first SPI interface, and the plurality of first communication parts are respectively connected with the main control microcontroller and the slave microcontroller; the bridge Mainly responsible for handling the transmission of control signals and data between the master microcontroller and multiple slave microcontrollers, and as a temporary storage area for the common memory, to automatically manage the status of multiple slave microcontrollers, specify slave microcontrollers Address and allocation memory block.

所述之多微控制器系統,其中,橋接器係可為一場效可程式 邏輯閘陣列(Field Programmable Gate Array,簡稱FPGA)或一特殊應用積體電路(Application-specific integrated circuit,簡稱ASIC)所組成。 The multi-controller system, wherein the bridge system can be a utility program A Field Programmable Gate Array (FPGA) or an Application-specific Integrated Circuit (ASIC).

所述之多微控制器系統,其中,主控微控制器以一第二通訊部與第一通訊部連接,第二通訊部包含一第二記憶體介面與第二SPI介面。 The multi-controller system, wherein the main control unit is connected to the first communication unit by a second communication unit, and the second communication unit comprises a second memory interface and a second SPI interface.

所述之多微控制器系統,其中,多個從屬微控制器係以一第三通訊部與第一通訊部連接,第三通訊部包含一第三記憶體介面與第三SPI介面。 The multi-controller system, wherein the plurality of slave microcontrollers are connected to the first communication unit by a third communication unit, and the third communication unit comprises a third memory interface and a third SPI interface.

所述之多微控制器系統,其中,所述之第一記憶體介面、第二記憶體介面以及第三記憶體介面係做為資料通訊介面之用;第一SPI介面、第二SPI介面以及第三SPI介面係做為狀態控制介面之用。 The multi-controller system, wherein the first memory interface, the second memory interface, and the third memory interface are used as a data communication interface; the first SPI interface, the second SPI interface, and The third SPI interface is used as a state control interface.

所述之多微控制器系統,其中,該橋接器進一步包含一主控制器,該主控制器負責解析主控微控制器傳入之指令,以及主控微控制器與多個從屬微控制器之間的資料搬移。 The multi-controller system, wherein the bridge further includes a main controller, the main controller is responsible for resolving instructions transmitted by the main control microcontroller, and the main control microcontroller and the plurality of slave microcontrollers The data is moved between.

所述之多微控制器系統,其中,主控制器係由一微程式控制單元(microprogram control unit)、資料運算單元(datapath unit)、和功能指令單元(function unit)所構成。 The multi-controller system, wherein the main controller is composed of a microprogram control unit, a data path unit, and a function unit.

此外,本發明再提出一種物聯網閘道系統,其包含一主控微控制器、一橋接器以及多個從屬微控制器;主控微控制器與橋接器設置於一主控裝置內,多個從屬微控制器各自設置於多個電子裝置內;橋接器以一第一記憶體介面與一第一SPI介面組成一第一通訊部;主控微控制器以一第二通訊部與該第一通訊部連接,第二通訊部包含一第二記憶體介面與第二SPI介面;多個從屬微控制器係以一第三通訊部與第一通訊部連接,第三 通訊部包含一第三記憶體介面與第三SPI介面;據此,該主控裝置係透過該橋接器管理該多個電子裝置。 In addition, the present invention further provides an Internet of Things gateway system, comprising a main control microcontroller, a bridge and a plurality of slave microcontrollers; the main control microcontroller and the bridge are disposed in a main control device, Each of the slave microcontrollers is disposed in a plurality of electronic devices; the bridge forms a first communication portion with a first memory interface and a first SPI interface; the master control unit has a second communication portion and the first a communication unit is connected, the second communication unit includes a second memory interface and a second SPI interface; and the plurality of slave microcontrollers are connected to the first communication unit by a third communication unit, and the third The communication unit includes a third memory interface and a third SPI interface; accordingly, the master device manages the plurality of electronic devices through the bridge.

所述之物聯網閘道系統,其中,橋接器藉由第一通訊部分別與第二通訊部、第三通訊部相連結,處理主控微控制器和多個從屬微控制器之間控制訊號與資料的傳遞,以及作為共同記憶體的暫存區,藉以自動化管理多個從屬微控制器狀態、指定從屬微控制器地址以及分配記憶體區塊。 In the Internet of Things gateway system, the bridge is connected to the second communication unit and the third communication unit by the first communication unit, and processes the control signal between the main control microcontroller and the plurality of slave microcontrollers. The transfer of data and the temporary storage area as a common memory to automatically manage multiple slave microcontroller states, specify slave microcontroller addresses, and allocate memory blocks.

所述之物聯網閘道系統,其中,第一通訊部、第二通訊部以及第三通訊部之間控制訊號與資料的傳遞,係透過ZigBee、行動通訊2G、3G、4G、Bluetooth、USB、CAN、VPN、Wi-Fi或MQTT協定所完成。 The Internet of Things gateway system, wherein the control signal and data transmission between the first communication unit, the second communication unit, and the third communication unit are transmitted through ZigBee, mobile communication 2G, 3G, 4G, Bluetooth, USB, Completed by CAN, VPN, Wi-Fi or MQTT agreements.

所述之物聯網閘道系統,其中,橋接器進一步包含一主控制器,負責解析主控微控制器傳入之指令,以及主控微控制器與多個從屬微控制器之間的資料搬移。 The Internet of Things gateway system, wherein the bridge further comprises a main controller, which is responsible for resolving instructions transmitted by the main control microcontroller, and data transfer between the main control microcontroller and the plurality of subordinate microcontrollers .

所述之物聯網閘道系統,其中,該主控制器係由一微程式控制單元(microprogram control unit)、資料運算單元(datapath unit)、和功能指令單元(function unit)所構成。 The Internet of Things gateway system, wherein the main controller is composed of a microprogram control unit, a data path unit, and a function unit.

所述之物聯網閘道系統,其中,多個電子裝置係由一攝影機、一感測器、一致動器、一DI/DO、或一可程式邏輯控制器(PLC)、或人機互動介面(HMI)之單一種或混合所組成。 The Internet of Things gateway system, wherein the plurality of electronic devices are a camera, a sensor, an actuator, a DI/DO, or a programmable logic controller (PLC), or a human-machine interaction interface. (HMI) consists of a single or a mixture.

此外,本發明再提出一種基於橋接器的多微控制器系統之控制方法,此多微控制器系統包括一主控微控制器與複數個從屬微控制器;其中,主控微控制器係透過一橋接器分別與多個從屬微控制器連接;其控 制方法包含以下步驟:步驟1:令主控微控制器、該橋接器以及多個從屬微控制器初始化;步驟2:使橋接器對主控微控制器與從屬微控制器發出一詢問訊號,並賦予主控微控制器與從屬微控制器一ID與地址;步驟3:令從屬微控制器的個數回傳至主控微控制器,接著橋接器判斷該主控微控制器是否有發送擷取資料的指令,若有則進入步驟4,若沒有則回到步驟1;步驟4:令橋接器解析主控微控制器所傳送的指令,包括從屬微控制器中的指定ID與控制指令;步驟5:對指定的從屬微控制器ID執行前述之控制指令;步驟6:接收從屬微控制器回傳的數值,接收完畢後,回到步驟1。 In addition, the present invention further provides a control method of a bridge-based multi-microcontroller system including a master microcontroller and a plurality of slave microcontrollers; wherein the master microcontroller transmits a bridge is respectively connected to a plurality of slave microcontrollers; The method includes the following steps: Step 1: Initialize the master microcontroller, the bridge, and the plurality of slave microcontrollers; Step 2: cause the bridge to send an inquiry signal to the master microcontroller and the slave microcontroller, And give the master microcontroller and the slave microcontroller an ID and address; Step 3: Return the number of slave microcontrollers to the master microcontroller, and then the bridge determines whether the master microcontroller has sent The instruction to retrieve the data, if yes, proceeds to step 4, if not, returns to step 1; step 4: causes the bridge to parse the instructions transmitted by the master microcontroller, including the specified ID and control instructions in the slave microcontroller Step 5: Execute the aforementioned control command for the specified slave microcontroller ID; Step 6: Receive the value returned by the slave microcontroller, and return to step 1 after the reception is completed.

所述之基於橋接器的多微控制器系統之控制方法,其中,主控微控制器、橋接器以及多個從屬微控制器之間,係使用一記憶體介面做為資料通訊介面之用,以及使用一SPI介面做為狀態控制介面之用。 The method for controlling a bridge-based multi-microcontroller system, wherein a master interface between a master microcontroller, a bridge, and a plurality of slave microcontrollers is used as a data communication interface. And use an SPI interface as a state control interface.

1‧‧‧多微控制器系統 1‧‧‧Multi-controller system

10‧‧‧物聯網閘道系統 10‧‧‧Internet of Things Gateway System

11‧‧‧主控微控制器 11‧‧‧Master Microcontroller

13‧‧‧從屬微控制器 13‧‧‧Subordinate Microcontroller

12‧‧‧橋接器 12‧‧‧ Bridge

121‧‧‧第一記憶體介面 121‧‧‧First memory interface

122‧‧‧第一SPI介面 122‧‧‧First SPI interface

120‧‧‧第一通訊部 120‧‧‧ First Ministry of Communications

110‧‧‧第二通訊部 110‧‧‧Second Ministry of Communications

111‧‧‧第二記憶體介面 111‧‧‧Second memory interface

112‧‧‧第二SPI介面 112‧‧‧Second SPI interface

130‧‧‧第三通訊部 130‧‧‧ Third Ministry of Communications

131‧‧‧第三記憶體介面 131‧‧‧ third memory interface

132‧‧‧第三SPI介面 132‧‧‧ Third SPI interface

123‧‧‧主控制器 123‧‧‧Master controller

1231‧‧‧微程式控制單元 1231‧‧‧Microprogram Control Unit

1232‧‧‧資料運算單元 1232‧‧‧Data unit

1233‧‧‧功能指令單元 1233‧‧‧Function command unit

101‧‧‧主控裝置 101‧‧‧Master control unit

103‧‧‧電子裝置 103‧‧‧Electronic devices

S1、S2、S3、S4、S5、S6‧‧‧步驟 S1, S2, S3, S4, S5, S6‧‧ steps

第1圖為本發明所提出之一種多微控制器系統之示意圖。 Figure 1 is a schematic diagram of a multi-microcontroller system proposed by the present invention.

第2圖為本發明所提出之一種物聯網閘道系統之示意圖。 Figure 2 is a schematic diagram of an Internet of Things gateway system proposed by the present invention.

第3圖為本發明所提出之一種基於橋接器的多微控制器系統之控制方法示意圖。 FIG. 3 is a schematic diagram of a control method of a bridge-based multi-micro controller system according to the present invention.

由於本發明係揭露一種多微控制器系統、物聯網閘道系統、以及基於橋接器的多微控制器系統之控制方法,其中,所使用之通訊協定以及無線連結等相關基礎原理已為相關技術領域具有通常知識者所能明瞭,故以下文中之說明,不再作完整描述。同時,以下文中所對照之圖式,係表達與本發明特徵有關之結構示意,並未亦不需要依據實際尺寸完整繪製,盍先敘明。 Since the present invention discloses a multi-microcontroller system, an Internet of Things gateway system, and a control method of a bridge-based multi-microcontroller system, the related basic principles of communication protocols and wireless links used are related technologies. The field is known to those of ordinary skill and will not be fully described in the following description. At the same time, the drawings referred to in the following texts express the structural schematics related to the features of the present invention, and need not be completely drawn according to the actual size, which is first described.

請參考第1圖,係本發明提出其包含一主控微控制器11與複數個從屬微控制器13;其中,主控微控制器11係透過一橋接器12分別與多個從屬微控制器13連接;橋接器12以一第一記憶體介面121與一第一SPI介面122組成一第一通訊部120,複數個第一通訊部120分別與主控微控制器11和多個從屬微控制器13連接;橋接器12主要負責處理主控微控制器11和多個從屬微控制器13之間控制訊號與資料的傳遞,以及作為共同記憶體的暫存區,藉以自動化管理多個從屬微控制器13狀態、指定多個從屬微控制器13地址以及分配記憶體區塊。 Referring to FIG. 1, the present invention proposes to include a master microcontroller 11 and a plurality of slave microcontrollers 13; wherein the master microcontroller 11 is connected to a plurality of slave microcontrollers through a bridge 12, respectively. 13 is connected; the bridge 12 forms a first communication unit 120 with a first memory interface 121 and a first SPI interface 122, and the plurality of first communication units 120 respectively and the master microcontroller 11 and the plurality of slave micro-controls The router 13 is connected; the bridge 12 is mainly responsible for processing the transmission of control signals and data between the master microcontroller 11 and the plurality of slave microcontrollers 13 and as a temporary storage area of the common memory, thereby automatically managing multiple dependent micros The controller 13 states, specifies a plurality of slave microcontroller 13 addresses, and allocates memory blocks.

在一較佳實施例中,橋接器12係可為一場效可程式邏輯閘陣列(Field Programmable Gate Array,簡稱FPGA)或一特殊應用積體電路(Application-specific integrated circuit,簡稱ASIC)。 In a preferred embodiment, the bridge 12 can be a Field Programmable Gate Array (FPGA) or an Application-specific Integrated Circuit (ASIC).

其中,主控微控制器11是以一第二通訊部110與橋接器12的第一通訊部120相連接,而此第二通訊部110包含一第二記憶體介面111與第二SPI介面112。 The second communication unit 110 is connected to the first communication unit 120 of the bridge 12, and the second communication unit 110 includes a second memory interface 111 and a second SPI interface 112. .

而多個從屬微控制器13則是以一第三通訊部130與橋接器12的第一通訊部120相連接,此第三通訊部130包含一第三記憶體介面131與第 三SPI介面132。 The plurality of slave microcontrollers 13 are connected to the first communication unit 120 of the bridge 12 by a third communication unit 130. The third communication unit 130 includes a third memory interface 131 and a third Three SPI interfaces 132.

其中,所述之第一記憶體介面121、該第二記憶體介面111以及該第三記憶體介面131係做為資料通訊介面之用;第一SPI介面122、第二SPI介面112以及該第三SPI介面132係做為狀態控制介面之用。 The first memory interface 121, the second memory interface 111, and the third memory interface 131 are used as a data communication interface; the first SPI interface 122, the second SPI interface 112, and the first The three SPI interface 132 is used as a state control interface.

在本實施例中,係設置兩個從屬微控制器13,因此,橋接器12便至少會設置有三組第一通訊部120,個別與主控微控制器11、從屬微控制器13相連接,其中,第一通訊部120、第二通訊部110以及第三通訊部130彼此之間控制訊號與資料的傳遞,係透過ZigBee、行動通訊2G、3G、4G、Bluetooth、USB、CAN、VPN、Wi-Fi或MQTT協定所完成。在此要特別說明的是,通訊方式與從屬微控制器12的數量並不以此為限,從屬微控制器13的數量可以隨著需求而增加,屆時只要對應增加橋接器12的第一通訊部120的數量即可。 In this embodiment, two slave microcontrollers 13 are provided. Therefore, the bridge 12 is provided with at least three sets of first communication units 120, which are individually connected to the master microcontroller 11 and the slave microcontroller 13. The first communication unit 120, the second communication unit 110, and the third communication unit 130 control the transmission of signals and data to each other through ZigBee, mobile communication 2G, 3G, 4G, Bluetooth, USB, CAN, VPN, and Wi. -Fi or MQTT agreement completed. It should be particularly noted that the communication mode and the number of slave microcontrollers 12 are not limited thereto, and the number of slave microcontrollers 13 may be increased as required, and then the first communication of the bridge 12 is increased correspondingly. The number of the parts 120 is sufficient.

此外,請繼續參考第1圖,在一較佳實施例中,橋接器12進一步還包含一主控制器123,此主控制器123負責解析主控微控制器11傳入之指令,以及主控微控制器11與多個從屬微控制器13之間的資料搬移。而主控制器123係由一微程式控制單元1231(microprogram control unit)、資料運算單元1232(datapath unit)、和功能指令單元1233(function unit)所構成。 In addition, please continue to refer to FIG. 1. In a preferred embodiment, the bridge 12 further includes a main controller 123, which is responsible for parsing the incoming commands of the main control microcontroller 11, and mastering Data transfer between the microcontroller 11 and the plurality of slave microcontrollers 13. The main controller 123 is composed of a microprogram control unit 1231, a data operation unit 1232 (datapath unit), and a function command unit 1233 (function unit).

透過本發明所提出之多微控制器系統1,係將多顆的微控制器,透過一橋接器12,整合成一個大型虛擬之微控制器模組1,在多顆的微控制器中以一顆作為主控微控制器11,其餘為從屬微控制器13。主控微控制器11係用來執行監控、管理所有的從屬微控制器13的狀態和資料擷取,並且具有能將所有從屬微控制器13中,包含其Timer/Counter、DI/DO/AI/AO 等周邊虛擬成一顆超大型微控制器。未來可以應用的領域非常廣泛,如工業控制、消費電子、健康醫療、居家應用以及車用電子等等。 Through the multi-microcontroller system 1 proposed by the present invention, a plurality of microcontrollers are integrated into a large virtual microcontroller module 1 through a bridge 12, and in a plurality of microcontrollers One is the master microcontroller 11, and the rest is the slave microcontroller 13. The master microcontroller 11 is used to perform monitoring, management of the status and data capture of all slave microcontrollers 13, and has the ability to include all of the slave microcontrollers 13, including its Timer/Counter, DI/DO/AI. /AO Wait around the virtual to become a very large microcontroller. The fields that can be applied in the future are very wide, such as industrial control, consumer electronics, health care, home applications, and automotive electronics.

請參考第2圖,本發明再提出一種物聯網閘道系統10,其包含一主控微控制器11、一橋接器12以及複數個從屬微控制器13;主控微控制器11與橋接器12係設置於一主控裝置101內,多個從屬微控制器13則是各自設置於多個電子裝置103內。橋接器12以一第一記憶體介面121與一第一SPI介面122組成一第一通訊部120;主控微控制器11係以一第二通訊部110與第一通訊部120連接,第二通訊部110包含一第二記憶體介面111與第二SPI介面112;多個從屬微控制器13係以一第三通訊部130與第一通訊部120相連接,第三通訊部130則是包含一第三記憶體介面131與第三SPI介面132;據此,主控裝置101係透過該橋接器12與多個從屬微控制器13相連通而可同時間管理多個電子裝置103。 Referring to FIG. 2, the present invention further provides an Internet of Things gateway system 10 including a master microcontroller 11, a bridge 12, and a plurality of slave microcontrollers 13; a master microcontroller 11 and a bridge The 12 series are disposed in a main control device 101, and the plurality of slave microcontrollers 13 are respectively disposed in the plurality of electronic devices 103. The bridge 12 is configured by a first memory interface 121 and a first SPI interface 122 to form a first communication unit 120. The main control unit 11 is connected to the first communication unit 120 by a second communication unit 110. The communication unit 110 includes a second memory interface 111 and a second SPI interface 112. The plurality of slave microcontrollers 13 are connected to the first communication unit 120 by a third communication unit 130, and the third communication unit 130 includes A third memory interface 131 and a third SPI interface 132; accordingly, the master device 101 communicates with the plurality of slave microcontrollers 13 through the bridge 12 to simultaneously manage the plurality of electronic devices 103.

其中,所述的橋接器12、主控微控制器11、以及多個從屬微控制器13之間的資料搬移,以及通訊方式,皆如前所述,在此不再贅述。而在此所指的電子裝置103可以是由一攝影機、一感測器、一致動器、一DI/DO、或一可程式邏輯控制器(PLC)之單一種或混合所組成。 The data transfer and the communication mode between the bridge 12, the master microcontroller 11, and the plurality of slave microcontrollers 13 are as described above, and are not described herein again. The electronic device 103 referred to herein may be composed of a single camera or a sensor, an actuator, a DI/DO, or a programmable logic controller (PLC).

請參考第3圖,為本發明提出之一種基於橋接器的多微控制器系統之控制方法,在此所指的多微控制器系統如前所述,在此則不再贅述,其控制方法包含以下步驟:步驟1(S1):令主控微控制器11、橋接器12以及多個從屬微控制器13初始化;步驟2(S2):橋接器12對主控微控制器11與多個從屬微控制 器13發出一詢問訊號,並賦予主控微控制器11與多個從屬微控制器13一ID編號與地址;步驟3(S3):令多個從屬微控制器13的個數回傳至主控微控制器11,接著,橋接器13判斷主控微控制器11是否有發送擷取資料的指令,若有,則進入步驟4(S4),若沒有則回到步驟1(S1);步驟4(S4):令橋接器13解析主控微控制器11所傳送的指令,指令包括從屬微控制器13中的指定ID與控制指令;步驟5(S5):對指定的屬微控制器13 ID執行前述之控制指令;步驟6(S6):接收從屬微控制器13回傳的數值,接收完畢後,回到步驟1。 Please refer to FIG. 3 , which is a control method of a bridge-based multi-micro controller system according to the present invention. The multi-micro controller system referred to herein is as described above, and will not be described herein again. The method includes the following steps: Step 1 (S1): Initialize the master microcontroller 11, the bridge 12 and the plurality of slave microcontrollers 13; Step 2 (S2): the bridge 12 pairs the master microcontroller 11 with multiple Subordinate micro control The device 13 sends an inquiry signal and gives the master microcontroller 11 and the plurality of slave microcontrollers 13 an ID number and address; step 3 (S3): returns the number of the plurality of slave microcontrollers 13 to the master Controlling the microcontroller 11, then, the bridge 13 determines whether the master microcontroller 11 has an instruction to send data, if yes, proceeds to step 4 (S4), and if not, returns to step 1 (S1); 4 (S4): Causes the bridge 13 to parse the instruction transmitted by the master microcontroller 11, the instruction including the designated ID and control instruction in the slave microcontroller 13; step 5 (S5): for the specified genus microcontroller 13 The ID executes the aforementioned control command; Step 6 (S6): Receives the value returned by the slave microcontroller 13, and after receiving, returns to step 1.

透過本發明之多微控制器系統1、物聯網閘道系統10以及基於前述橋接器的多微控制器系統之控制方法,藉由橋接器12使用兩種不同的通訊協定,資料傳輸與狀態控制可以同步進行,使運行效率更高。並且,可以進行節點個數的偵測,亦即偵測從屬微控制器的數量,並且偵測節點目前狀態以及節點ID編號的對應;同時,可以隨時在系統運作的過程中,監測是否有新的節點加入,或是否有遺失節點,據此達到插拔偵測。同時,當使用者欲控制某個從屬節點(從屬微控制器13)時,橋接器12會從主控微控制器端11接收指令,並且判別節點位址與更新節點最新的狀態,同時,橋接器12可以為每一個節點分配專屬的記憶體空間,讓節點可以自由地運用記憶體空間,增加未來周邊硬體的可擴充性。 Through the multi-microcontroller system 1, the Internet of Things gateway system 10 of the present invention, and the control method of the multi-microcontroller system based on the aforementioned bridge, the bridge 12 uses two different communication protocols, data transmission and state control. Can be synchronized to make the operation more efficient. Moreover, the number of nodes can be detected, that is, the number of slave microcontrollers is detected, and the current state of the node and the correspondence of the node ID numbers are detected. Meanwhile, it is possible to monitor whether there is a new system during the operation of the system. The node is added, or there is a missing node, and the plug detection is achieved accordingly. Meanwhile, when the user wants to control a slave node (slave microcontroller 13), the bridge 12 receives an instruction from the master microcontroller terminal 11 and discriminates the node address and the latest state of the update node, and simultaneously bridges The device 12 can allocate a dedicated memory space for each node, so that the node can freely use the memory space to increase the scalability of future peripheral hardware.

以上所述僅為本發明之較佳實施例,並非用以限定本發明之 申請專利權利;同時以上的描述,對於熟知本技術領域之專門人士應可明瞭及實施,因此其他未脫離本發明所揭示之精神下所完成的等效改變或修飾,均應包含在申請專利範圍中。 The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention. The patent application is hereby incorporated by reference in its entirety to the extent of the disclosure of the disclosure of in.

Claims (15)

一種多微控制器系統,其包含一主控微控制器與複數個從屬微控制器;其中,該主控微控制器係透過一橋接器分別與該等從屬微控制器連接;該橋接器以一第一記憶體介面與一第一SPI介面組成一第一通訊部,複數個該第一通訊部分別與該主控微控制器和該等從屬微控制器連接;該橋接器主要負責處理該主控微控制器和該等從屬微控制器之間控制訊號與資料的傳遞,以及作為共同記憶體的暫存區,藉以自動化管理該等從屬微控制器狀態、指定該等從屬微控制器地址以及分配記憶體區塊。 A multi-microcontroller system includes a master microcontroller and a plurality of slave microcontrollers; wherein the master microcontroller is respectively connected to the slave microcontrollers through a bridge; the bridge a first memory interface and a first SPI interface form a first communication portion, and the plurality of first communication portions are respectively connected to the master microcontroller and the slave microcontrollers; the bridge is mainly responsible for processing the Controlling the transmission of signals and data between the master microcontroller and the slave microcontrollers, and as a temporary storage area for the common memory, thereby automatically managing the status of the slave microcontrollers, specifying the slave microcontroller addresses And allocate memory blocks. 如請求項1所述之多微控制器系統,其中,該橋接器係可為一場效可程式邏輯閘陣列(Field Programmable Gate Array,簡稱FPGA)或一特殊應用積體電路(Application-specific integrated circuit,簡稱ASIC)所組成。 The multi-microcontroller system of claim 1, wherein the bridge is a Field Programmable Gate Array (FPGA) or an Application-specific integrated circuit. , referred to as ASIC). 如請求項2所述之多微控制器系統,其中,該主控微控制器以一第二通訊部與該第一通訊部連接,該第二通訊部包含一第二記憶體介面與第二SPI介面。 The multi-microcontroller system of claim 2, wherein the main control unit is connected to the first communication unit by a second communication unit, and the second communication unit comprises a second memory interface and a second SPI interface. 如請求項3所述之多微控制器系統,其中,該複數個從屬微控制器係以一第三通訊部與該第一通訊部連接,該第三通訊部包含一第三記憶體介面與第三SPI介面。 The multi-microcontroller system of claim 3, wherein the plurality of slave microcontrollers are connected to the first communication unit by a third communication unit, and the third communication unit includes a third memory interface and The third SPI interface. 如請求項4所述之多微控制器系統,其中,所述之該第一記憶體介面、該第二記憶體介面以及該第三記憶體介面係做為資料通訊介面之用;該第一SPI介面、該第二SPI介面以及該第三SPI介面係做為狀 態控制介面之用。 The multi-microcontroller system of claim 4, wherein the first memory interface, the second memory interface, and the third memory interface are used as a data communication interface; The SPI interface, the second SPI interface, and the third SPI interface are State control interface. 如請求項1所述之多微控制器系統,其中,該橋接器進一步包含一主控制器,該主控制器負責解析該主控微控制器傳入之指令,以及該主控微控制器與該等從屬微控制器之間的資料搬移。 The multi-microcontroller system of claim 1, wherein the bridge further comprises a main controller, the main controller is responsible for parsing an instruction sent by the main control microcontroller, and the main control microcontroller is Data movement between the slave microcontrollers. 如請求項6所述之多微控制器系統,其中,該主控制器係由一微程式控制單元(microprogram control unit)、資料運算單元(datapath unit)、和功能指令單元(function unit)所構成。 The multi-microcontroller system of claim 6, wherein the main controller is composed of a microprogram control unit, a data path unit, and a function unit. . 一種物聯網閘道系統,其包含一主控微控制器、一橋接器以及複數個從屬微控制器;該主控微控制器與該橋接器設置於一主控裝置內,該等複數個從屬微控制器各自設置於多個電子裝置內;該橋接器以一第一記憶體介面與一第一SPI介面組成一第一通訊部;該主控微控制器以一第二通訊部與該第一通訊部連接,該第二通訊部包含一第二記憶體介面與第二SPI介面;該複數個從屬微控制器係以一第三通訊部與該第一通訊部連接,該第三通訊部包含一第三記憶體介面與第三SPI介面;據此,該主控裝置係透過該橋接器管理該多個電子裝置。 An Internet of Things gateway system includes a master microcontroller, a bridge, and a plurality of slave microcontrollers; the master microcontroller and the bridge are disposed in a master device, and the plurality of slaves The microcontrollers are respectively disposed in the plurality of electronic devices; the bridges form a first communication portion with a first memory interface and a first SPI interface; the main control microcontroller has a second communication portion and the first a communication unit is connected, the second communication unit includes a second memory interface and a second SPI interface; the plurality of slave microcontrollers are connected to the first communication unit by a third communication unit, the third communication unit The third memory interface and the third SPI interface are included; accordingly, the master device manages the plurality of electronic devices through the bridge. 如請求項8所述之物聯網閘道系統,其中,該橋接器藉由該第一通訊部分別與該第二通訊部、該第三通訊部相連結,處理該主控微控制器和該等從屬微控制器之間控制訊號與資料的傳遞,以及作為共同記憶體的暫存區,藉以自動化管理該等從屬微控制器狀態、指定該等從屬微控制器地址以及分配記憶體區塊。 The Internet of Things gateway system of claim 8, wherein the bridge is coupled to the second communication unit and the third communication unit by the first communication unit, and processes the main control microcontroller and the Controlling the transmission of signals and data between the slave microcontrollers, and as a temporary storage area for the common memory, thereby automatically managing the status of the slave microcontrollers, specifying the slave microcontroller addresses, and allocating memory blocks. 如請求項8所述之物聯網閘道系統,其中,該第一通訊部、該第二通訊部以及該第三通訊部之間控制訊號與資料的傳遞,係透過ZigBee、行動通訊2G、3G、4G、Bluetooth、USB、CAN、VPN、Wi-Fi或MQTT協定所完成。 The Internet of Things gateway system of claim 8, wherein the control signal and the data transmission between the first communication unit, the second communication unit, and the third communication unit are transmitted through ZigBee, mobile communication 2G, and 3G. , 4G, Bluetooth, USB, CAN, VPN, Wi-Fi or MQTT agreement. 如請求項8所述之物聯網閘道系統,其中,該橋接器進一步包含一主控制器,該主控制器負責解析該主控微控制器傳入之指令,以及該主控微控制器與該等從屬微控制器之間的資料搬移。 The Internet of Things gateway system of claim 8, wherein the bridge further comprises a main controller, wherein the main controller is responsible for parsing an instruction sent by the main control microcontroller, and the main control microcontroller is Data movement between the slave microcontrollers. 如請求項11所述之物聯網閘道系統,其中,該主控制器係由一微程式控制單元(microprogram control unit)、資料運算單元(datapath unit)、和功能指令單元(function unit)所構成。 The Internet of Things gateway system according to claim 11, wherein the main controller is composed of a microprogram control unit, a data operation unit, and a function unit. . 如請求項8所述之物聯網閘道系統,其中,該等電子裝置係由一攝影機、一感測器、一致動器、一DI/DO、或一可程式邏輯控制器(PLC)、或人機互動介面(HMI)之單一種或混合所組成。 The Internet of Things gateway system of claim 8, wherein the electronic device is a camera, a sensor, an actuator, a DI/DO, or a programmable logic controller (PLC), or A single or mixed human-machine interface (HMI). 一種基於橋接器的多微控制器系統之控制方法,該多微控制器系統包括一主控微控制器與複數個從屬微控制器;其中,該主控微控制器係透過一橋接器分別與該等從屬微控制器連接;該控制方法包含以下步驟:步驟1:令該主控微控制器、該橋接器以及該等從屬微控制器初始化;步驟2:該橋接器對該主控微控制器與該等從屬微控制器發出一詢問訊號,並賦予該主控微控制器與該等從屬微控制器一ID與地址;步驟3:令該等從屬微控制器的個數回傳至該主控微控制器,接著該橋接器判斷該主控微控制器是否有發送擷取資料的指令,若有則進 入步驟4,若沒有則回到步驟1;步驟4:令該橋接器解析該主控微控制器所傳送的指令,包括該等從屬微控制器中的指定ID與控制指令;步驟5:對該指定ID所對應的該從屬微控制器ID執行該控制指令;步驟6:接收該從屬微控制器回傳的數值,接收完畢後,回到步驟1。 A control method for a multi-microcontroller system based on a bridge, the multi-microcontroller system comprising a master microcontroller and a plurality of slave microcontrollers; wherein the master microcontroller is respectively connected to a bridge through a bridge The slave microcontrollers are connected; the control method includes the following steps: Step 1: Initialize the master microcontroller, the bridge, and the slave microcontrollers; Step 2: The bridge controls the master control Transmitting an inquiry signal to the slave microcontrollers and assigning the master microcontroller an ID and an address to the slave microcontrollers; Step 3: returning the number of the slave microcontrollers to the Mastering the microcontroller, and then the bridge determines whether the master microcontroller has an instruction to send data, and if so, Going to step 4, if not, returning to step 1; step 4: causing the bridge to parse the instructions transmitted by the master microcontroller, including the specified ID and control instructions in the slave microcontrollers; step 5: The slave microcontroller ID corresponding to the designated ID executes the control command; step 6: receives the value returned by the slave microcontroller, and after receiving, returns to step 1. 如請求項14所述之基於橋接器的多微控制器系統之控制方法,其中,該主控微控制器、該橋接器以及該等從屬微控制器之間,係使用一記憶體介面做為資料通訊介面之用,以及使用一SPI介面做為狀態控制介面之用。 The control method of the bridge-based multi-microcontroller system of claim 14, wherein the master microcontroller, the bridge, and the slave microcontrollers use a memory interface as The data communication interface is used, and an SPI interface is used as the state control interface.
TW106100815A 2017-01-11 2017-01-11 Multi-microcontroller system, internet of things gateway system, and control flow of multi-microcontroller system based on network bridge TWI648638B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW106100815A TWI648638B (en) 2017-01-11 2017-01-11 Multi-microcontroller system, internet of things gateway system, and control flow of multi-microcontroller system based on network bridge

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW106100815A TWI648638B (en) 2017-01-11 2017-01-11 Multi-microcontroller system, internet of things gateway system, and control flow of multi-microcontroller system based on network bridge

Publications (2)

Publication Number Publication Date
TW201826139A TW201826139A (en) 2018-07-16
TWI648638B true TWI648638B (en) 2019-01-21

Family

ID=63639777

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106100815A TWI648638B (en) 2017-01-11 2017-01-11 Multi-microcontroller system, internet of things gateway system, and control flow of multi-microcontroller system based on network bridge

Country Status (1)

Country Link
TW (1) TWI648638B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI755049B (en) * 2020-09-01 2022-02-11 三泰科技股份有限公司 The processing system of the controlling iot equipment, the method and the gateway

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI693490B (en) * 2018-12-22 2020-05-11 網聯科技股份有限公司 Industrial Internet of Things system and its data processing device
TWI808328B (en) 2020-06-19 2023-07-11 新唐科技股份有限公司 System on chip and control method
TWI797554B (en) * 2021-02-05 2023-04-01 新唐科技股份有限公司 System on chip and control method
TWI827286B (en) * 2022-09-30 2023-12-21 台達電子工業股份有限公司 Can bus system and method for automatically distributing node number

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201101035A (en) * 2009-06-19 2011-01-01 Via Tech Inc Computer system, device information management system of computer system and the method thereof
CN102291856A (en) * 2011-09-21 2011-12-21 大连钜正科技有限公司 Internet of things gateway with multipassage and multichannel supporting effect
TW201328401A (en) * 2011-12-28 2013-07-01 Univ Nat Central Wireless sensing braking network and operating method thereof
US20150222517A1 (en) * 2014-02-05 2015-08-06 Apple Inc. Uniform communication protocols for communication between controllers and accessories
TW201617851A (en) * 2014-07-28 2016-05-16 惠普發展公司有限責任合夥企業 Master module

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201101035A (en) * 2009-06-19 2011-01-01 Via Tech Inc Computer system, device information management system of computer system and the method thereof
CN102291856A (en) * 2011-09-21 2011-12-21 大连钜正科技有限公司 Internet of things gateway with multipassage and multichannel supporting effect
TW201328401A (en) * 2011-12-28 2013-07-01 Univ Nat Central Wireless sensing braking network and operating method thereof
US20150222517A1 (en) * 2014-02-05 2015-08-06 Apple Inc. Uniform communication protocols for communication between controllers and accessories
TW201617851A (en) * 2014-07-28 2016-05-16 惠普發展公司有限責任合夥企業 Master module

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI755049B (en) * 2020-09-01 2022-02-11 三泰科技股份有限公司 The processing system of the controlling iot equipment, the method and the gateway

Also Published As

Publication number Publication date
TW201826139A (en) 2018-07-16

Similar Documents

Publication Publication Date Title
TWI648638B (en) Multi-microcontroller system, internet of things gateway system, and control flow of multi-microcontroller system based on network bridge
Liang et al. An integrated, flexible, and Internet-based control architecture for home automation system in the Internet era
Kastner et al. Building Automation Systems Integration into the Internet of Things The IoT6 approach, its realization and validation
US10313432B2 (en) Multi-microcontroller system, internet of things gateway system, and control flow of multi-microcontroller system based on network bridge
EP3557345B1 (en) Control apparatus, system program, and control method
JP7000686B2 (en) Control device
EP3353649A1 (en) Heterogeneous distributed runtime code that shares iot resources
JP6996257B2 (en) Controls, control methods, and programs
WO2014064232A1 (en) System for m2m communications
WO2012056537A1 (en) Programmable controller
JP2018064178A (en) Slave apparatus
Shih et al. Out-of-box device management for large scale cyber-physical systems
CN113472637A (en) LORA gateway
CN110430110B (en) On-site bus gateway and protocol conversion method thereof
KR101038619B1 (en) Implementation of network based control module for smart actuator with multi degree of freedom used in robot
EP3467655A1 (en) System and method for mpi implementation in an embedded operating system
Gaitan et al. An IoT middleware framework for industrial applications
Yan et al. Mixed time-triggered and event-triggered industrial controller in IoT environment
US11522762B2 (en) Coordination device and method for providing control applications via a communication network for transmitting time-critical data
WO2020235174A1 (en) Transfer device, information processing device, and data transfer method
Atmojo et al. Extending SOSJ framework for large-scale dynamic manufacturing systems
Rákay et al. Comparison of communication protocols for smart devices
Moga et al. Embedded platform for Web-based monitoring and control of a smart home
Blaho et al. Real-time communication subsystem for CAN bus
CN106170022B (en) Distributed multimedia sensor control system