HP E1340A User's Manual
Download Operation & user’s manual of HP E1340A Portable Generator for Free or View it Online on All-Guides.com.
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_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
266 HP E1340A Register-Based Programming Appendix C