Biomedical Engineering Reference
In-Depth Information
Out princont, notdaclk notdacs bit3 ' assert D/A CS' line without
' upsetting bit 3 of the Control
' port
For clocknum 11 To 0 Step 1 ' clock 12 bits of D/A channel 1
' from MSB to LSB
If (dtoa1 And (2 ^ clocknum)) 0 Then ' if current bit converts to 0
Out princont, notdacs bit3
' then do not set data bit high
' while causing a clock rising edge
' all without upsetting bit 3 of the
' Control port
For delay 1 To 5: Next delay
Out princont, notdacs notdaclk bit3 ' return clock line to low
' without upsetting bit 3 of the
Control port
Else ' if, on the other hand, current
' bit converts to one
Out princont, notdacs notdaclk dadat bit3 ' then set data bit high
' while
' maintaining the 'CS and clock
' and do not
' upset bit 3 of the Control
' port
' lines low
For delay 1 To 5: Next delay ' introduce delay to comply with IC's
' timing requirements
Out princont, notdacs dadat bit3 ' cause clock rising edge to
' clock data bit in without
' upsetting
' bit 3 of the Control port
For delay 1 To 5: Next delay ' introduce delay to comply with
IC's
' timing requirements
Out princont, notdacs notdaclk dadat bit3 ' return clock line to
' low without
' upsetting bit 3 of the
' Control port
End If
Next clocknum
' next bit
For delay 1 To 5: Next delay
For clocknum 11 To 0 Step 1 ' clock 12 bits of D/A channel 2
' in the same way
If (dtoa2 And (2 ^ clocknum)) 0 Then
Out princont, notdacs bit3
For delay 1 To 5: Next delay
Out princont, notdacs notdaclk bit3
Else
Out princont, notdacs notdaclk dadat bit3
For delay 1 To 5: Next delay
Out princont, notdacs dadat bit3
For delay 1 To 5: Next delay
Out princont, notdacs notdaclk dadat bit3
End If
Search WWH ::




Custom Search