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精品综合久久久久久五月天_国产精品一区电影_中文字幕欧美日韩一区二区_亚洲一区二区三区精品动漫
国产欧美在线看| 欧美性受xxxx黑人猛交88| 国产黄视频在线| 国产精品一区二区a| 国产在线xxxx| 国外色69视频在线观看| 日韩精品大片| 日本人妻伦在线中文字幕| 亚洲蜜桃av| 欧美激情精品久久久久| 久热精品视频在线免费观看| 国产精品日韩欧美一区二区三区| 久久久久久九九| 精品国产一区二区三区四区在线观看 | 国内视频一区| 欧美精品一区二区视频| 日韩免费电影一区二区三区| 日韩国产高清一区| 日本黄网免费一区二区精品| 日韩精品av一区二区三区| 欧美一区二区中文字幕| 欧美人与性禽动交精品| 欧美亚洲在线播放| 加勒比在线一区二区三区观看| 国产综合精品一区二区三区| 高清视频在线观看一区| 国产精品69久久久| 精品国产自在精品国产浪潮| 国产精品久久久久久久久久久久 | 99国产在线观看| 国产ts人妖一区二区三区| 久久综合九色欧美狠狠| 国产成人精品在线观看| 麻豆成人在线看| 亚洲精品高清国产一线久久| 天天爱天天做天天操| 青青青免费在线| 国产日韩欧美成人| 欧美精品亚州精品| 亚洲国产高清国产精品| 日韩网址在线观看| 国产专区精品视频| 91久久夜色精品国产网站| 日韩视频免费中文字幕| 九九久久国产精品| 日韩人妻精品一区二区三区 | 精品日产一区2区三区黄免费| 国产欧美日韩91| 国产成人在线视频| 国产精品流白浆视频| 亚洲欧美日韩精品在线| 日韩av不卡在线播放| 麻豆av免费在线| 久久影视中文粉嫩av| 国产精品成人一区二区三区吃奶| 亚洲www永久成人夜色| 韩国精品久久久999| 国产极品尤物在线| 欧美xxxx14xxxxx性爽| 午夜精品蜜臀一区二区三区免费| 欧美 日韩 激情| 91九色国产视频| 国产精品免费一区二区三区| 亚洲国产一区二区三区在线| 免费观看精品视频| 久久久久国产精品视频| 精品国产无码在线| 热re99久久精品国产99热| av资源一区二区| 久久伊人精品一区二区三区| 日韩欧美黄色大片| 91精品国产91久久久久久最新 | 亚洲7777| 国产伦视频一区二区三区| 久久久精品久久| 日本中文字幕久久看| 国产九色精品| 久久成人精品视频| 免费在线一区二区| 久久精品日产第一区二区三区精品版 | www..com日韩| 久久综合88中文色鬼| 日韩免费观看av| 久久久亚洲影院你懂的| 在线亚洲美日韩| 国产欧美久久久久| 国产精品久久亚洲7777| 日韩国产小视频| 久草资源站在线观看| 午夜精品一区二区在线观看的| 福利视频一区二区三区四区| 欧美日韩第一页| 国产美女精品视频| 欧美日韩xxxxx| 国产专区在线视频| 欧美精品一本久久男人的天堂| 国产一区二区免费在线观看| 久久天天躁夜夜躁狠狠躁2022| 极品尤物一区二区三区| 久久精品久久久久久| 激情图片qvod| 欧美另类69精品久久久久9999| 国产专区一区二区| 精品国产一区二区三区日日嗨| 国产欧美亚洲精品| 一区二区成人国产精品| 91精品国产综合久久男男| 无码aⅴ精品一区二区三区浪潮| 国产二区一区| 欧洲精品视频在线| 国产成人久久久| 激情五月六月婷婷| 欧美精品www| 超碰在线观看97| 亚洲一区三区视频在线观看| 国产精品18毛片一区二区| 日韩av黄色网址| 国产精品美女免费视频| 国产男女免费视频| 天天综合狠狠精品| 久久久www成人免费精品| 国产熟人av一二三区| 亚洲一二三区精品| 国产xxxx振车| 国产在线不卡精品| 一区二区三区av| 国产精品69页| 国产在线不卡精品| 亚洲精品日韩在线观看| 久久精品2019中文字幕| 国产日韩欧美在线观看| 亚洲在线观看视频网站| 视频在线一区二区| 国产欧美日韩免费| 日韩伦理一区二区三区av在线| 国产精品二区三区| 久久久天堂国产精品女人| 欧美二区在线视频| 亚洲影院污污.| 国产精品久久网| 成人综合国产精品| 欧美资源一区| 亚洲一区制服诱惑| 国产精品久久久久久久久久久久 | 91精品国产91久久久久| 内射国产内射夫妻免费频道| 一本久道中文无码字幕av| 久久韩国免费视频| 国产精品亚洲精品| 欧美精品一区在线发布| 亚洲五月六月| 国产精品久久久久久久久影视 | 精品一区二区久久久久久久网站| 亚洲巨乳在线观看| 欧美成年人视频| 国产mv免费观看入口亚洲| 国产伦精品一区二区三| 欧美一区二区综合| 色爱区成人综合网| 欧美激情一二区| 精品国产一区二区三区在线观看| 91九色视频在线观看| 国内自拍中文字幕| 欧美在线播放cccc| 天天摸天天碰天天添| 欧美精品成人91久久久久久久| 国产精品青草久久久久福利99| 久久久人成影片一区二区三区 | 久久久日本电影| 成人免费在线网址| 麻豆传媒一区二区| 日韩精品久久一区二区三区| 亚洲精品欧美日韩专区| 欧美日韩国产91| 国产精品久久久久久av下载红粉| 久久青青草原一区二区| 91国产丝袜在线放| 91九色蝌蚪成人| yellow视频在线观看一区二区| 国产原创精品| 国产在线播放91| 国内精品在线观看视频| 欧美亚洲另类视频| 日本不卡久久| 日韩视频精品| 日本精品在线视频| 日韩最新中文字幕| 日本一区二区三区在线视频| 亚洲在线不卡| 亚洲最大成人网色| 亚洲人成网站在线播放2019| 亚洲色成人www永久在线观看| 在线视频一区观看| 一道本在线观看视频| 91免费版网站在线观看| 91蜜桃网站免费观看| youjizz.com亚洲| 91美女片黄在线观看游戏| 91精品国产高清自在线| 久久久亚洲国产天美传媒修理工|