91精品综合久久久久久五月天_国产精品一区电影_中文字幕欧美日韩一区二区_亚洲一区二区三区精品动漫

Linux-based PC104 bus and CAN bus communication design

1 Introduction

PC104 embedded industrial computer because of its small size structures, stack-type connection, easy bus-driven features have been widely used. Fieldbus field, CAN bus has been widely supported by the computer chip business, they have introduced CAN interface directly with microprocessor (MCU) chip.

Chip MCU with CAN's total has reached 100 million 3000 million pieces, so in the interface chip technology, CAN has been far ahead of FF, PRO-FIBUS, LONWORKS all other fieldbus. But the PC104 bus can not communicate directly with the CAN bus, CAN bus control system so difficult to use.

To solve the above problems, to AVR microcontroller co-processor designed for the PC104 bus and CAN bus converter card, and taking into account the PC104 embedded industrial computer running Linux operating system is usually characterized by the preparation of the conversion card under Linux dual-port RAM PC104 bus access drivers. The adapter used in industrial control systems, can actually show that the stable and reliable in operation.

2 hardware

PC104 CAN bus converter card to the hardware system block diagram shown in Figure 1. In the PC104 bus and CAN bus communication, the main issue to consider is the PC104 bus and CAN bus data synchronization. PC104 bus and CAN bus bus speed are very different, commonly used for such problems is to use dual-port RAM or FIFO as a buffer, where a dual-port RAM as a data buffer, while the dual-port RAM, set aside a few bytes as the ATmega64 processor and PC104 embedded computer soft handshake signals the completion of the above methods PC104 bus and CAN bus data synchronization. Altera EPM7128 to the CPLD, here using the CPLD is mainly used for CAN-bus converter card PC104 to the address decoding. CAN bus communication use SJA1000 CAN bus controller, in order to meet the harsh electromagnetic environment of industrial site, in the SJA1000 and PC82C250 in the light compartment after treatment.

Linux-based PC104 bus and CAN bus communication design

2.1 PC104 bus interface circuit with IDT7134
IDT7134 PC104 bus and interface circuit diagram shown in Figure 2.

PC104 embedded computer to read the dual-port RAM IDT7134 data. First IDT7134 mapped to the PC104 embedded computer memory space, use SMEMR *, SMEMW * as IDT7134 the OER, R / W control signal. Another advantage of the PC104 bus CPLD EPM7128 high three addresses SA19, SA18, SA17 decoding the chip select signal as IDT7134.

Linux-based PC104 bus and CAN bus communication design

2.2 ATmega64 and IDT7134 interface circuit

ATmega64 processor used is the address line, data line time-multiplexing, thus the need for address latch. EPM7128 VHDL hardware description language used in the design of the address latch. ATmega64 and IDT7134 interface circuit shown in Figure 3.

Linux-based PC104 bus and CAN bus communication design

2.3 CPLD EPM7128 internal logic

CPLD EPM7128 in the whole design was completed for decoding, and address latch function. In the Quartus Ⅱ 6.0 environment, through the VHDL hardware description language, completion of the function. The source code is as follows:

Linux-based PC104 bus and CAN bus communication design

In the above VHDL code CSSJA1000 for the SJA1000 chip select signal, CS7134L left port for the IDT7134 chip select, CS7134R for the IDT7134 chip select the right port.

Software part 3

To achieve the PC104 bus and CAN bus data communication hardware design in the above mentioned dual-port RAM is used as a data buffer method, which involves the dual-port RAM in the data area opened up as PC104 Embedded PC, and ATmega64 soft handshake flag. Handshake to ATmega64 PC104 embedded PC, the software program and implement, the process is as follows: First, open up the dual-port RAM, two buffer, were used to send and receive data buffer CAN bus. When there is data to the PC104 bus, CAN bus, the first dual-port RAM, data is written to send the CAN data buffer, and then to the dual-port RAM reserved for the flag field to write a specific value, the circular ATmega64 with data through CAN bus send, ATmega64 using the query method to measure the flag field, when a specific flag field detected value, to read dual-port RAM of the CAN data transmission buffer, while read data to the CAN bus. After the above process, ATmega64 program will reset the field flags. Thus completed the PC104 bus data transmission on the CAN bus. CAN bus data on the PC104 bus to send the opposite of this process.
3.1 ATmaga64 processor program

ATmaga64 processor on the CAN bus read and write the bottom of the work, while data written in the dual-port RAM IDT7134 and IDT7134 stored in the first flag byte set to notify the PC104 embedded PC, with data being updated to require PC104 Embedded PC, be read on the IDT7134. Based on the above process ATmaga64 processor initialization procedure includes SJA1000, SJA1000 interrupt handler, and access IDT7134 procedures.

3.2 PC104 bus access dual-port RAM in the Linux driver

Linux driver from the structure is divided into three parts:

(1) equipment configuration and initialization, including the existence of inspection equipment, status, equipment, registration and related device driver initialization. This part of the general initialization procedure is called only once, he was included in the init_module () routine.

