You are on page 1of 5

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/284178443

Realization of Direct Digital Synthesis Generators Based on FPGA and PSoC


Integrated Circuits

Conference Paper · June 2010

CITATIONS READS

0 460

3 authors, including:

Eltimir Stoimenov Ivailo Milanov Pandiev


Technical University of Sofia Technical University of Sofia
20 PUBLICATIONS   14 CITATIONS    154 PUBLICATIONS   154 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Ultrahigh efficient lead-free perovskite solar cells View project

“Study of the piezoelectric response of layered microgenerators on flexible substrates” View project

All content following this page was uploaded by Ivailo Milanov Pandiev on 19 November 2015.

The user has requested enhancement of the downloaded file.


Realization of Direct Digital Synthesis Generators
Based on FPGA and PSoC Integrated Circuits
Eltimir Ch. Stoimenov1 , Georgi S. Mihov2 and Ivailo M. Pandiev3
Abstract – This paper presents an implementation of a Direct the signal at each location drives a Digital-to-Analog
Digital Synthesis (DDS) generator incorporating FPGA and Converter (DAC) which in turn generates the analog output
”System on Chip“ (PSoC) technologies. The DDS is a digitally- signal. Nowadays, one of the most effective techniques for
controlled method of generating multiple frequencies from a realization of DDS generators is by using Application Specific
reference frequency source. An evaluation board equipped with a
FPGA Spartan-3A and a PSoC (from Cypress Inc.) integrated
Integrated Circuits (ASICs) with fixed electrical parameters
circuits were used for development. PSoC is a programmable (such as the DDS function generators from Analog Devices)
integrated circuit obtaining certain analog and digital recourses or by developing electronic circuit based on FPGA (Field
with general purpose. In the current research the FPGA is Programmable Gate Array) and PSoC (Programmable-
synthesize sinusoidal, or other, signal in digital form. The System-On-a-Chip). The FPGA ICs are becoming more
synthesis itself is achieved by a Look-Up Table (LUT) containing popular and are used in many mixed-signal applications [6-8].
256 samples. An UART interface is used to transfer the To the authors’ knowledge, DDS function generators based on
information from the FPGA to a PSoC where an 8 bit digital-to- FPGA and PSoC ICs have not yet been reported in the
analog conversion (DAC) took place. Moreover, a two pole low literature. It is, therefore, the purpose of this paper to present a
pass filter (LPF) and a programmable gain amplifier (PGA) is
incorporated in the PSoC. In addition the parameters of the
programmable DDS function generator employing FPGA and
created DDS generators can be controlled by a personal PSoC ICs.
computer through a USB interface.

Keywords – Mixed-signal systems, Function generators, Direct


II. DIRECT DIGITAL SYNTHESIS (DDS) : GENERAL
Digital Synthesis, FPGA, PSoC. OVERVIEW
A frequency synthesizer, including DDS, generates mul-
tiple frequencies from one or more frequency references.
I. INTRODUCTION The block diagram of a classical DDS system is shown in
Fig.1.
n
The function generators have been found useful in many
n = 24 - 48
applications, such as analogue and mixed-signal processing,
Phase Phase to
telecommunications, and measurement systems. Additionally, Serial or
parallel
n Delta
phase
n n
register n amplitude

the principals of oscillation can be extended to construct other load


register
register
M
+ converter

Clock
types of generators, such as voltage-controlled oscillators n = 10-14
Frequency control Phase truncation
(VCOs), quartz crystal resonator sensors, voltage-to-frequency M = tuninig word 12 bits
fc
converters, etc. [1-4]. The traditional hardware realization of System clock
DAC

function generators uses closed-loop analog circuits with Amplitude


