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精品综合久久久久久五月天_国产精品一区电影_中文字幕欧美日韩一区二区_亚洲一区二区三区精品动漫
欧美精品一区二区三区国产精品 | 91久久久久久久| 久久黄色av网站| 熟女少妇精品一区二区| 国产精品小说在线| 毛片精品免费在线观看| 欧美精品免费观看二区| 成人av免费电影| 久久亚洲精品成人| 欧美极品一区二区| 久久久久久久久久久久久久国产| 亚洲欧洲精品一区| 国产女人18毛片| 国产精品国产亚洲伊人久久| 日韩欧美在线一区二区| 久久青青草综合| 午夜精品久久久久久99热软件 | 黄色免费观看视频网站| 久久久久久久免费视频| 无码内射中文字幕岛国片| 蜜桃av噜噜一区二区三区| 久久精品男人天堂| 欧美日韩三区四区| 国产成人三级视频| 欧美国产激情视频| 日韩视频在线免费| 欧美在线视频一区二区三区| 日韩中文字幕视频在线观看| 日本精品久久久久影院| 国产精品50p| 色综合久久久久无码专区| 91高跟黑色丝袜呻吟在线观看| 亚洲精品国产一区| 久久久免费观看视频| 色爱区成人综合网| 91av免费看| 日韩av不卡播放| 久久99导航| 欧美日韩dvd| 国产精品女视频| 国产资源在线免费观看| 欧美xxxx做受欧美| www.日本在线视频| 欧美一级片久久久久久久| 神马国产精品影院av| 黄频视频在线观看| 欧美激情亚洲自拍| 久久久久久www| 欧美大陆一区二区| 国产精品高潮呻吟久久av野狼| 激情综合网婷婷| 美女国内精品自产拍在线播放 | 久久国产午夜精品理论片最新版本| 欧美一级黄色影院| 久久久久久久久久久久久国产| 欧美日韩电影一区二区| 久久夜色精品亚洲噜噜国产mv| 国产精品一区在线播放| 午夜欧美大片免费观看| 久久精品99无色码中文字幕| 国产日韩欧美影视| 亚洲精品视频一区二区三区| 国产传媒欧美日韩| 好吊色欧美一区二区三区四区| 国产精品-区区久久久狼| 国产麻豆电影在线观看| 色综合久久久久无码专区| 久久精品中文字幕| www日韩视频| 欧美日韩系列| 综合一区中文字幕| 日韩亚洲欧美成人| 国产精品一区二区三区四区五区 | 中文视频一区视频二区视频三区| 久久久免费观看| 精品欧美一区二区在线观看视频 | 国产精品视频男人的天堂| 成人毛片网站| 青青青国产精品一区二区| 欧美成人第一页| 国产不卡视频在线| 国产主播欧美精品| 日韩不卡一二区| 精品国产一区二区三区久久久久久 | 国产成人免费av电影| 国产美女久久久| 日韩精品视频久久| 在线观看一区二区三区三州| 色妞在线综合亚洲欧美| 国产精品专区第二| 欧美 日韩精品| 亚洲国产精品综合| 欧美成年人网站| 久草一区二区| 91久久伊人青青碰碰婷婷| 国模精品系列视频| 日本不卡在线播放| 综合国产精品久久久| 国产精品老女人视频| 久久久久亚洲精品国产| 91九色丨porny丨国产jk| 国产在线精品91| 欧美亚洲国产视频| 日本一区二区三区免费观看| 一区二区精品免费视频| 国产精品激情av在线播放| 久久婷婷五月综合色国产香蕉| 国产视色精品亚洲一区二区| 欧美在线观看黄| 欧美一级片久久久久久久| 亚洲精品一区二区三| 亚洲中文字幕无码一区二区三区| 国产精品久久久久久久久久ktv | 欧美在线3区| 欧美一区二区激情| 中文字幕一区二区三区四区五区 | 精品免费日产一区一区三区免费| 日韩中文字幕久久| 国产a级片免费观看| 国产精品av免费| 91精品国产综合久久香蕉最新版| 国产免费黄视频| 国产日韩欧美自拍| 黄色片一级视频| 激情伦成人综合小说| 欧美久久久久久一卡四| 欧美最猛黑人xxxx黑人猛叫黄| 日韩av在线播放不卡| 视频一区二区在线观看| 日韩最新中文字幕| 欧美一级免费在线观看| 日韩中文字幕一区二区| 日本成人中文字幕在线| 日韩欧美电影一区二区| 日韩久久一级片| 欧美在线一区二区三区四区| 青青草国产免费| 狠狠色综合一区二区| 精品视频无码一区二区三区| 极品尤物一区二区三区| 国产日韩av高清| av网址在线观看免费| 97国产精品久久| 久久亚洲精品欧美| 精品国产一区二区三区久久久| 久久久www成人免费精品| 国产精品免费网站| 免费91麻豆精品国产自产在线观看| 精品国产三级a∨在线| 一区二区三区不卡在线| 午夜精品亚洲一区二区三区嫩草| 日本一区不卡| 国内精品国产三级国产在线专| 国产日本欧美一区二区三区在线| 国产日韩第一页| 91久久久一线二线三线品牌| 国产富婆一区二区三区| 久久久黄色av| 国产999在线观看| 亚洲www在线观看| 青草成人免费视频| 国产一区二区网| 97久久伊人激情网| 色噜噜亚洲精品中文字幕| 国产精品久久久久久久久久久久冷 | 一区二区三区四区免费视频| 日韩一级特黄毛片| 欧美性大战久久久久xxx| 国产乱码精品一区二区三区日韩精品 | 亚洲欧美精品| 欧美亚州一区二区三区| 国产毛片视频网站| 久久久女人电视剧免费播放下载| 国产成人小视频在线观看| 精品国产综合区久久久久久 | 欧美亚洲国产免费| 高清一区二区三区视频| 国产精华一区二区三区| 久久国产精品一区二区三区| 99国产精品白浆在线观看免费| 91国内在线视频| 国产精品av免费在线观看| www.精品av.com| 久久综合久久88| 欧美一区二区三区艳史| 国产综合在线观看视频| 不卡一卡2卡3卡4卡精品在| 久久久噜噜噜www成人网| 久久成人免费视频| 日韩欧美一区二区在线观看| 精品一区二区日本| 91精品国产乱码久久久久久久久 | 国产肉体ⅹxxx137大胆| 91精品国产综合久久久久久丝袜| 131美女爱做视频| www.美女亚洲精品| 一区二区三视频| 日韩和欧美的一区二区| 国产中文字幕亚洲| 日韩专区在线播放|