(2) I / O request service programs primarily through system calls, the completion of the user's request features such as Read, Write, etc., and equipment operating by the majority of I / O request completion of services, including Read, Write, Ioct1 and other routine .

(3) interrupt service routine, the system receives all the hardware interrupt, then calls the appropriate interrupt service routine.

In the Linux system, device drivers the way the document appears, the device driver interface is a file system interface, which consists of a data structure struct file_operations () to define the data structure is the virtual file system standard interfaces. So first define a dual-port RAM PC104 bus driver to access the file system data structures.

Linux-based PC104 bus and CAN bus communication design

PC104 memory segment for the Linux kernel at boot time to access these addresses on the establishment of a page table, access to their virtual address and the actual physical address are different, need to use ioremap to map physical address to virtual address so we can visit on the PC104 bus, to read the dual port RAM data. ioremap function is defined as:


Void * ioremap (unsigned long phy_addr, unsigned longsize)

Parameter phys_addr the physical address, size for the physical address length. ioremap return value is a unique virtual address can be used to access the specified the physical memory area, the virtual address to call iounmap to release last fall. The following will detail the various Linux drivers for the concrete realization of the function.

3.2.1 Initialization function and unloading functions to achieve

Equipment configuration and initialization function init_module () called, respectively:

register_chrdev (): for device registration;

request_irq (): interrupt request channel;

request_mem_region (): allocation of I / O memory area;

ioremap (): physical address mapped to the virtual address.

Source code is as follows:

Linux-based PC104 bus and CAN bus communication design

This completes the device driver initialization. Unloading part of the device driver and initialization Instead, uninstall is assigned to the device driver recovered a variety of resources. cleanup_module () call, respectively:

iounmap (): release of virtual address;

release_mem_region (): release memory regions;

free_irq (): release interrupt channel.

Source code is as follows:

Linux-based PC104 bus and CAN bus communication design

3.2.2 Reading of the function implementation

Read function definition of dual-port RAM read process, the source code is as follows:

Linux-based PC104 bus and CAN bus communication design

Kernel function which copy_to_user virtual address pPxp-VirtStartAddr the count of data copied to buf pointer to user space. Before the device configuration and initialization function ink_module () in ioremap () function has dual-port RAM physical address mapped to virtual address pPxpVirtStartAddr, so you can pxp_read () function to read dual-port RAM.

3.2.3 Write a function to achieve

Write dual-port RAM, called pxp201_write () function, the principle of dual-port RAM with similar reading, but pxp201_write () function call copy_from_user () kernel function.

Linux-based PC104 bus and CAN bus communication design

3.2.4 open function and the release function to achieve

pxp_open () function to achieve the following, which increases equipment use MOD_INC_USE_COUNT reference count.

Linux-based PC104 bus and CAN bus communication design

pxp201_release () function and pxp_open () process the contrary, the use of MOD_DEC_USE_COUNT decreasing device reference count.

Since then, Linux, dual-port RAM of the drive module is complete, you can use Insmod tool to load the kernel driver module. This can be embedded in the PC104 industrial computer's Linux operating system to access the dual-port RAM.

4 Concluding Remarks

This paper introduces the PC104 bus and CAN bus communication hardware, and PC104 embedded Linux computer operating system developed under the PC104 bus on the dual-port RAM IDT7134 access driver. Signs within the open area in the IDT7134, using soft handshake method to achieve the PC104 bus and CAN bus data communication. The adapter used in industrial control systems through practical and reliable test that can be run.

Declined comment

