'--------------------------------------------------------------
'    ltc1257.bas  (c) 2002-2003 MCS Electronics
'--------------------------------------------------------------
'this sample shows how to write to the LTC1257

'some aliases
Din Alias Portb.0
Clock Alias Portb.1
Cload Alias Portb.2

Config Portb = Output

'initial state
Reset Clock
Set Cload

Dim W As Word

'value to write
W = 1000

'12 bits are used so shift to left
Shift W , Left , 4
'shiftout the data
Shiftout Din , Clock , W , 1 , 12 , 10
'give load pulse
Reset Cload
Waitms 1
Set Cload

End