User Manual

Implementation Details
VirtualWire 9 of 13
for (i = 0; i < buflen; i++)
{
Serial.print(buf[i], HEX);
Serial.print(" ");
}
Serial.println("");
// Send a reply
vw_send((uint8_t *)msg, strlen(msg));
}
}
6.0 Implementation Details
Messages of up to VW_MAX_PAYLOAD (27) bytes can be sent
Each message is transmitted as:
36 bit training preamble consisting of 0-1 bit pairs
12 bit start symbol 0xb38
1 byte of message length byte count (4 to 30), count includes byte count and FCS
bytes
n message bytes
2 bytes FCS, sent low byte-hi byte
Everything after the start symbol is encoded 4 to 6 bits, Therefore a byte in the message
is encoded as 2x6 bit symbols, sent hi nybble, low nybble. Each symbol is sent LSBit
first.
The Arduino Diecimila clock rate is 16MHz => 62.5ns/cycle.
For an RF bit rate of 2000 bps, need 500microsec bit period.
The ramp requires 8 samples per bit period, so need 62.5microsec per sample => inter-
rupt tick is 62.5microsec.
The maximum message length consists of
(6 + 1 + VW_MAX_MESSAGE_LEN) * 6 = 222 bits = 0.11 secs (at 2000 bps).
The code consists of an ISR interrupt handler. Most of the work is done in the interrupt
handler for both transmit and receive, but some is done from the user level. Expensive
functions like CRC computations are always done in the user level.
7.0 Performance
Unit tests show that the receiver PLL can stand up to 1 sample in 11 being inverted by
noise without ill effect.