91精品综合久久久久久五月天_国产精品一区电影_中文字幕欧美日韩一区二区_亚洲一区二区三区精品动漫
国产freexxxx性播放麻豆| 国产精品一区二区欧美黑人喷潮水| 欧美日韩不卡在线视频| 久久久免费精品| www久久99| 68精品国产免费久久久久久婷婷| 欧美一区二区激情| 都市激情久久久久久久久久久 | 国产精品一区二区性色av| 亚洲午夜高清视频| 亚洲欧洲日产国码无码久久99| 久久久噜久噜久久综合| 欧美日韩在线观看一区| 久久99久国产精品黄毛片入口| 波多野结衣综合网| 91精品视频观看| 久久久久久久中文| 国产精品久久久久77777| 91精品国产91久久久久| 欧美日韩精品免费看| 一区二区三区在线视频看| 91精品国产综合久久久久久丝袜| 女女同性女同一区二区三区91| 欧美激情精品久久久久| 久久九九视频| 日韩亚洲国产中文字幕| 99热久久这里只有精品| 日韩网站在线免费观看| 欧美精品日韩三级| 欧美激情亚洲激情| 日本一区二区三区视频在线观看| 久久中文字幕一区| 尤物一区二区三区| 日本不卡高清视频一区| 中文字幕免费高| 午夜精品久久久久久99热| 国产精品欧美久久| 欧美成人精品在线| 日韩av播放器| 国产日韩精品在线| 国产a级一级片| 九九久久综合网站| 日韩极品视频在线观看| 亚洲中文字幕无码专区| 国产精品成人品| 亚洲精品人成| 激情视频一区二区| 国产成人亚洲综合无码| aaa级精品久久久国产片| 国模杨依粉嫩蝴蝶150p| 欧美一级爱爱| av资源一区二区| 国产精品免费在线播放| 久久精品成人一区二区三区 | 国产综合在线观看视频| 在线不卡视频一区二区| 国产精品人人做人人爽| 国产xxxxx视频| 久久五月情影视| 日本不卡在线观看| 国产精品亚洲网站| 国产精品人成电影| 日本一区二区三区免费看 | 8090成年在线看片午夜| 国产伦精品一区二区三毛| 极品尤物一区二区三区| 欧美主播一区二区三区美女 久久精品人| 国产特级淫片高清视频| 不卡av电影院| 欧美一级大片在线观看| 人体内射精一区二区三区| 日韩高清av| av一区观看| 九九精品在线播放| 激情五月宗合网| 国产精品无码人妻一区二区在线 | 国产超碰91| 一区二区视频国产| 国产裸体写真av一区二区| 精品视频免费观看| 久久久久久久久网| 亚洲精品偷拍视频| 97久久久免费福利网址| 国产黄色激情视频| 亚洲国产一区二区三区在线播| 亚洲在线播放电影| 国产淫片免费看| 欧美精品免费看| 国产一区二区三区精彩视频| 国产色一区二区三区| 99久久免费国| 亚洲综合一区二区不卡| 日本中文字幕久久看| 欧美久久电影| 国产精品入口福利| 欧美日韩在线观看一区| 欧美精品一区二区三区三州| 国语自产精品视频在免费| 成人欧美一区二区三区黑人| 国产精品午夜一区二区欲梦| 国产极品粉嫩福利姬萌白酱| 久久久国产精品亚洲一区| 精品国产无码在线| 日韩在线欧美在线| 黄瓜视频免费观看在线观看www| av动漫在线播放| 一区不卡视频| 国产成人精品视频ⅴa片软件竹菊| 久久久久久久国产精品视频| 国产精品久久久久久婷婷天堂| 国产精品成人一区| 欧美高清一区二区| 欧美xxxx做受欧美.88| 亚洲最新免费视频| 久青草视频在线播放| 国产精品大全| 操人视频欧美| 日韩精品不卡| 久久国产精品偷| 久久综合婷婷综合| 欧美日韩亚洲免费| 亚洲午夜久久久影院伊人| 欧洲在线视频一区| 国产精品久久久久久免费观看| 亚洲97在线观看| 国产久一道中文一区| 久久天堂电影网| 国产一区二区三区精彩视频| 久久av喷吹av高潮av| 精品综合久久久久久97| 欧洲久久久久久| 久久久久国产精品一区| 黄色特一级视频| 亚洲一区不卡在线| 久久精品国产亚洲精品| 日本福利视频一区| 精品国产一二三四区| 日韩欧美精品免费| 精品九九九九| 久久国产精品一区二区三区四区| 宅男噜噜99国产精品观看免费| 欧美亚洲激情在线| 欧美日本在线视频中文字字幕| 精品无人乱码一区二区三区的优势| 久久精品.com| 国产综合第一页| 日本亚洲导航| 尤物一区二区三区| 久久精品国产免费观看| 日本三级韩国三级久久| 97成人精品视频在线观看| 欧美激情亚洲激情| 国产精品无码专区av在线播放| 秋霞午夜一区二区| 欧美黄网免费在线观看| 免费久久久一本精品久久区| 久久久久久香蕉网| 北条麻妃在线视频观看| 一级特黄录像免费播放全99| 国产区欧美区日韩区| 国产精品久久9| 久久婷婷国产精品| 粉嫩av免费一区二区三区| 久久久久久12| 国产精品久久久久久久乖乖| 国内成人精品一区| 人体内射精一区二区三区| 日韩最新在线视频| 国产精品91在线观看| 欧美精品午夜视频| 久久久伊人日本| 97久久天天综合色天天综合色hd| 亚洲日本理论电影| 欧美乱妇高清无乱码| 成人国产精品日本在线| 亚洲一二区在线| 色综合天天狠天天透天天伊人| 国产精品一区二区在线观看| 亚洲最大激情中文字幕| 97精品久久久| 国产麻豆电影在线观看| 亚洲欧美日韩另类精品一区二区三区 | 久久久久se| 97成人精品视频在线观看| 少妇免费毛片久久久久久久久| 国产成人综合一区| 国产精彩精品视频| 久久五月天婷婷| 国产精品com| 日韩在线视频线视频免费网站| 黄黄视频在线观看| 奇米影视亚洲狠狠色| 中文字幕中文字幕在线中心一区| 国产精品一区二区3区| 少妇高潮喷水久久久久久久久久| 视频直播国产精品| 精品国产一区av| 国产精品久久波多野结衣| 久久综合伊人77777麻豆| 欧美日韩高清在线一区|