' MCP4922 Dual 12bit DAC SetPin GP2,GP3,GP4,SPI SetPin GP6, DOUT Pin(GP6) = 1 SPI open 4000000,0,16 Do For a% = 0 To 4096-8 Step 64 ' CS Down (LOW Active) Pin(GP6)=0 ' DACn Write Buffer Gain_ Shutdown_ ' DWBGS junk = SPI(&B0111000000000000 + a%) ' 1st DAC Pin(GP6)=1 Pin(GP6)=0 junk = SPI(&B1111000000000000 + a%) ' 2nd DAC ' CS Pin(GP6)=1 'Print a% 'Pause 300 Next a% Loop SPI Close