太白金星

[Course Design] Based on AD9958 direct digital frequency synthesizer +662763A

 
Overview

AD9958 Introduction

AD9958 is a DDS device with high performance, excellent dynamic characteristics and dual output produced by Analog Devices. Each channel can independently control frequency, phase/amplitude. This flexibility can be used to correct imbalances between signals caused by analog processing such as filtering, amplification, or PCB layout mismatches . Because both channels share a common system clock, they are inherently synchronized and can support synchronization of multiple devices. AD9958 integrates a 10-bit output amplitude control internally, and the internal operating frequency is as high as 500 MHz, allowing it to generate dual-channel signals with a frequency of 250MHz. There are many internal control registers for controlling output signal parameters, with 32-bit frequency adjustment resolution, 14-bit phase offset resolution, 10-bit output amplitude scalable resolution, and a serial SPI port to enhance data throughput. It can work in multiple modes, supporting single-tone signal mode (single-tone), modulation mode (modulation mode), linear sweep mode (linearsweep) and mixed signal mode. Frequency, phase or amplitude modulation (FSK, PSK, ASK) up to 16th order can be performed.

 

AD9958 serial port features and working modes

The following table shows the pin configuration table of the 4 modes:

Pin/Function/Mode 1-bit serial 2-wire mode 1-bit serial 3-wire mode 2-bit serial mode 4-bit serial mode
SCLK serial clock serial clock serial clock serial clock
CS Chip Select Chip Select Chip Select Chip Select
SDIO_0 Serial data IO Serial data IO Serial data IO Serial data IO
SDIO_1 Not used Not used Serial data IO Serial data IO
SDIO_2 Not used Serial data output Not used Serial data IO
SDIO_3 Synchronous IO Synchronous IO Synchronous IO Serial data IO

 

In serial operations, including instruction cycles and communication cycles, the instruction cycle is generally transmitted first. The instruction cycle corresponds to the first 8 rising edges of SCLK, and its corresponding instruction word (8 bits) contains the following information:

Q7ciI5Bzh2YrQKN44wviMcxk1Et5zydNBTtz8v7A.png

The figure below is the timing diagram for writing data of AD9958. SCLK is valid on the falling edge, and reading data is valid on the high level.

LFgtoKQWbEACc24v8zBKnjPWMwgVQOavW61Jslbk.png

The figure below shows the calculation formula of frequency and phase.

Z63On3UFLSqdVhAtUvHgtRzo7VDlZm2ljscM4cEg.png

STM32F429BI driver

Since bare metal is far less capable of multi-tasking, this project uses the uCOS-III real-time operating system.

Polling system (bare metal)

The polling system means that when programming bare metal, the relevant hardware is first initialized, and then the main program is continuously looped in an infinite loop to do various things sequentially.
However, if events that require detection of external signals, such as key operations, are added to simulate emergency alarms, the real-time response capability of the entire system will not be that good.
The polling system is only suitable for functional codes that are executed sequentially. When driven by external events, the real-time performance will be reduced.

operating system

We divide the main body of the program into independent small programs that loop infinitely and cannot return. We call these small programs tasks.
Each task is independent, does not interfere with each other, and has its own priority. It is scheduled and managed by the operating system.
After joining the operating system, we do not need to carefully design the execution flow of the program when programming, and we do not need to worry about whether there is interference between each functional module.

ORtP8PUiiQ31xHx1KrCtjY5NMttkFRvlOLSciCMa.png

emWin graphical interface

Just buttons and simple screen display can no longer satisfy me, so I added a graphical interface to make it look more beautiful (I just learned it, and the interface configuration is almost unreadable)

The screen is a 5-inch RGB screen (800*480) capacitive touch. In order to better utilize the graphics performance of STM32F429, it is strongly recommended to use 32-bit SDRAM. Using 16-bit SDRAM will reduce the performance by half.

These functions of emWin are designed to solve the design problems of human-computer interaction applications. And its consumption of ROM and RAM is relatively not high.
Learning emWin is to display the display effects of basic functions and commonly used controls on the LCD on the STM32 development board, so that you can have an objective visual experience instead of just staying at the code level.
STM32F429BIT6 + 32-bit SDRAM picture flash test:
If a 24-bit color block is applied to a display screen with a resolution of 800*480, 81923000/(800*480) ≈ 213 frames can be applied per second.
If you brush a 16-bit color block, you can brush 129346000/(800*480) ≈ 336 frames per second.
If you brush an 8-bit color block, you can brush 267128000/(800*480) ≈ 695 frames per second.
4NIxf75vAWEsa08FHeYZyuCwUpmyAq8SxUYDSNmP.png

! ! ! ! !

I integrated the codes of these three. In fact, it seems that there are not many, they are all learned and made now.

Based on STM32F429BI, it runs uCOS-III and emWin driver AD9958+5-inch screen.

The above is all about introducing them, and there is nothing important at all. Next, let me talk about the problems I encountered in making the board and debugging:

  1. The AD9958 board actually does not require much attention. Try to draw it as standard as possible. The key point of this chip is flexibility. It can be used to correct imbalance problems between signals caused by analog processing such as filtering and amplification or PCB layout mismatch. .
  2. The test pin of AD9958 is pin 17. When it is completely welded and powered on, the voltage of this pin is about 1.2V. Then the chip works normally. If there is a weak soldering or internal damage to the chip, the voltage of this pin is 0. (Don’t ask me why I know, I lost a piece of soldering and my 300 yuan was gone.) The package of this chip is LFCSP. Particularly easy to solder.
  3. When using microcontroller driver, SDIO_3 pin must be low level
  4. AD9958 and AD9959 common codes, the only difference is that two channels are castrated
  5. The modulation and frequency sweep of this chip are still under study, and it is estimated that it will be used in the two projects of amplitude-frequency characteristic detection device and multi-waveform radar signal source.
  6. uCOS-III needs to pay attention to the release and acquisition of semaphores and mutexes
  7. The capacitive touch screen does not require calibration and can support up to 5-finger touch. However, in emWin, I still touch with one finger to prevent accidental touches.
  8. The graphical interface needs to be optimized and debugged slowly. There are many videos on the Internet, you can check it out.
  9. Since there are no amplification and gain modules around, I haven’t done many functions. In addition, I have to review for the final exam, so I don’t have much time to do it.
  10. Since I only welded one channel interface, there were only changes in frequency and amplitude in the demonstration, but the phase could not be seen (I can’t use an oscilloscope, I’m too bad)
  11. Our school only has 100M oscilloscopes. . . . . . . So the frequency range I set is 1Hz~99Mhz
  12. I also added a file system. I wanted to add the function of taking screenshots and adding an SD card so that I could view my saved configurations. However, I ran out of time and the event was about to end, so I didn’t proceed further. I just added it in. The follow-up will be slow. slow to perfect
  13. 硬件图
  14. The video only demonstrates the frequency. Since I only welded one channel, the first channel was not displayed on the oscilloscope. The phase and amplitude can also be set, but the oscilloscope couldn't play with it, so I didn't operate it. That's it for the time being. 0.0 0.0 0.0 more
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-20 00:07:48

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

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号