您的当前位置:首页正文

基于FPGA的IIC总线IP核设计

2022-02-13 来源:榕意旅游网
VOI.6 No.1,Mar.2015 Journal of Measurement Science and Instrumentation 13 Design of IP core for IIC bus controller based on FPGA HUANG Xiao-min。ZHANG Zhi-j ie (Key Laboratory of Instrumentation Science&Dynamic Measurement(North University of China). Ministry ofEducation,Taiynan 030051,China) Abstract:The intellectual property(IP)core for inter-integrated circuit(IIC)bus controller is designed using finite state ma— chine(FSM)based on field programmable gate array(FPGA).Not only the data from AT 24C02C can be read automatically af— ter power on,but also the data from upper computer carl be written into AT24C02C immediately under the control of the IIC bus controller.When it is applied to blast wave overpressure test system.the IIC bus controller can read and store working pa— rameters automatically.In a】aboratory environment,the IP core simulation is carried out and the result is accurate.In the ex— plosion field test,by analyzing the obtained valid data,it can be concluded that the designed IP core has good reliability. Key words:field programmable gate array(FPGA);IIC bus;intellectual property(IP)core;test system CLD number:TP274 Document code:A Article ID:1674—8042(2015)O1—0013一O6 doi:10.3969/j.issn.1674—8042.2015.01.003 IIC bus data transfer protoco1.It has simple periph— 0 Introduction The inter-integrated circuit(IIC)bus from Philips is a simple,two—wire and synchronous serial bus.It is applicable to the communications among various serial equipment[ .Compared with traditiona1 paral- lel bus system,IIC bus system has the advantages of eral circuit,small package and low power.Especial— ly,it is electrically erasable,therefore,it is suitable for mass storage[ .IIC bus includes a bidirectional data wire SDA and a clock wire SCL for full duplex synchronous data transmission[ .When IIC bus is i— dle,SDA and SCL must maintain keep in a high lev— e1;When IIC bus is closed,the SCL clamp in a low simple structure,good maintainability,easy extensi— bility and high reliabilityE引.The blast wave over— pressure test system needs to read and store impor— tant working parameters automatically.In this pa— per,an intellectuall property(IP)core for IIC bus controller is designed for data transmission automati— Ieve1.Because IIC bus interface is open drain(OD) output and open collector(OC)output,all the out— puts of the bus can realize“and”logic function。 which requires the output terminal of IIC bus to be connected with pull—uD resistors[ .The schematic di— cally among a variety of serial equipment[。一 ]consider— ing that the IP core has the advantages of less re— agram of AT24C02C is shown in Fig.1. sources,high flexibility,easy portability and short 1 A0 VCC 8 development cycle. 2 1 Working principle 1.1 T24C02 3 A1 A2 WP 7 I —6 I。sd 5 0 。 RO01 1 K SCL SDA Rnn2 1 K 4 GND AT 24C02 belongs to electrically erasable program— mable read-only memory(EEPROM)and supports Fig.1 AT24C02C schematic diagram Received date:2014一O9—15 Corresponding author:HUANG Xiao-min(937420530@qq.com) 14 Journal of Measurement Science and Instrumentation Vo1.6 No.1。Mar.2015 1.2 IIC blls data t舢missiOn standard[8] The data between upper computer and 24C02C transmitted by IIC bus is composed of start signal, address code,a number of data bytes,response sig— nal and stop signa1.When the communication starts, the upper computer sends a start signal(when SCL is high,SDA produces a falling edge),AT 24C02C ad— dress code and a read/write signal(there are 7 bytes in all from the AT 24C02C address and read/write control signal R/W。where R/W一“0”indicates a write operation and R/W=“1”indicates a read oper— ation).Then SDA is set to be a high resistance state and the upper computer waits for receiving ACK re— sponse signal(AT 24C02C makes SDA low),thus the upper computer can continue to send data.When the communication is completed,the upper computer sends a stop signa1.In data transmission process, when SCL is in high level,SDA must ensure the sta— bility of the data;After transmitting each one byte data。a response signal ACK must be sent by the re— ceiver. With IIC bus data transmission rate of 100・——400 kbps and power supply of+5 V,the input level is defined as II— 一1.5 V,VIHmin一3 V, With a broad supply voltage,input level is defined VIk 一1.5 VDD,VlH 一3 VDD, where VDD is reference voltage. 2 IP core design IP core is an integrated circuit core with intellectu— al property and has repeated verification macro rood— ules with specific functions.It has nothing to do with chip manufacturing process and can be embedded into different semiconductors.The soft core of IP core is the most widely used form.For the development of FPGA, IP core can provide abundant resources and make the design correspondingly become more con— venient,therefore,IP core design has very practical value[ .This paper describes the soft core design for IIc bus c。n roller using finite state machine(FSM)・ 2.1 M FSM is a general and intuitive method for digital system design.Theoretically,any complex digital design can be realized by FSM method.The state machines can be classified into two types:Moore state machine and Mealy state machine.The output of Moore state machine is a function of current input and current state;the current output of Mealy state machine is determined by its present state.This pa— per adopts the combination of the two types of state machines to describe the system state,of which some outputs are only related to the current state and other outputs are related to both the present state and the current input.It no only simplifies the number of the states,but also improves code universality and reada— bility. 2.2 Implementation of soft core[ 。] Based on integrated software environment(ISE) design suite 10.1 platform,the soft core for IIC bus controller is implemented for read/write control of blast wave overpressure test system.The work flow is shown in Fig.2. The system clock frequency is 20 MHz,digital clock manager(DCM)module produces 1 MHz clock signal for IIC bus controller module.After power on,the system initialization starts.Before reading the working parameters from AT 24C02C,the system state is set at default values.Then the sequential read mode is used to read six parameters:magnifica— tion,trigger level,sampling frequency,data storage capacity,negative delay length and sensor parame— 18 Journal of Measurement Science and Instrumentation Vo1.6 No.1,Mar2015 .University of Posts and Telecommunications,2012,18 2000. (3):38-41. [8]zHANG Dong-dong.IIC bus communication interface de— vice Implementation of CPLn Application of Electronic Technique,2002,8(2):79—80. E4]XU Wei,LIU Jian-cheng.Simulation of volt-Age measure— ment system based on IIC bus.Journal of Nanjing Univer— sity of Information Science&Technology,2011,3(1): 91—96. [9]Short K L VHDL for Engineers.Publishing House of E— lectronics Industry,20119. [53 HE Li-mim Application system design of IIC bus.Beiiing: Beihang University press,1995. [1O]DONG Da-cheng,ZHANG Jian-dong,SHI Guo-qing. Design and realization of UART IP core design based on [6]Chan D Y.The concept of IIC bus and its specification. FPGA Computer Measurement&Control,2012,20 Shanghai Philips Application Lab,1992. (8):2251-2253. [7]IIC speeificafion Version 2.1.Phillps Semiconductors, 基于FPGA的IIC总线IP核设计 黄晓敏,张志杰 (中北大学仪器科学与动态测试教育部重点实验室,山西太原030051) 摘要:采用FSM在FPGA上设计了IIC总线控制器。系统上电后它可自动从AT24C02C芯片中读取数 据;从上位机接收到新的数据后,它也可自动将其存储到AT24C02C中。该IIC总线控制器应用于冲击波超 压测试系统中,可自动读取和保存重要工作参数。在实验室环境下,IP核仿真准确。通过分析爆炸场试验中 获得的有效数据,可以看出该1P核具有很高的可靠性。 关键词:FPGA;IIC总线;IP核;测试系统 引用格式:HUANG Xiao-min,ZHANG Zhi-jie.Design of IP core for IIG bus controller based on FPGA. Journal of Measurement Science and Instrumentation,2015,6(1):13—18.[doi:10.3969 ̄.issn. 1674—8042.2015.01.003] 

因篇幅问题不能全部显示,请点此查看更多更全内容