truncation
active and passive elements or digitally-controlled method of OUT
LPF
generating multiple frequencies from a reference frequency
source called Direct Digital Synthesis (DDS) [1]. The main
advantage of the DDS generators is that the typical amplitude Fig. 1. Block diagram of DDS system.
stabilization is not higher than 0,01% and the typical THD is
0,1% [5]. Generally, the DDS generators are a type of The heart of the system is the phase accumulator whose
frequency synthesizer used for creating arbitrary waveforms. content is updated once each clock cycle. Each time the phase
In them stable clock oscillator drives a Programmable-Read- accumulator is updated, the digital number, М stored in the
Only-Memory (PROM) which stores one or more integral delta phase register is added to the number in the phase
number of cycles of a sine waveform (or other arbitrary wave- accumulator register.
form, for that matter). As the address counter steps through The truncated output of the phase accumulator serves as the
each memory location, the corresponding digital amplitude of address to a sine (or cosine) look up table. Each address in the
look up table corresponds to a phase point on the sine wave
1 from 0° to 360° . The LUT contains the corresponding digital
Eltimir Ch. Stoimenov is with the Faculty of Electronics, TU-
Sofia, Kl. Ohridski 8, 1000 Sofia, Bulgaria, E-mail: amplitude information for one complete cycle of a sinewave.
e_stoimenov@tu-sofia.bg The LUT therefore maps the phase information from the
2
Georgi S. Mihov is with the Faculty of Electronics, TU-Sofia, Kl. phase accumulator into a digital amplitude word, which in
Ohridski 8, 1000 Sofia, Bulgaria, E-mail: gsm@tu-sofia.bg turns drive the DAC. Because of the symmetry of the sine
3
Ivailo M. Pandiev is with the Faculty of Electronics, TU-Sofia, wave, only data for 90° could be use for reconstruction.
Kl. Ohridski 8, 1000 Sofia, Bulgaria, E-mail: ipandiev@tu-sofia.bg

787
For an n-bit phase accumulator (n generally ranges from 44 In our development the DDS generating core is
to 32 in most DDS systems), there are 2 n possible phase implemented on a FPGA, which allows best versatility and
points. The digital word in the delta phase register, M, makes the design open for constant improvement. VHDL is
represents the amount the phase accumulator is incremented used for programming FPGA IC. On the other hand the DAC
each clock cycle. If f c is the clock frequency, then the function is accomplished by a PSoC from Cypress Inc. Using
the PSoC technology also allows implementation of the LPF
frequency of the output sinewave is equal to
and PGA on the same integrated circuit. The above functions
of DAC, LPF and PGA are realized by the graphical editor of
M × fc
f0 = . (1) PSoC Designer IDE from Cypress Inc.
2n Xilinx® Spartan®-3A Evaluation Kit from Avnet is used as
This equation is known as the DDS “tuning equation”. The a development platform for realization the circuits. It poses
frequency resolution of the system is equal to f c / 2 n . For n = the following key features related to the current design [9]:
-Xilinx XC3S400A-4FTG256C Spartan-3A FPGA;
32, the resolution is greater than one part in four billion [1].
-Cypress 8C24894 PSoC;
-USB connectivity.
III. DDS FUNCTION GENERATOR DEVELOPMENT The block diagram of the Evaluation Kit is shown in Fig. 3.
BASED ON FPGA AND PSOC The blocks of interest are patterned.

I2C Two 8-pin


The current paragraph discusses the particular hardware and Headers

software realization of DDS function generator. Also the I2C_temp


_sens
objectives and the approach are presented. User
I/Os
SPI

Done

A. Objectives SPI_ LED

memory

12MHz Clock User


USB LEDs
32kHz
Spartan-3A
Design a function generator with the following parameters: Controller
(PsOC) GPIOs
UART
XC3S400A
Ft256
JTAG

Parallel Flash
- Output signal forms : sine, triangular, square; JTAG
conn
Memory 4M x 8
/ 2M x 16

- Frequency band : 0 – 2 MHz;


- Frequency tuning method : digitally - minimum 8bits USB
Conn
Config
Mode

resolution;
- Amplitude tuning method : digitally;
16 MHz

- Output signal amplitude : ±10V; “Push”


- THD: 0.1% Buttons

- PC connectivity: via standard USB ports. 5V_USB


Power
3.3V

5V Supply 1.2V

B. Approach
Power
Jack

Fig. 3. Spartan 3A Evaluation board.


