1,13 → 1,6 |
// *************************************************************** |
// ** Spektrum Diversity v2.1 - use up to 4 satellite receivers ** |
// ** Spektrum Diversity v2.0 - use up to 4 satellite receivers ** |
// *************************************************************** |
// ** Spektrum DSMX Binding Extension by Johannes Stein 2011/03 ** |
// ** ** |
// ** 3 Pulses = DSM2 1024/22ms ** |
// ** 5 Pulses = DSM2 2048/11ms ** |
// ** 7 Pulses = DSMX 22ms ** |
// ** 9 Pulses = DSMX 11ms ** |
// ** ** |
// ** Target: An Atmel ATtiny2313 (RC-Oscillator @ 8 MHz) ** |
// ** controls a 74HC151 Multiplexer ** |
// *************************************************************** |
125,9 → 118,9 |
|
DDRB = 0b00000000; // Sat-Pins to input again |
|
bind += 2; |
if (bind > 9) bind = 3; // 3, 5, 7, 9 pulses, then start with 3 again |
eeprom_write_byte(&eebind, bind); // Save increased bind-pulse-counter for next binding. |
bind++; // Save increased bind-pulse-counter for next binding. |
if (bind > 6) bind = 3; // 3 pulses are for DX7+AR6200, 4-6 pulses have been seen... |
eeprom_write_byte(&eebind, bind); // around the world for other combinations. Hopefully it works for them. |
_delay_ms(500); |
} |
|
205,9 → 198,9 |
PORTB = 0b11110000; // Port B Pullup's for (unused) satellites |
PORTD = 0b1100001; // Port D Pullup's for Switch & Test, LED off |
|
if (eeprom_read_byte(&eecheck) != 0x84) // Invalid Data in EEPROM -> initialize |
if (eeprom_read_byte(&eecheck) != 0x42) // Invalid Data in EEPROM -> initialize |
{ |
eeprom_write_byte(&eecheck, 0x84); |
eeprom_write_byte(&eecheck, 0x42); |
bind = 3; |
eeprom_write_byte(&eebind, bind); |
} |