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精品综合久久久久久五月天_国产精品一区电影_中文字幕欧美日韩一区二区_亚洲一区二区三区精品动漫
国产午夜福利在线播放| 风间由美久久久| 久久偷看各类wc女厕嘘嘘偷窃| 欧美精品久久久久久久免费观看| 日本一区二区三区四区在线观看| 国内精久久久久久久久久人| 久久涩涩网站| 日韩和欧美的一区二区| 欧美日韩在线不卡一区| 久久精品国产综合| 欧美精品久久久久久久| 日韩视频永久免费观看| 国产欧美精品一区二区三区介绍 | 久久久精品在线| 视频一区国产精品| 欧美日韩激情视频在线观看| 国产欧美亚洲视频| 国产成人午夜视频网址| 三级网在线观看| 欧美精品在线播放| 国模视频一区二区| 久久99精品久久久久久青青日本 | 久久亚洲精品一区| 91老司机精品视频| 国产一区二区高清不卡| 久久99久久久久久| 国产日韩欧美视频在线| 日韩av色在线| 国产精品av在线播放 | 日本婷婷久久久久久久久一区二区| 久久精品国产69国产精品亚洲| 91传媒久久久| 亚洲最新免费视频| 日本黄网站色大片免费观看| 成人在线观看a| 国产精品一区二区三区四区五区| 精品伦精品一区二区三区视频| 精品视频在线观看一区二区| 久久成人在线视频| 国产主播欧美精品| 欧美激情精品久久久久久大尺度| 超碰国产精品久久国产精品99| 亚洲精品成人三区| 久久大片网站| 国内自拍中文字幕| 欧美人与性动交| av在线免费观看国产| 亚洲精品国产系列| 国产a级全部精品| 欧美精品一区二区三区四区五区| 国产精品久久久久免费| 国产精选一区二区| 日韩av电影在线播放| 久久视频这里只有精品| 免费国产一区二区| 亚洲一区二区三| 色妞久久福利网| 国产日韩久久| 亚州国产精品久久久| 日韩在线播放av| 国产综合久久久久| 亚洲一区二区中文| 久久久久久久久久久91| 国产日韩精品电影| 日本一二三区视频在线| 国产精品吊钟奶在线| 久久久亚洲福利精品午夜| 激情小视频网站| 亚洲精品一区二区三| 久久久久久久久电影| 国产在线一区二区三区四区| 亚洲欧洲日韩综合二区| 色天天综合狠狠色| 国产精品一区二区三区观看| 无码人妻精品一区二区三区66| 日韩一区二区欧美| 成人国产一区二区| 欧日韩一区二区三区| 亚洲综合最新在线| 久久久精品影院| 91精品国产91久久久久久吃药 | 茄子视频成人免费观看| 在线精品日韩| 国产精品嫩草影院一区二区| 99久久国产宗和精品1上映| 精品欧美国产| 国产在线视频欧美| 日本成人黄色| 亚洲中文字幕无码一区二区三区| 色婷婷综合久久久久| 91免费视频国产| 国产午夜福利100集发布| 日韩精品在线中文字幕 | 国模杨依粉嫩蝴蝶150p| 日本公妇乱淫免费视频一区三区| 欧美乱大交xxxxx| 欧美另类第一页| 国产精品视频一区二区三区四区五区| 久久久人成影片一区二区三区| 国产熟女高潮视频| 国内精品国产三级国产在线专| 日本不卡免费新一二三区| 亚洲欧洲精品一区二区 | 国产精品丝袜白浆摸在线| 国产成人短视频| 成人av男人的天堂| 国产日韩欧美中文| 国产又大又硬又粗| 免费看成人午夜电影| 欧美一区亚洲一区| 日本视频精品一区| 少妇熟女一区二区| 偷拍视频一区二区| 亚洲天堂电影网| 一区国产精品| 永久久久久久| 精品国产乱码久久久久软件 | 久久久精品一区| 国产精品10p综合二区| 高清欧美性猛交| 成人综合视频在线| 国产精品一区二区不卡视频| 国产伦精品一区二区三区在线| 国产亚洲欧美一区二区| 精品一区二区日本| 国内精品视频一区二区三区| 激情伦成人综合小说| 免费国产成人av| 国产主播在线看| 国产欧美一区二区三区四区| 国产一区视频观看| 国产片侵犯亲女视频播放| 国产在线播放91| 麻豆av免费在线| 黄色一级一级片| 美媛馆国产精品一区二区| 免费精品视频一区| 国产人妖伪娘一区91| 国产精品一区二区三区成人| 国产精品一区二区三区免费视频| 超碰免费在线公开| 国产成人亚洲综合青青| 久久久久久久久网站| 久久精品国产久精国产一老狼| 久青草国产97香蕉在线视频| 国产精品久久久久久久天堂 | 狠狠97人人婷婷五月| 国产欧美在线播放| 91传媒久久久| 深夜福利一区二区| 国产精品后入内射日本在线观看| 欧美精品在线网站| 久久久久久12| 欧美老熟妇喷水| 国产欧美日韩中文字幕在线| av免费观看久久| 久久大香伊蕉在人线观看热2| 久久手机免费视频| 萌白酱国产一区二区| 亚洲精品欧美精品| 日本成人黄色| 免费看国产一级片| av一区观看| 日韩中文字幕精品| 色综合五月天导航| 日本精品一区二区三区不卡无字幕 | 色偷偷9999www| 国产精品高清免费在线观看| 中文字幕日韩精品一区二区| 日日噜噜噜噜夜夜爽亚洲精品| 欧美高清中文字幕| 99国产在线| 国产精品色午夜在线观看| 久久国产精品电影| 欧美一区二区视频17c| 激情视频综合网| 91av网站在线播放| 国产精品久久久久久久9999| 亚洲一区二区三区久久| 欧美精品久久久久久久自慰| 成人精品久久av网站| 久久精品青青大伊人av| 亚洲精品9999| 精品午夜一区二区| 国产激情久久久久| 久99九色视频在线观看| 日韩精品一区二区三区四区五区 | 国产高清在线一区二区| 久久亚洲精品成人| 日本福利视频导航| www.欧美日本| 国产精品黄色av| 日本999视频| 国产免费成人在线| www.日韩视频| 亚洲熟妇av一区二区三区| 黄色网在线视频| 久艹视频在线免费观看| 一卡二卡3卡四卡高清精品视频| 欧美精品免费观看二区|