Application of DAC7714 in the design of embedded laser tracker

Publisher:少年不识愁滋味Latest update time:2018-04-07 Source: 21icKeywords:DAC7714 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    Device drivers play an extremely important role in the Linux kernel. In an embedded system, except for the CPU, memory and a few other components, all device control operations must be completed by the driver. System designers must develop corresponding drivers for each peripheral in the system, otherwise the device will not work properly under Linux.

    In an embedded laser tracker based on the AT91RM9200 processor, in order to achieve fast and stable tracking of the target, it is necessary to control two motors, namely, the azimuth motor and the pitch motor. The principle is as follows: by continuously reading the data of the two angle encoders , the deviation between the actual angle of the two motors and the expected angle is calculated, and the two motors are driven to track the target using the principle of feedback control. When the control voltage of the two motors is 5V, the motors stop; when the control voltage is 0V, the motors rotate clockwise at the maximum speed; when the control voltage is 10V, the motors rotate counterclockwise at the maximum speed.

    According to the above control requirements, a 4-channel 12-bit serial DA converter, DAC7714, is selected as the control driver chip for the two motors. The quality of the driver of this chip under the embedded Linux system will directly determine the tracking effect of the entire instrument, and it is also one of the basic problems that need to be solved in embedded development.

    1 Overview

    DAC7714 is a 4-channel 12-bit serial input, voltage output DA converter launched by TI of the United States. Its power supply voltage is ±15 V, and it can realize automatic output retention. In addition to saving the resources of the single-chip microcomputer , this serial port chip also has the advantage of simultaneously outputting multiple 0-10 V (reference voltage is +10 V and 0 V), which is particularly suitable for occasions where MCU resources are scarce and there are many control channels.

    DAC7714 performance features:

    1) 12-bit resolution, serial interface;

    2) Power consumption is only 250 mW;

    3) 4 analog output channels, voltage output;

    4) Linear error ±1LSB;

    5) Support unipolar (0~10 V) or bipolar (-10 V~+10 V) output;

    6) Automatic output hold;

    7) The reset signal is optional, and different reset modes have different initial values.

    2 Hardware Design

    The hardware of the embedded laser tracker is relatively complex. Here we will introduce the hardware connection between the DAC7714 and AT91RM9200 related to the motor drive. Since the motor power is relatively large in actual use, it is necessary to add a driving circuit to the two outputs of the DAC7714 to truly drive the motor.

    2.1 DAC7714 pins and functions

    DAC7714 is a SOJ 16 package, and the specific pins and functions are described as follows:

    VOUTA~VOUTD: 4 analog outputs

    CS: Chip select terminal, low level is effective

    CLK: serial data clock terminal

    V CC : Positive power supply , typically +15 V

    VSS: Negative power supply, usually 0 or -15 V

    GND: Ground

    VREFL: Analog output voltage reference (lower limit)

    VREFH: Analog output voltage reference (upper limit)

    SDI : Serial Data Input

    LOADDACS: Conversion end judgment bit

    RESET and RESETSEL: Chip reset setting bits

    2.2 DAC7714 Hardware Design

    The hardware design of DAC7714 is relatively simple. Its programmable pins RESET, LOADDACS, CS, CLK, and SDI are connected to the IO ports PA0-PA1 and PA3-PA5 of AT91RM9200 respectively, laying the foundation for the next step of driver development; its VOUTA and VOUTB are connected to the control signals of two motors; VREFL is grounded, and VREFH is connected to +10 V, using a unipolar connection method. The specific connection is shown in Figure 1.

   a.JPG


    3 Driver Design

    The purpose of the driver is to drive the hardware to work properly, so the driver should be written for specific hardware. In the embedded laser tracker, it is necessary to write a driver for DAC7714, and the kernel will call and manage the chip in the form of a device node. DAC7714 is a serial DA converter. It is necessary to control the above pins of AT91RM9200 according to its working timing diagram, simulate its working timing, and complete the driver design in the kernel Linux-2.4.19.

 

    3.1 DAC7714 working timing diagram

    To complete a digital-to-analog conversion, DAC7714 needs to serially output 16 bits of data to SDI on the rising edge of CLK while CS is low. Among the 16 bits of data, the combination of the first two bits A1 and A0 will determine the conversion output of a certain channel (00-A channel, 01-B channel, 10-C channel, 11-D channel), the next two bits are invalid bits, and the last 12 bits of data are the data that really need to be converted. Its working timing diagram is shown in Figure 2.

   b.JPG

    3.2 Driver Program Composition

    As a device file, the DAC7714 driver is also divided into several operations such as open, write, and release. For the kernel, DAC7714 is a character device, and the device is named Name[] = "DAC7714drv". This module is dynamically loaded using the insmod command and dynamically unloaded using the rmmod command. The DAC7714 driver mainly consists of a registration function, a deregistration function, an initialization function, and a DA output function.

    When a user uses the insmod command to load a module, the following registration function is actually called:

    c.JPG

    When the open function is used in the application to open the DAC7714 device, the following function is actually called to complete the initialization operation of the corresponding pins of the controller (using PA0 connected to RESET as an example):

   d.JPG
e.JPG


    In the DAC 7714_write function, the PA0-PA5 pin levels of AT91RM9200 are controlled to simulate the timing of Figure 2 to complete the DA output, as shown in the flow chart 3.

    h.JPG


    4 Test Program Design

    In the test program, the 4 outputs of DAC7714 are tested separately. The test method is to measure the voltage output value of the corresponding channel of DAC7714 through a multimeter or oscilloscope for the specified digital quantity . If the value is consistent with the theoretical value, it means that the driver is correct.

    First, call the open function to open the DAC7714 device, then control the digital quantity to increase by 1 from 0, and combine the channel number to generate the control digital quantity that the DAC7714 can recognize, then call the write function to control the output, and when the control digital quantity reaches the maximum value, switch to the next channel. The main code of the test program is as follows.

    i.JPG
j.JPG


    5 Conclusion

    This paper presents the hardware design of DAC 7714. In the AT91RM9200+ embedded Linux environment, the design method based on its driver and test program is introduced in detail, revealing the general rules of embedded development. In the actual test process, the actual output voltage of the 4 channels is compared with the theoretical voltage, and the maximum error is 0.1%, which can fully meet the requirements of laser tracking.


Keywords:DAC7714 Reference address:Application of DAC7714 in the design of embedded laser tracker

Previous article:Classification and functions of ARM microprocessor instructions
Next article:Design of computer mouse control system based on STM32F103RCT6

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号