In order the above objectives to be achieved a DDS function
generator is designed with the block schematic shown in Fig.
2. The block diagram of our DDS function generator develop-
ment is presented on Fig. 4.
As it shown the FPGA contains the DDS core which
generates different waveform signals, according to our
objectives. The generated signal is transmitted through UART
interface to the PSoC for further processing.
DDS_core DAC LPF PGA
U0 The PSoC itself contains all the necessary blocks for digital
to analog conversion, filtering and amplifying the output
signal. Moreover the embedded USB interface is used for
Fig. 2. DDS development block diagram. communication with a PC. The control unit block decodes the
commands sand by a PC. Than it adjust the gain of the PGA
The DDS core, shown on Fig. 2, generates a digital signal or transmit a command to the FPGA for frequency tuning or
with a sine, triangle or square shape and passes it to a DAC. signal form. The programming of the PSoC is done on C
After the conversion the analog signal is filtered by an anti- programming language. The algorithm flowchart of the
imaging second-order Low-Pass Filter (LPF) and amplified by control unit is shown in Fig. 5.
a Programmable Gain Amplifier (PGA).

788
Uo
Contr. Unit UART UART DAC LPF PGA

GAIN
SINE_wave TRIANGLE_
wave

SQUARE_ DDS_core Control options:


wave
- wave form Contr Unit USB
- frequency tuninig
-amplitude tuning

FPGA PSoC

Fig. 4. Block diagram of DDS function generator.

On the other hand the digital section contains an UART


START interface for communication with the FPGA. Also a 16-bits
Timer for FPGA reset impulse production is implemented.
The reset impulse duration is about 1s .

Valid command NO
from the USB?
DBB00 DBB01 DCB02 DCB03
3
TIMER16_1 UART UART
TIMER16_1
TIMER16_LSB TIMER16_MSB TX RX
TX Clock Out
YES Capture CompareOut
TermCountOut
RX Input
RX Clock Out
Command for:
Command for:
-Wave form
-frequency

DIGITAL CONFIGURATION
-Gain

BLOCKS
7 GIO 0 7 GIE 0 7 GOO 0 7 GOE 0
RIO[0]
RIO[1]
RIO[2]
RIO[3]

DBB00 DBB01 DCB02 DCB03


Send the Adjust the 3

TIMER16_1 TIMER16_1 UART


UART
RX
TX
command to gain of the PORT_2_1
TIMER16_LSB

Capture
TIMER16_MSB

CompareOut TX Clock Out


RX Input

RX Clock Out

the FPGA! PGA! TerminalCountOut TX Output RX Output

RIO[0]
RIO[1]
RIO[2]

Fig. 5. Control unit flowchart. RIO[3]

PORT_5_0
PORT_5_2

The DDS core block from Fig. 4 incorporates three sub PORT_0_3
PORT_0_5

blocks. Each of these blocks produces one of the three output 2


ACB00
2
ACB01
PGA
GAIN

shapes – sine, triangle or square. The sine wave sub block has
Input
AGND
AnalogBus
Reference

the block scheme represented in Fig. 6. ASC10

DAC8
ASD11

LPF2
MSB FLOUT
CompBus

AnalogBus AnalogBus

ftw_i(N-1...0) phase(M-3...0)
ASD20 ASC21
+ z
-1
+ z
-1
0
1/4 sin
0 ampl_o(P-1...0) DAC8 LPF2
- + 1
LUT
-
LSB FLIN
Input

1
buf 0 buf 1

M-2
2 -1

phase(M-2)
phase(M-1)
phase_i(N-1...0) phase_o(N-1...0)

ACB00 ACB01
Fig. 6. Sine wave sub block. 2 PGA
GAIN
Input
ANALOG CONFIGURATION

AnalogBus
AGND
Reference

As it can be seen from the figure only one quarter of the


ASC10 ASD11
sine-wave is stored in the LUT, the rest is computed by simple
BLOCKS

DAC8 LPF2
operations (negating, subtraction), resulting in a reduced MSB FLOUT
AnalogBus VompBus
memory requirement. The resolution of the frequency tuning
word (FTW), the phase and the amplitude can be defined ASD20 ASC21

DAC8 LPF2
separately [10]. LSB FLIN

A screen shot taken from PSoC Designer IDE (Cypress Input

inc.) is presented in Fig. 7. As is shown in the “Analog buf 0


buf 1

Configuration Blocks” section the 8-bits DAC is connected


