Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 930 → Rev 931

/Spektrum-Diversity/Doku/FC12.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/Spektrum-Diversity/Doku/FC13.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/Spektrum-Diversity/Doku/FC20.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/Spektrum-Diversity/Doku/Anschluss.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/Spektrum-Diversity/Doku/FC11-FC20.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/Spektrum-Diversity/Hardware/top.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/Spektrum-Diversity/Hardware/bottom.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/Spektrum-Diversity/Hardware/bot-complete.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/Spektrum-Diversity/Hardware/bot-copper.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/Spektrum-Diversity/Hardware/bot-parts.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/Spektrum-Diversity/Hardware/bot-real.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/Spektrum-Diversity/Hardware/connections.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/Spektrum-Diversity/Hardware/diversity.brd
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/Spektrum-Diversity/Hardware/diversity.sch
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/Spektrum-Diversity/Hardware/schematic.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/Spektrum-Diversity/Hardware/top-complete.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/Spektrum-Diversity/Hardware/top-copper.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/Spektrum-Diversity/Hardware/top-parts.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/Spektrum-Diversity/Hardware/top-real.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/Spektrum-Diversity/Software/Hex-Files/diversity.hex
1,72 → 1,101
:1000000012C02AC029C028C027C027C025C024C0CC
:1000000012C02AC029C028C027C094C026C024C05E
:1000100023C022C021C020C01FC01EC01DC01CC0E4
:100020001BC01AC019C011241FBECFEDCDBF10E0F8
:10003000A0E6B0E0ECE6F4E002C005900D92A03638
:10004000B107D9F710E0A0E6B0E001C01D92A336D9
:10005000B107E1F70AD108C2D3CF1F920F920FB6B2
:100060000F9211248F939F93809160009091610073
:10007000019690936100809360009F918F910F9003
:100080000FBE0F901F90189592B3880F880F880F9E
:100090009776982B92BB8AE18A95F1F708951DBC5B
:1000A0001CBC1092610010926000089580EF87BB25
:1000B00080E293E028EC30E0F9013197F1F7019705
:1000C000D9F78091620090E028EC30E040EF09C061
:1000D00018BAF9013197F1F748BBF9013197F1F7F7
:1000E0009F5F9817A8F390E048EC50E013C09098F9
:1000F00028EE33E0FA013197F1F721503040D1F783
:10010000909A24EC39E0FA013197F1F72150304010
:10011000D1F79F5F981758F317BA8F5F80936200EB
:10012000873018F083E08093620020916200E199AB
:10013000FECF1CBA82E090E08EBB2DBB0FB6F894C8
:10014000E29AE19A0FBE88E893E128EC30E0F901E9
:100150003197F1F70197D9F7089580EF87BB80E5D4
:1001600088BB82B3877682BB9AE1892F8A95F1F7A3
:1001700026B382B38776886082BB9A95F1F7B39BEA
:1001800002C022E005C0269526952695209521706F
:1001900082B38776806182BB8AE18A95F1F7B39B4F
:1001A00023E082B38776886182BB8AE18A95F1F782
:1001B000B39924E080EA88BB82B3877682BB8AE168
:1001C0008A95F1F7B39921E082B38776886082BB84
:1001D0008AE18A95F1F7B39B22E082B3877680614A
:1001E00082BB8AE18A95F1F7B39923E082B38776DF
:1001F000886182BB8AE18A95F1F7B39B24E017BA44
:100200008699FECF48EC50E0222399F428EC30E0A8
:10021000909888EE93E0F9013197F1F70197D9F7BB
:10022000909A88E293E2F9013197F1F70197D9F7B3
:10023000EFCF30E0909888EE93E0FA013197F1F734
:100240000197D9F7909A80EA9FE0FA013197F1F788
:100250000197D9F73F5F321768F380E197E2FA011F
:100260003197F1F70197D9F7CFCF1F93DF93CF9352
:1002700000D000D0CDB7DEB717BA89E181BB80EFDF
:1002800088BB81E682BB19821A821B821C82E1999B
:10029000FECF81E090E0982F8EBBE09A8DB3823440
:1002A000E1F0E199FECF1CBA9EBB82E48DBB0FB694
:1002B000F894E29AE19A0FBE83E080936200E1999C
:1002C000FECF1CBA82E090E08EBB83E08DBB0FB600
:1002D000F894E29AE19A0FBE09C0E199FECF82E05C
:1002E00090E08EBBE09A8DB380936200859B35DFF2
:1002F000869BDCDE88EE93E028EC30E0F901319754
:10030000F1F70197D9F781E08EBD80E889BF789435
:100310001DBC1CBC1092610010926000DE011196A1
:1003200011E07AE180916000909161000A9709F4F0
:1003300090988091600090916100449729F4909A80
:10034000109261001092600040E050E0642F86B38C
:1003500090E04C5F5F4F042E02C0959587950A94FC
:10036000E2F74450504080FD14C0FD01E40FF51F3A
:10037000108382B39A0153E0220F331F5A95E1F79D
:100380008776822B82BB872F8A95F1F7633651F2ED
:1003900007C04F5F5F4F4430510509F4C3CFD6CF3C
:1003A000909A242FBE016F5F7F4FB1E0AAE11982BE
:1003B0001A821B821C821DBC1CBC10926100109210
:1003C000600006C08091600090916100049720F465
:1003D00086B3807F803FB1F31DBC1CBC10926100CE
:1003E0001092600010C086B390E0042E02C0959574
:1003F00087950A94E2F780FFB0834F5F5F4F319695
:100400004830510581F78091600090916100892BFF
:1004100021F4FB0144E050E0E6CFFB01E20FF11DC7
:1004200080818823E9F440E050E0FB01E40FF51FF0
:100430008081813079F482B39A0193E0220F331FD7
:100440009A95E1F78776822B82BB8A2F8A95F1F7FE
:10045000242F05C04F5F5F4F4430510531F790980E
:0C0460008699A5CF909AA3CFF894FFCF07
:10003000A0E6B0E0E0E4F6E002C005900D92A03644
:10004000B107D9F710E0A0E6B0E001C01D92A636D6
:10005000B107E1F777D1F2C2D3CF1F920F920FB65B
:100060000F9211248F9380916000813418F01092C8
:100070006000909A80916000882329F4809161004B
:10008000882309F041C080916000843029F4809178
:100090006100882309F042C080916000883021F41B
:1000A00080916100823080F5809160008C3021F475
:1000B00080916100823090F580916000803121F460
:1000C00080916100833000F580916000843121F4DB
:1000D00080916100833010F580916000883121F4B7
:1000E00080916100843080F4809160008C3121F433
:1000F00080916100843090F480916000833231F40B
:1001000080916200813011F4909809C08091600064
:10011000873329F480916200813009F4909A8091AC
:1001200060008F5F809360008F910F900FBE0F90E3
:100130001F9018951F920F920FB60F9211248F9354
:100140009F93809164009091650001969093650063
:10015000809364009F918F910F900FBE0F901F901E
:10016000189592B3880F880F880F9776982B92BBBB
:100170008AE18A95F1F708951DBC1CBC10926500B8
:1001800010926400089580EF87BB80E293E028EC32
:1001900030E0F9013197F1F70197D9F780916300C9
:1001A00090E028EC30E040EF09C018BAF90131972F
:1001B000F1F748BBF9013197F1F79F5F9817A8F362
:1001C00090E048EC50E013C0909828EE33E0FA013C
:1001D0003197F1F721503040D1F7909A24EC39E073
:1001E000FA013197F1F721503040D1F79F5F98170E
:1001F00058F317BA8F5F80936300873018F083E05D
:100200008093630020916300E199FECF1CBA82E0E5
:1002100090E08EBB2DBB0FB6F894E29AE19A0FBE28
:1002200088E893E128EC30E0F9013197F1F7019784
:10023000D9F7089580EF87BB80E588BB82B38776C6
:1002400082BB9AE1892F8A95F1F726B382B387762C
:10025000886082BB9A95F1F7B39B02C022E005C08B
:100260002695269526952095217082B38776806104
:1002700082BB8AE18A95F1F7B39B23E082B387764C
:10028000886182BB8AE18A95F1F7B39924E080EA1C
:1002900088BB82B3877682BB8AE18A95F1F7B399EE
:1002A00021E082B38776886082BB8AE18A95F1F784
:1002B000B39B22E082B38776806182BB8AE18A9514
:1002C000F1F7B39923E082B38776886182BB8AE134
:1002D0008A95F1F7B39B24E017BA8699FECF48ECD4
:1002E00050E0222399F428EC30E0909888EE93E0D7
:1002F000F9013197F1F70197D9F7909A88E293E2E3
:10030000F9013197F1F70197D9F7EFCF30E09098E5
:1003100088EE93E0FA013197F1F70197D9F7909AB7
:1003200080EA9FE0FA013197F1F70197D9F73F5F33
:10033000321768F380E197E2FA013197F1F70197FC
:10034000D9F7CFCFDF92EF92FF920F931F93DF93F6
:10035000CF93CDB7DEB72C970FB6F894DEBF0FBEA4
:10036000CDBF17BA89E181BB80EF88BB81E682BB34
:10037000E199FECF81E090E0982F8EBBE09A8DB39B
:100380008234E1F0E199FECF1CBA9EBB82E48DBBC2
:100390000FB6F894E29AE19A0FBE83E0809363006F
:1003A000E199FECF1CBA82E090E08EBB83E08DBB6A
:1003B0000FB6F894E29AE19A0FBE09C0E199FECF18
:1003C00082E090E08EBBE09A8DB380936300859BC2
:1003D00031DF869BD8DE19821D8219861A821E8221
:1003E0001A861B821F821B861C8218861C8688EE3A
:1003F00093E028EC30E0F9013197F1F70197D9F754
:1004000085E083BF81E08EBD82E889BF78941DBC02
:100410001CBC10926500109264008E010B5F1F4F90
:10042000FF24F394DE011996BE016F5F7F4FEAE16E
:10043000EE2E80916400909165000A9709F49098DF
:100440008091640090916500449709F5909A10920C
:100450006500109264001BC020E030E086B390E09D
:100460002C5F3F4F022E02C0959587950A94E2F7C4
:100470002450304080FF02C0FD0101C0F801E20FAE
:10048000F31FF0822F5F3F4F2430310539F7809101
:100490006400909165000397F8F220E030E0F801E5
:1004A000E20FF31F8081813051F4FD01E20FF31F51
:1004B0008081813021F4FB01E20FF31F80832F5FE5
:1004C0003F4F2430310559F740E050E0942FFB01B5
:1004D000E40FF51F8081813021F582B39A0153E04A
:1004E000220F331F5A95E1F78776822B82BB8E2D20
:1004F0008A95F1F79F5F909361009150933609F4CC
:1005000098CF242FA5E0EA2EF12CEC0EFD1E31E051
:100510008E01075F1F4FDD24D394DE0111967AE12F
:1005200006C04F5F5F4F4430510581F682CF19827C
:100530001D8219861A821E821A861B821F821B86C2
:100540001C8218861C861DBC1CBC10926500109273
:1005500064001BC040E050E086B390E04C5F5F4F0A
:10056000042E02C0959587950A94E2F744505040B6
:1005700080FF02C0F80101C0F701E40FF51F3083CE
:100580004F5F5F4F4430510539F78091640090917F
:1005900065000397F8F240E050E0F701E40FF51F23
:1005A0008081813051F4F801E40FF51F80818130A2
:1005B00021F4FD01E40FF51F80834F5F5F4F44304E
:1005C000510559F78981882381F48A81882369F448
:1005D0008B81882351F48C81882339F4233629F0C8
:1005E000D09262001092610023E640E050E0642F58
:1005F000FD01E40FF51FE081E130B1F4942F82B3E7
:10060000F3E0440F551FFA95E1F78776842B82BB00
:10061000872F8A95F1F7261711F0E09362009F5F0C
:1006200090936100262F05C04F5F5F4F4430510506
:10063000F1F686997CCF1092620079CFF894FFCFC3
:00000001FF
/Spektrum-Diversity/Software/diversity.aps
1,0 → 0,0
<AVRStudio><MANAGEMENT><ProjectName>diversity</ProjectName><Created>23-Jul-2010 13:27:06</Created><LastEdit>09-Aug-2010 16:58:21</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>23-Jul-2010 13:27:06</Created><Version>4</Version><Build>4, 18, 0, 670</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>default\diversity.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>D:\Pendsa\Spektrum-Diversity\Software\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>JTAGICE mkII</CURRENT_TARGET><CURRENT_PART>ATmega128.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>diversity.c</SOURCEFILE><OTHERFILE>default\diversity.lss</OTHERFILE><OTHERFILE>default\diversity.map</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>NO</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE></EXTERNALMAKEFILE><PART>attiny2313</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>diversity.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>0</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\Programme\WinAVR-20081205\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\Programme\WinAVR-20081205\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><ProjectFiles><Files><Name>D:\Pendsa\Spektrum-Diversity\Software\diversity.c</Name></Files></ProjectFiles><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files><File00000><FileId>00000</FileId><FileName>diversity.c</FileName><Status>1</Status></File00000></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
<AVRStudio><MANAGEMENT><ProjectName>diversity</ProjectName><Created>23-Jul-2010 13:27:06</Created><LastEdit>27-Jan-2011 09:28:44</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>23-Jul-2010 13:27:06</Created><Version>4</Version><Build>4, 18, 0, 670</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>default\diversity.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>D:\Pendsa\Kopter\Diversity\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>JTAGICE mkII</CURRENT_TARGET><CURRENT_PART>ATmega128.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>diversity.c</SOURCEFILE><OTHERFILE>default\diversity.lss</OTHERFILE><OTHERFILE>default\diversity.map</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>NO</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE></EXTERNALMAKEFILE><PART>attiny2313</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>diversity.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>0</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\Programme\WinAVR-20081205\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\Programme\WinAVR-20081205\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><ProjectFiles><Files><Name>D:\Pendsa\Kopter\Diversity\diversity.c</Name></Files></ProjectFiles><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files><File00000><FileId>00000</FileId><FileName>diversity.c</FileName><Status>1</Status></File00000></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
/Spektrum-Diversity/Software/diversity.aws
1,0 → 0,0
<AVRWorkspace><IOSettings><CurrentRegisters/></IOSettings><part name="ATMEGA128"/><Files><File00000 Name="C:\Users\FAMILY\Desktop\Multicopter - SVN\Projects\Spektrum-Diversity\Software\diversity.c" Position="345 141 584 353" LineCol="211 0"/></Files></AVRWorkspace>
<AVRWorkspace><IOSettings><CurrentRegisters/></IOSettings><part name="ATMEGA128"/><Files><File00000 Name="D:\Pendsa\Kopter\Diversity\diversity.c" Position="262 71 1682 776" LineCol="122 58" State="Maximized"/></Files></AVRWorkspace>
/Spektrum-Diversity/Software/diversity.c
1,5 → 1,5
// ***************************************************************
// ** Spektrum Diversity v1.3 - use up to 4 satellite receivers **
// ** Spektrum Diversity v2.0 - use up to 4 satellite receivers **
// ***************************************************************
// ** Target: An Atmel ATtiny2313 (RC-Oscillator @ 8 MHz) **
// ** controls a 74HC151 Multiplexer **
9,12 → 9,12
// ***************************************************************
// ** LED-Modes during startup **
// ** ************************ **
// ** LED fast flash: Waiting for first datapulse **
// ** LED fast flash: Waiting for first signal **
// ** **
// ** LED-Modes during operation **
// ** ************************** **
// ** LED OFF: Everything is fine **
// ** LED ON: FAILURE - The first selected sat had lost sync **
// ** LED flash 1x - 4x: Shows which channel is active every 2s **
// ** LED ON after flash: FAILURE - A used signal was lost **
// ** **
// ** LED-Modes after Self-Test and pressed button **
// ** ******************************************** **
35,7 → 35,10
#define LED_OFF PORTD |= 1 << PD0
#define LED_ON PORTD &= ~(1 << PD0)
 
