![Atmel STK511 Скачать руководство пользователя страница 23](http://html.mh-extra.com/html/atmel/stk511/stk511_user-manual_3003507023.webp)
STK511 Receiver Interface Board
STK511 User Guide
4-9
4842B–AVR–10/09
{
//-- Sync:
while(TestBit(PINB,RX_DATA)) // Wait to Synchronization pulse
begin (neg edge)
{
// Timeout nach > 800
μ
s !!!
}
delay_us(50);
// Short Delay
while(!(TestBit(PINB,RX_DATA))) // Wait to Synchronization pulse
end
(pos edge)
{
// Timeout nach > 300
μ
s !!!
}
delay_us(50);
// Short Delay
//-- Program:
if(!(TestBit(cTempByte,cBitPos-1// If the current bit is low,
made an low-impulse:
{
delay_us(TimeT4);
// Delay until programmingpulse (
t4+((t5-t7)/2) )
SetBit(DDRB,RX_DATA); // Begin the programming pulse
(PortB.4
// Output=Low)
delay_us(TimeT7);
// WaitUs 200
μ
s for (t7)
ClearBit(DDRB,RX_DATA); // End the Programming pulse
(PortB.4
// Input=Open)
}
delay_us(50); // Short Delay
}
iQuit = 1;
}
delay_us(2000);
// Wait until the Rx is finished
//--- No Errors occurs:
return ERR_Ok;
} //
End of WriteLIMITReg
)