The utility model belongs to the field of electronic circuit technology, in particular to an expansion circuit for the number of input and output interfaces of main controller. The input and output expansion circuit based on the SPI interface includes the main controller, the main controller chip of the main controller has the SPI interface; it also includes at least one extension module. The main control module includes the parallel serial output chip, the serial input and out chip, the interface 1, the interface 2, the switch input terminal and the controlled signal output end. The input and output expansion circuit of the utility model makes the communication between the controller and the extended module through SPI serial data, and the interface line is few. The extension module needs no address setting, the extension is convenient, and the program parameters of the main controller are simply modified, and the expansion of the multi module can be realized.
【技术实现步骤摘要】
一种基于SPI接口的输入输出扩展电路
本技术属于电子电路
,具体涉及一种对主控制器输入输出接口数量的扩展电路。
技术介绍
自动化控制领域离不开对现场开关信号的采集输入及控制信号的输出,一般主控制器只包含少量的输入输出接口能力,对于数量较大的开关输入输出信号和输出信号,通常采用扩展输入输出的方法,目前常见的扩展输入输出的方法包括并行扩展方法和RS232、RS485串行扩展方法。两种扩展方法都存在一定的缺陷:并行扩展使用的信号线比较多,对现场走线不方便,对控制器的IO口占用也比较多;RS232、RS485串行扩展使用口线少,但这两种通讯都是靠地址的不同来区分不同模块的,在每个扩展模块上必需要加入地址设定模块,比较麻烦。
技术实现思路
本技术的目的在于提出一种基于SPI接口的输入输出扩展电路,该输入输出扩展电路使控制器和扩展模块之间通过SPI串行数据通讯,接口线少,扩展模块不需要地址设定,扩展方便,只需简单的修改主控制器程序参数,就可实现多模块的扩展。本技术解决上述问题的技术方案是,一种基于SPI接口的输入输出扩展电路,其特殊之处在于:包括主控制器,所述主控制器的主控芯片具有SPI接口;还包括至少一个扩展模块,所述扩展模块包括并入串出芯片、串入并出芯片、接口1、接口2、开关量输入端和控制信号输出端;所述接口1和接口2均与并入串出芯片和串入并出芯片连接,开关量输入端与并入串出芯片连接,控制信号输出端与串入并出芯片连接;所述接口1和接口2均为SPI接口;所述并入串出芯片具有并行输入、串行移位输入和串行移位输出接口功能;所述串入并出芯片具有串行移位输入、并行输出和串 ...
【技术保护点】
一种基于SPI接口的输入输出扩展电路,其特征在于:包括主控制器,所述主控制器的主控芯片具有SPI接口;还包括至少一个扩展模块,所述扩展模块包括并入串出芯片、串入并出芯片、接口1、接口2、开关量输入端和控制信号输出端;所述接口1和接口2均与并入串出芯片和串入并出芯片连接,开关量输入端与并入串出芯片连接,控制信号输出端与串入并出芯片连接;所述接口1和接口2均为SPI接口;所述并入串出芯片具有并行输入、串行移位输入和串行移位输出接口功能;所述串入并出芯片具有串行移位输入、并行输出和串行移位输出接口功能;通过主控芯片上的SPI接口与扩展模块的接口1连接,实现主控制器与扩展模块的连接。
【技术特征摘要】
1.一种基于SPI接口的输入输出扩展电路,其特征在于:包括主控制器,所述主控制器的主控芯片具有SPI接口;还包括至少一个扩展模块,所述扩展模块包括并入串出芯片、串入并出芯片、接口1、接口2、开关量输入端和控制信号输出端;所述接口1和接口2均与并入串出芯片和串入并出芯片连接,开关量输入端与并入串出芯片连接,控制信号输出端与串入并出芯片连接;所述接口1和接口2均为SPI接口;所述并入串出芯片具有并行输入、串行移位输入和串行移位输出接口功能;所述串入并出芯片具有串行移位输入、并行输出和串行移位输出接口功能;通过主控芯片上的SPI接口与扩展模块的接口1连接,实现主控制器与扩展模块的连接。2.根据权利要求1所述的一种基...
【专利技术属性】
技术研发人员:叶新华,肖晓峰,陈蕊,杨茂华,闫国栋,
申请(专利权)人:陕西隆翔停车设备集团有限公司,
类型:新型
国别省市:陕西,61
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。