volatile unsigned int TimerEvent;
volatile unsigned char Timer0Event = 0;
volatile unsigned int Timer1Event;
volatile unsigned char BlinkCode = 0;
volatile unsigned char failure = 0;
 
unsigned char eedummy EEMEM; // Dummy-Variable for Address 0 in EEPROM
unsigned char eecheck EEMEM; // Check-Variable
44,13 → 47,35
 
 
 
ISR(TIMER0_OVF_vect) // Triggered every 32,768 msec
{
if (Timer0Event > 64) // Max. 64*32 msec = 2,097152 sec
{
Timer0Event = 0;
LED_OFF;
}
if(Timer0Event == 0 && BlinkCode > 0) LED_ON;
else if(Timer0Event == 4 && BlinkCode > 0) LED_OFF;
else if(Timer0Event == 8 && BlinkCode > 1) LED_ON;
else if(Timer0Event == 12 && BlinkCode > 1) LED_OFF;
else if(Timer0Event == 16 && BlinkCode > 2) LED_ON;
else if(Timer0Event == 20 && BlinkCode > 2) LED_OFF;
else if(Timer0Event == 24 && BlinkCode > 3) LED_ON;
else if(Timer0Event == 28 && BlinkCode > 3) LED_OFF;
else if(Timer0Event == 35 && failure == 1) LED_ON;
else if(Timer0Event == 55 && failure == 1) LED_OFF;
 
Timer0Event++;
}
 
 
ISR(TIMER1_OVF_vect) // Triggered every 8,192 msec
{
TimerEvent++;
Timer1Event++;
}
 
 
 
