Streamer->DAC: what am I doing wrong? [solved]
pik33
Posts: 2,366
I am trying to get something i can hear on pins 0-4 using the streamer (in this case this should be a square wave). What am I doing wrong?
CON base = 0 _clkfreq = 200_000000 pub test1() coginit(0,@a_test, 0) DAT org a_test drvl #4<<6 + base 'Drive 4 pins starting from base LOW wrpin dac75,#4<<6 + base 'Set DACs @ 2V/75 Ohm setxfrq a80000000 'set streamer freq to 1:1 '' i want the streamer to output SOMETHING on pin 0..3 p103 mov ii,#10 p101 xcont m_test, #0 djnz ii,#p101 mov ii,#10 p102 xcont m_test, affffffff djnz ii,#p102 jmp #p103 dac75 long %0000_0000_000_1011100000000_01_00000_0 '75-ohm, 2.0V m_test long %0111_1111_1000_0001_0000_0000_0000_0000 + base<<17 + 65535 'imm->4xDAC affffffff long $FFFFFFFF a80000000 long $80000000 ii res 1
Comments
Solved. First wrpin, then drvl.
Edit: Yet another beginner's error. Use #3, not #4, to set 4 pins.
Right, some modes need DIR low during init or they just don't start up sensibly. So the full sequence is FLTL then WRPIN/WXPIN then DIRH. Others aren't so fussy.