with a second-order anti-imaging LPF. The filtered out signal
is passed to a PGA for an output signal amplitude adjustment. Fig. 7. PSoC Designer IDE – DDS project screen shot.

789
Fig. 8. Sinusoidal output signal. Fig. 9. Triangle output signal. Fig. 10. Square output signal.

Solution: Buffering and amplifying the signal from the


IV. EXPERIMENTAL RESULTS AND DISCUSSIONS PSoC will resolve the problem.
This chapter presents some oscillograms from the experi-
mental studies. The following technical equipment was used: IV. CONCLUSION
Xilinx Spartan – 3A Evaluation Kit; Tektronix 1002B
Oscilloscope (oscilloscope setup: AC mode and 10X probe In conclusion we can restate that DDS is very modern and
attenuation); Personal computer. pliable technology. It allows flexible control of all the para-
Fig. 8 through Fig. 10 shows the sinusoidal, triangle and meters of interest. Moreover the technology is not resource
square output signals respectively. The signals amplitude and demanding and is convenient for implementation in micro-
frequency are 1V and 114 Hz , respectively. processor and mixed signal systems. Also using a FPGA and
After analyzing the results a comparative table between the PSoC ICs greatly reduces the design workload and makes the
desired and achieved results could be make (Table 1). system even more flexible.
By our personal opinion the objectives stated in chapter III
TABLE I are fulfilled sufficiently. Of course, the main problems,
COMPARISON BETWEEN DESIRED VALUES AND ACHIEVED described in chapter IV, should be addressed in future deve-
EXPERIMENTAL RESULTS lopments.
Parameter Desired Achieved
sine, triangular, ACKNOWLEDGEMENT
Output signal shapes DONE
square
Frequency band 0 – 2 MHz 0 – 200 Hz This paper is a part of a project under contract №
Frequency tuning digitally / minimum 102pd209-3/2010, which is sponsored by the research
DONE program of the Technical University of Sofia, Bulgaria.
method 8bits resolution
Amplitude tuning DONE – 16
digitally
method levels REFERENCES
Output signal
±10V 0 - 3.3V
amplitude [1] W. Kester, Analog-Digital Conversion. Analog Devices, MA,
THD: 0.1% Future study 2004.
via standard USB [2] V. Tietze, Ch. Schenk. Halbleiter-Schaltungstechnik. 12. Auf-
PC connectivity DONE
ports lage. New York. Springer-Verlag, 2002 (in German).
[3] M. Ferrari, V. Ferrari, K. Kanazawa, Dual-harmonic oscillator
The table reveals the main problems of the development: for quartz crystal resonator sensors, Sensors and Actuators, vol.
145 (6), pp. 131-138, 2008.
Problem 1 - Frequency bandwidth: [4] W. Sansen, Analog design essentials. New York, Springer 2006.
The achieved frequency bandwidth is in orders lower than [5] M. Seifart, Analoge Schaltungen. 6 Auflage. Verlag Technik
the desired. Our study and analysis shows that the root cause Berlin, 2003 (in German).
is the low data transfer rate between the FPGA and PSoC. The [6] A. Amara, F. Amiel, T. Ea, FPGA vs. ASIC for low power
UART, connecting the two ICs, appears to be constrained to applications, Microelectronics Journal, vol. 37, pp. 669–677,
about 37,5 kbps. Higher transfer rates lead to data errors. 2006.
Solution: Using another connecting protocol and finding [7] J. Kalomiros, J. Lygouras, Design and evaluation of a hard-
better communication lines between the FPGA and PSoC may ware/software FPGA-based system for fast image processing,
improve the results. Microprocessors and Microsystems, vol. 32, pp. 95–106, 2008.
[8] Y.-H. Seo, H.-J. Choi, J.-S. Yoo, D.-W. Kim, An architecture of
Problem 2 - Output signal amplitude: a high-speed digital hologram generator based on FPGA,
The achieved output signal is unipolar and with small Journal of Systems Architecture, vol. 56, pp. 27–37, 2010.
amplitude. The explanation is clear – the output of the PSoC [9] http://www.em.avnet.com/spartan3a-evl
is directly connected to the output of the system. [10] http://opencores.org/project,dds_synthesizer

790

View publication stats

You might also like