![Atmel STK511 User Manual Download Page 22](http://html.mh-extra.com/html/atmel/stk511/stk511_user-manual_3003507022.webp)
STK511 Receiver Interface Board
4-8
STK511 User Guide
4842B–AVR–10/09
cTempByte = *e_eep+;// Load LSB of LIMIT reg and decrement
pointer
for(cBitPos = 8; cBitPos > 0; cBitPos--)
{
//-- 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
}
cTempByte = *e_eep+;
// Load MSB of LIMIT reg and
decrement pointer
for(cBitPos = 8; cBitPos > 1; cBitPos--)