Downloading An Arbitrary Waveform - HP E1340A User Manual

Arbitrary function generator
Hide thumbs Also See for E1340A:
Table of Contents

Advertisement

Downloading an
Arbitrary Waveform
HP IBASIC (ARBWAVE)
266 HP E1340A Register-Based Programming
The following program downloads an arbitrary waveform (sine wave with a
spike) to RAM 0 from the Input Data Register.
1
!RE-SAVE"ARBWAVE"
2
!Program which demonstrates how to download an arbitrary waveform
3
!to the AFG.
4
!
10
!Compute the E1340 base address in E1300 A16 address space
20
COM Base_addr,REAL Waveform(0:4095)
30
Base_addr=DVAL("1FC000",16)+(80*64) !base address
40
!
50
!Compute the arbitrary waveform points
60
FOR I=0 TO 4095
70
Waveform(I)=SIN(2*PI*(I/4095))
80
NEXT I
90
Width=50
100 FOR J=1 TO (Width/2)
110
Waveform(J+1023)=Waveform(J+1023)+J*.04
120 NEXT J
130 FOR J=1 TO (Width/2)
140
Waveform(J+1023+Width/2)=Waveform(J+1023+Width/2)+1-(J*.04)
150 NEXT J
160 !
170
Scale_factor=2047/(MAX(MAX(Waveform(*),ABS(MIN(Waveform(*))))))
180 FOR I=0 TO 4095
190
Waveform(I)=(Waveform(I)*Scale_factor)+2047
200 NEXT I
210 !
220 !Reset the AFG
230 Afg_reset
240 !Set function and load RAM
250 Function(16,0) !arbitrary waveform in RAM 0
260 !Load RAM 0 from the Input Data Register
270 FOR I=0 TO 4095
280
WRITEIO -9826,Base_addr+12;Waveform(I)
290 NEXT I
300 !Set the frequency (frequency register 1)
310 Frequency1(10000) !10 kHz
320 !Set amplitude, offset, impedance, correction
330 Amplitude(5,0,50,0) !5 Vpk, 0V, 50 ohms, correction enabled
Appendix C

Advertisement

Table of Contents
loading

Table of Contents