• Based on DSP PDIUSBD12 chip application development

    Abstract this article introduced USB chip PDIUSBD12 and the DSP usage, has designed a USB-PC104 embedded extension plate change, and explained in detail its software and hardware realizes.
    Key word PDIUSBD12   DSP   USB 

    First, PDIUSBD12 chip introduction

    Before carrying on the USB development, must act according to the cost and the performance choice appropriate USB connection chip. At present the USB controller chip usual separable becomes 3 kinds:

    The first kind is the USB design chip specially, this kind of chip’s important source is the CYPRESS M8 series and the ScanLogic SL11R series chip. This kind of chip is to use in USB using the equipment, but designs specially, but is not transforms in the old structure, thus its function realizes can achieve the optimization, but develops is quite difficult, must study the brand-new set of instructions, moreover the price is expensive.

    The second kind is and the existing chip is compatible. Majority and 8051 series chips are compatible, like AMD Corporation’s AM186T and Motorola 68HC05/8. This kind of chip’s merit was the exploiter already was familiar with the existing chip the structure and the set of instructions, will develop will be quite easy.

    The third kind is needs the exterior microprocessor connection the USB chip. This kind of chip is only responsible to process the USB correspondence, it must work together in addition with the monolithic integrated circuit chip. Typical mainly has NS Corporation’s USBN9603, NetChip Corporation’s NET2888, Philip Corporation’s PDIUSBD11/12 and so on. Uses such chip the biggest advantage is hardware’s structure has the very big flexibility, is advantageous displays monolithic integrated circuit’s fine performance, simultaneously the price is cheap.

    After overall evaluation above several kind of chips, this topic decided that selects Philip Corporation’s PDIUSBD12 chip. This may use to the DSP familiar superiority, speeds up the product the development advancement, meanwhile can enhance system’s extendibility, is advantageous for the choice high performance the monolithic integrated circuit. This chip only supports the USB1.1 agreement, requests the high system regarding the speed to be possible to use the support USB2.0 agreement signal which the later word mentioned to transfer the plate change.

    Chip architecture is quite simple based on USB1.1 Philip Corporation’s PDIUSBD12, it must the monolithic integrated circuit coordination be able to complete the USB correspondence function. The monolithic integrated circuit carries out the PDIUSBD12 chip correspondence function order by the read-write exterior memory’s way. The chip will produce business to give its concrete USB operational order. Its base pin chart explanation like chart 1:

    Figure 1 PDIUSBD12 base pin chart

     

    Second, USB-PC104 transfers the plate change design

           Is expensive as a result of the embedded motherboard price, but may use a cost low USB peripheral device in many application situations to substitute. Here USB peripheral device represents the embedded system itself not to be able to move independently, needs the PC machine software and hardware support. Such embedded system must solve the first question is the development USB-PC104 signal transfers the plate change to substitute the embedded motherboard together. Needs to transform the USB main line and the PC104 main line’s signal reason lies in may let the system like this both have the USB equipment’s merit and to have the PC104 main line equipment’s redundant reliability. Uses the DSP chip to be possible to raise system’s speed to achieve with the embedded motherboard main line’s request.

           1st, hardware design

           Hardware design’s main diagram as shown in Figure 2:

    Figure 2 revolution of plate change hardware main body diagram

           Its prime task principle is: Visit PC-104 main line equipment’s order which sends out from main engine’s application procedure, transforms after the first floor USB driver it for the corresponding USB equipment standard requests to deliver USB connection chip PDIUSBD12 (to hereafter refer to as D12), moves receives this request in the DSP firmware program, to the PC104 main line execution corresponding order, will thus achieve controls the PC-104 bus hardware’s goal.

    2nd, firmware program development

           The firmware program movement in the USB auxiliary equipment’s monolithic integrated circuit, responds USB each kind of request which and the data transmission by it the main engine transmits. Firmware’s composition mainly has two major parts, ISR (interrupt routine) and the master routine. The interrupt routine movement in the backstage, is responsible for the USB chip and the monolithic integrated circuit MPU USB request interrupt response and the data transmission, after the interrupt routine receives the USB request which and the data, the main engine transmits passes along it for the master routine and establishes the corresponding flag bit. The master routine movement in the onstage, it acts according to the interrupt routine to pass to its data and the flag bit carries on the actual hardware movement. Between the backstage ISR interrupt service and the onstage master routine circulation’s data exchange realizes through the event flag and the data buffer. For example the PDIUSBD12 batch output vertex may use the circulation the data buffer, when PDIUSBD12 receives a data packet from USB that to have an interrupt request to MPU, MPU responds the interrupt immediately. The firmware transfers to ISR the data packet from the PDIUSBD12 interior buffer for data buffer, and is clear spatial PDIUSBD12 the internal buffer to enable afterward to receive the recent data packet. MPU may continue its current foreground task, after completing the task returns to the main loop. Simultaneously inspects in the circulation buffer whether to have the recent data and start other foreground task

           The compilation firmware program available assembly language or the C language, have KEIL with the C language the C compiler’s support. But their procedure frame is as a whole same. Main body procedure frame as shown in Figure 3:


    Figure 3 firmware master routine frame

    3rd, driver development

           Because the modern operating system to resources and so on memory, port has taken the protective measures. The application procedure generally cannot visit the hardware directly, must through equipment’s driver. The device driver is direct and the hardware has to do, and moves in the operating system kernel mode, it looks like the operating system essence to have the highest movement jurisdiction equally, therefore it may visit the hardware directly.

           The USB equipment must use WDM (Win32 Driver Model) the driver model, it is the WIN32 driver model which Microsoft Corporation defines. WDM is the operating system develops present’s one kind of new driver model, now already became the Windows operating system driver the mainstream.

           Under the Windows system, has to do with the application procedure mainly has five models: Hardware level, hardware abstract level, driver, IO management and user utilization procedure. Request place which sends out from the user application procedure downward transmits. The USB driver also divides into the customer driver, the root concentrator driver and the main line driver. The user mainly develops the customer driver then, zhen other first floor’s operating system already prepared for the user. The customer driver (namely general procedure’s function) is also composed of a series of routines, it does not have the main() function entrypoint. Therefore, the USB equipment and the driver has to do must by operating system’s IO management participation, it used one kind of entire ability to be called the IO request package is IRP. The prime task principle is as follows:

    (1)      Starts when the user application procedure sends out the request to the driver (Windows the API function), and will be related the data packs the IRP, IO supervisor to catch this IRP package and to carry on corresponding processing.

    (2)      The IO supervisor transmits the IRP request package to the customer driver, requested that the customer driver carries on corresponding processing.

    (3)      The customer driver processes IRP which receives, after supposing the related environment, will pass to the first floor driver, finally will complete by the main line driver to hardware’s operation, and will return finally.

    The user must do the matter develops the customer driver. What this topic with is based on the WIN2000 DDK DriverWorks driver development kit, meanwhile wants the VC 6.0 translation environment. This kind of tool might produce the driver frame, the user carries on the function which revised themselves and joins to realize then, greatly reduced the development time.

    4th, user application procedure

    The application procedure realizes hardware function complete manifestation. But the application procedure cannot visit the USB equipment directly, it must with the driver correspondence, visit the USB equipment first through the driver. Its work is to the hardware transmission data or the order, these data and the order pass through by the driver layer upon layer process, finally transmits to the hardware realizes the related movement. The application procedure and the driver have to do are mainly through operating system’s API function.

    Its principle of work is as follows:

    (1)     The application procedure through transfers CreateFile the API function to obtain the USB equipment’s handle. This mark link contains a closed region only identifier (globally unique identifier, GUID). GUID is 128 numbers, Windows uses for to distinguish an equipment object only.

    (2)     Through this handle, the application procedure through transfers ReadFile and WriteFile the API function comes the read-write USB equipment, returns to the data to the user buffer.

    (3)     Through this handle, the application procedure through transfers DeviceIoControl the API function to come to the USB equipment to issue the control command, realizes the specific request, this function also possibly has the corresponding data transmission.

    (4)     The application program processing receives from the USB equipment to the data, if makes a mistake, will give the corresponding warning, if succeeds, after processing, closes equipment’s handle.

     

    Reference

    1 Xu Yonghe. USB auxiliary equipment design and application. Chinese Electric power Publishing house, 2002:8~32

    2 greatness. USB connection design. Xidian University Publishing house, 2002:10~100

    3 Chen Yi. USB comprehensive work. Jan Axelson. Chinese Electric power Publishing house, 2001:10~200

    4 Xun Diandong, Xu Zhijun. Digital circuit design practical guide. 2003:591 ~708

    5 Ding Yuanjie. Monolithic microcomputer principle and application. Mechanical industry publishing house, 1998:81~208

    Share/Save/Bookmark

    Friday, November 7th, 2008 at 11:36
No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

TOP
Copyright © 51 Research and Design, Electronic Engineers website - Embedded Systems, MCU, DSP, EDA, Test and Measurement, Components, Communications, Power, Microelectronics, Semiconductors
Powered by WordPress | Theme by mg12 | Valid XHTML 1.1 and CSS 3