Downloading an
Arbitrary Waveform
The following program downloads an arbitrary waveform (sine wave with a
spike) to RAM 0 from the Input Data Register.
HP IBASIC (ARBWAVE)
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_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,Ba12;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
266 HP E1340A Register-Based Programming
Appendix C
Summary of Contents for E1340A
Page 12: ...Notes 12 HP E1340A Arbitrary Function Generator Module User s Manual ...
Page 14: ...14 HP E1340A Arbitrary Function Generator Module User s Manual ...
Page 42: ...Chapter 2 Generating Standard Waveforms with the HP E1340A 42 ...
Page 54: ...Chapter 2 Generating Standard Waveforms with the HP E1340A 54 ...
Page 58: ...Chapter 3 Generating Arbitrary Waveforms with the HP E1340A 58 ...
Page 84: ...Chapter 4 HP E1340A Sweeping and Frequency Shift Keying 84 ...
Page 130: ...Chapter 6 HP E1340A High Speed Operation 130 ...
Page 202: ...202 HP E1340A SCPI Conformance Information Chapter 7 ...
Page 218: ...218 HP E1340A Specifications Appendix A ...
Page 284: ...284 HP E1340A Register Based Programming Appendix C ...
Page 295: ...Index HP E1340A Arbitrary Function Generator User s Manual 295 ...