Download - Projektlabor
Download - Projektlabor
Download - Projektlabor
Erfolgreiche ePaper selbst erstellen
Machen Sie aus Ihren PDF Publikationen ein blätterbares Flipbook mit unserer einzigartigen Google optimierten e-Paper Software.
;//Look for the first Packet (SEQ=0001)<br />
push regTemp ;//Save temp to stack (we need<br />
to destroy it because we want to filter sequence number)<br />
andi regTemp, 0b11110000 ;//Filter sequence number<br />
cpi regTemp,0b00010000 ;//Check if sequence number is 0001<br />
(first packet)<br />
pop regTemp ;//Restore temp (we had to destroy it because we<br />
wanted to filter out the sequence number)<br />
breq intReciveByteFromUart_storebyte_1 ;//Store byte<br />
rjmp intReciveByteFromUart_cancel_1 ;//Cancel if the sequence number does not fit.<br />
intReciveByteFromUart_storebyte_1: ;//The packet was for us, we will store it<br />
push regTemp ;//Save temp to stack (we need<br />
to destroy it because we want to filter data)<br />
andi regTemp, 0b00001111 ;//Ok, the packet fits, lets forget the<br />
sequence number<br />
andi regLowerValueByte, 0b11110000 ;//Forget the old halfbyte value in data<br />
register<br />
add regLowerValueByte, regTemp ;//Update halfbyte<br />
pop regTemp ;//Restore temp (we had to destroy it because we<br />
wanted to filter data)<br />
intReciveByteFromUart_cancel_1: ;//The packet was not for us, do<br />
nothing and continue.<br />
;//Look for the sacond Packet (SEQ=0010)<br />
push regTemp ;//Save temp to stack (we need<br />
to destroy it because we want to filter sequence number)<br />
andi regTemp, 0b11110000 ;//Filter sequence number<br />
cpi regTemp,0b00100000 ;//Check if sequence number is 0010<br />
(sacond packet)<br />
pop regTemp ;//Restore temp (we had to destroy it because we<br />
wanted to filter out the sequence number)<br />
breq intReciveByteFromUart_storebyte_2 ;//Store byte<br />
rjmp intReciveByteFromUart_cancel_2 ;//Cancel if the sequence number does not fit.<br />
intReciveByteFromUart_storebyte_2: ;//The packet was for us, we will store it<br />
push regTemp ;//Save temp to stack (we need<br />
to destroy it because we want to filter data)<br />
andi regTemp, 0b00001111 ;//Ok, the packet fits, lets forget the<br />
sequence number<br />
andi regLowerValueByte, 0b00001111 ;//Forget the old halfbyte value in data<br />
register<br />
rol regTemp ;//Rotate value until it fits...<br />
rol regTemp ;//Rotate value until it fits...<br />
rol regTemp ;//Rotate value until it fits...<br />
rol regTemp ;//Rotate value until it fits...<br />
add regLowerValueByte, regTemp ;//Update halfbyte<br />
pop regTemp ;//Restore temp (we had to destroy it because we<br />
wanted to filter data)<br />
intReciveByteFromUart_cancel_2: ;//The packet was not for us, do<br />
nothing and continue.<br />
;//Look for the third Packet (SEQ=0011)<br />
243