void SelectSat(unsigned char sat)
{
PORTD = (PORTD & 0b1100111) | (sat << 3); // Select the input for 74HC151
59,16 → 84,16
 
 
 
void ResetTimer(void)
void ResetTimer1(void)
{
TCNT1H = 0;
TCNT1L = 0;
TimerEvent = 0;
Timer1Event = 0;
}
 
 
 
void Binding(void) // Binding sequence
void Binding(void) // Binding sequence (for Spektrum sats only)
{
unsigned char i = 0;
 
163,16 → 188,16
{
unsigned char i = 0;
unsigned char active[4];
unsigned char active_lo[4];
unsigned char active_hi[4];
unsigned char sat = 99;
 
 
DDRB = 0b00000000; // Port B Input for satellites and feedback
DDRD = 0b0011001; // Port D Output for MUX and LED, Input for Switch & Test
PORTB = 0b11110000; // Port B Pullup's for (unused) satellites
PORTD = 0b1100001; // Port D Pullup's for Switch & Test, LED off
 
for (i=0;i<4;i++) active[i] = 0; // Reset active-array
 
 
if (eeprom_read_byte(&eecheck) != 0x42) // Invalid Data in EEPROM -> initialize
{
eeprom_write_byte(&eecheck, 0x42);
185,73 → 210,111
if (!(PIND & (1<<PD5))) Testing(); // Initiate Self-Test when Test-Pad is low
if (!(PIND & (1<<PD6))) Binding(); // Initiate Binding when Bind-Button is pressed
 
 
for (i=0;i<4;i++) // Reset active-arrays
{
active[i] = 0;
active_lo[i] = 0;
active_hi[i] = 0;
}
 
_delay_ms(100);
 
TCCR0B = ( 1 << CS00 ) | ( 1 << CS02 ); // Timer0 Prescaler = 1024 -> 32,768 msec
TCCR1B = ( 1 << CS10 ); // Timer1 Prescaler = 1 -> 8,192 msec
TIMSK = ( 1 << TOIE1 ); // Timer1 Overflow Interrupt Enable
TIMSK = ( 1 << TOIE0 ) | ( 1 << TOIE1 ); // Timer0+1 Overflow Interrupt Enable
sei(); // Global Interrupts enable
 
ResetTimer();
ResetTimer1();
while(sat == 99) // Wait for first signal
{
if (TimerEvent == 10) LED_ON; // Blink while waiting...
if (TimerEvent == 20)
if (Timer1Event == 10) LED_ON; // Blink while waiting
if (Timer1Event == 20)
{
LED_OFF;
TimerEvent = 0;
Timer1Event = 0;
}
 
for (i=0;i<4;i++) // Select first active Satellite
while(Timer1Event < 3) // Check active satellites (for 3*8=24ms)
{
if (!(PINB & (1<<(i+4))))
for (i=0;i<4;i++)
{
active[i] = 1;
if (PINB & (1<<(i+4))) active_hi[i] = 1;
else active_lo[i] = 1;
}
}
 
for (i=0;i<4;i++) // When an input had low AND high signals, mark it as active
{
if (active_lo[i] == 1 && active_hi[i] == 1) active[i] = 1;
}
 
 
for (i=0;i<4;i++) // Select first active satellite
{
if (active[i] == 1)
{
SelectSat(i);
sat = i;
SelectSat(sat);
BlinkCode = i+1;
break;
}
}
 
}
 
LED_OFF;
 
 
 
while(1) // Main-Loop
{
for (i=0;i<4;i++) active[i] = 0; // Reset active-array
 
ResetTimer();
while((PINB & 0b11110000) == 0b11110000) // Wait for first signal (SYNC to frame)
for (i=0;i<4;i++) // Reset active-arrays
{
if (TimerEvent > 3) break; // (max. 3*8=24ms)
active[i] = 0;
active_lo[i] = 0;
active_hi[i] = 0;
}
ResetTimer();
while(TimerEvent < 1) // Check active satellites (for 1*8=8ms)
 
ResetTimer1();
while(Timer1Event < 3) // Check active satellites (for 3*8=24ms)
{
for (i=0;i<4;i++)
{
if (!(PINB & (1<<(i+4))))
{
active[i] = 1;
}
if (PINB & (1<<(i+4))) active_hi[i] = 1;
else active_lo[i] = 1;
}
}
 
if (active[sat] == 0) // Detect fail on active satellite
 
for (i=0;i<4;i++) // When an input had low AND high signals, mark it as active
{
for (i=0;i<4;i++) // Select lowest active satellite
if (active_lo[i] == 1 && active_hi[i] == 1) active[i] = 1;
}
 
if (active[0] == 0 && active[1] == 0 && active[2] == 0 && active[3] == 0 && sat != 99)
{
failure = 1; // Set Failure-LED when the signal is lost completely
BlinkCode = 0;
sat = 99;
}
 
for (i=0;i<4;i++) // Select active satellite (priorized)
{
if (active[i] == 1)
{
if (active[i] == 1)
{
sat = i;
SelectSat(sat);
break;
}
SelectSat(i);
if (sat != i) failure = 1; // Set Failure-LED when the active satellite changes
sat = i;
BlinkCode = i+1;
break;
}
LED_ON; // Failure-LED ON
}
 
if (!(PIND & (1<<PD6))) LED_OFF; // Reset Failure-LED when Bind-Button is pressed
 
 
if (!(PIND & (1<<PD6))) failure = 0; // Reset Failure-LED when Bind-Button is pressed
}
 
}