{###########################################################################}

procedure ShiftIn2400;
//holt AD24temp aus LTC2400
begin
  STRAD24:=low;
  AD24temp:=0;
  for j:=0 to 3 do
    SCLK:=high;
    if (j=2) then
      NegativeFlag:=(not SDATAIN1);
    endif;
    if (j=3) then
      OverloadFlag:=SDATAIN1;
    endif;
    SCLK:=low;
  endfor;
  for j:=0 to 23 do
    AD24temp:=AD24temp shl 1;
    if SDATAIN1 then
      AD24temp:=AD24temp or 1;
    endif;
    SCLK:=high;
    nop;
    SCLK:=low;
  endfor;
  for j:=0 to 3 do
    SCLK:=high;
    nop;
    SCLK:=low;
  endfor;
  STRAD24:=high;
  if NegativeFlag then
    AD24temp:= 0;
  endif;
  if OverloadFlag then
    AD24temp:= 16777215; // 2^24-1
  endif;
end;


