Skip to content
Snippets Groups Projects
Commit 3f7efb68 authored by Jake Read's avatar Jake Read
Browse files

results from daisy-chain uart message passing

parent dcc252a2
Branches
No related tags found
No related merge requests found
Showing
with 1935 additions and 1447 deletions
......@@ -5,18 +5,16 @@
Currently:
### Jake
- Hardware 0.2
- Measure Packet Propagation
- Implement Switching Structure in Hardware
-
### Nick
- Work w/ Patrick on implementing Dijkstra's in simulation
-
### Dougie
-
### Patrick
- Work on implementing hardware emulation in simulation
-
## Hardware
......
......@@ -350,107 +350,11 @@ UsedLibraryUrn="urn:adsk.eagle:library:177"
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries/eagle/fab.lbr"
[Win_1]
Type="Schematic Editor"
Loc="0 0 1919 1039"
State=3
Number=2
File="xmega-128a4u-switch.sch"
View="15.0064 -41.1611 192.2 109.557"
WireWidths=" 0.0762 0.1016 0.127 0.15 0.2 0.2032 0.254 0.3048 0.4064 0.508 0.6096 0.8128 1.016 1.27 2.54 0.1524"
PadDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
PadDrills=" 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.65 0.7 0.75 0.8 0.85 0.9 1 0.6"
ViaDiameters=" 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 1.05 1.1 1.15 1.2 1.3 0"
ViaDrills=" 0.2 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35"
HoleDrills=" 0.2 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35"
TextSizes=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778"
PolygonSpacings=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.27"
PolygonIsolates=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
MiterRadiuss=" 0.254 0.3175 0.635 1.27 2.54 1 2 2.5 5 7.5 10 0"
DimensionWidths=" 0 0.127 0.254 0.1 0.26 0.13"
DimensionExtWidths=" 0.127 0.254 0.1 0.13 0.26 0"
DimensionExtLengths=" 1.27 2.54 1 2 3 0"
DimensionExtOffsets=" 1.27 2.54 1 2 3 0"
SmdSizes=" 0.3048 0.1524 0.4064 0.2032 0.6096 0.3048 0.8128 0.4064 1.016 0.508 1.27 0.6604 1.4224 0.7112 1.6764 0.8128 1.778 0.9144 1.9304 0.9652 2.1844 1.0668 2.54 1.27 3.81 1.9304 5.08 2.54 6.4516 3.2512 1.27 0.635"
WireBend=0
WireBendSet=31
WireCap=1
MiterStyle=0
PadShape=0
ViaShape=1
PolygonPour=0
PolygonRank=0
PolygonThermals=1
PolygonOrphans=0
TextRatio=8
DimensionUnit=1
DimensionPrecision=2
DimensionShowUnit=0
PinDirection=3
PinFunction=0
PinLength=2
PinVisible=3
SwapLevel=0
ArcDirection=0
AddLevel=2
PadsSameType=0
Layer=91
Views=" 1: 15.0064 -41.1611 192.2 109.557"
Sheet="1"
[Win_2]
Type="Board Editor"
Loc="0 0 1919 1016"
State=3
Number=1
File="xmega-128a4u-switch.brd"
View="27.2798 4.87803 53.4537 24.2277"
WireWidths=" 0.0762 0.1016 0.127 0.15 0.2 0.2032 0.254 0.3048 0.4064 0.508 0.6096 0.8128 1.016 1.27 2.54 0.1524"
PadDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
PadDrills=" 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.65 0.7 0.75 0.8 0.85 0.9 1 0.6"
ViaDiameters=" 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 1.05 1.1 1.15 1.2 1.3 0"
ViaDrills=" 0.2 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35"
HoleDrills=" 0.2 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35"
TextSizes=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778"
PolygonSpacings=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.27"
PolygonIsolates=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
MiterRadiuss=" 0.254 0.3175 0.635 1.27 2.54 1 2 2.5 5 7.5 10 0"
DimensionWidths=" 0 0.127 0.254 0.1 0.26 0.13"
DimensionExtWidths=" 0.127 0.254 0.1 0.13 0.26 0"
DimensionExtLengths=" 1.27 2.54 1 2 3 0"
DimensionExtOffsets=" 1.27 2.54 1 2 3 0"
SmdSizes=" 0.3048 0.1524 0.4064 0.2032 0.6096 0.3048 0.8128 0.4064 1.016 0.508 1.27 0.6604 1.4224 0.7112 1.6764 0.8128 1.778 0.9144 1.9304 0.9652 2.1844 1.0668 2.54 1.27 3.81 1.9304 5.08 2.54 6.4516 3.2512 1.27 0.635"
WireBend=1
WireBendSet=0
WireCap=1
MiterStyle=0
PadShape=0
ViaShape=1
PolygonPour=0
PolygonRank=1
PolygonThermals=1
PolygonOrphans=0
TextRatio=8
DimensionUnit=1
DimensionPrecision=2
DimensionShowUnit=0
PinDirection=3
PinFunction=0
PinLength=2
PinVisible=3
SwapLevel=0
ArcDirection=0
AddLevel=2
PadsSameType=0
Layer=1
[Win_3]
Type="Control Panel"
Loc="0 0 1919 1016"
State=1
Number=0
[Desktop]
Screen="1920 1080"
Screen="3840 1080"
Window="Win_1"
Window="Win_2"
Window="Win_3"
No preview for this file type
No preview for this file type
......@@ -4,8 +4,8 @@
:100030000C9424010C9424010C9424010C942401AC
:100040000C9424010C9424010C9424010C9424019C
:100050000C9424010C9424010C9424010C9424018C
:100060000C9424010C94C0010C9424010C942401E0
:100070000C94F5010C9424010C9424010C9424019B
:100060000C9424010C946A020C9424010C94240135
:100070000C949F020C9424010C9424010C942401F0
:100080000C9424010C9424010C9424010C9424015C
:100090000C9424010C9424010C9424010C9424014C
:1000A0000C9424010C9424010C9424010C9424013C
......@@ -20,7 +20,7 @@
:100130000C9424010C9424010C9424010C942401AB
:100140000C9424010C9424010C9424010C9424019B
:100150000C9424010C9424010C9424010C9424018B
:100160000C942A020C9424010C9424010C945F0238
:100160000C94D4020C9424010C9424010C940903E3
:100170000C9424010C9424010C9424010C9424016B
:100180000C9424010C9424010C9424010C9424015B
:100190000C9424010C9424010C9424010C9424014B
......@@ -31,127 +31,151 @@
:1001E0000C9424010C9424010C9424010C942401FB
:1001F0000C9424010C9424010C94240111241FBE9E
:10020000CFEFCDBFDFE3DEBF00E00CBF18BE19BEED
:100210001ABE1BBE10E2A0E0B0E2E8EAF9E000E09E
:100220000BBF02C007900D92A630B107D9F71BBED5
:1002300020E2A6E0B0E201C01D92A637B207E1F7C6
:100240000E9426010C94D2040C940000CF93DF93FB
:10025000CDB7DEB76C97CDBFDEBFE0E5F0E088E15B
:10026000858380E18083818184FFFDCF88ED84BF19
:1002700084E0809340006894EE24E4F808E024E0F1
:1002800040E456E060EA78E0CE0102960E94FA026D
:100290008BE1FE013296A1E2B0E201900D928A95C7
:1002A000E1F781E290E20E942F036894EE24E5F8E2
:1002B00000E820E440E456E060EB78E0CE010296EE
:1002C0000E94FA028BE1FE013296A6E0B0E20190B4
:1002D0000D928A95E1F786E090E20E942F036894E0
:1002E000EE24E4F808E024E040E656E060EA79E035
:1002F000CE0102960E94FA028BE1FE013296A7E53A
:10030000B0E201900D928A95E1F787E590E20E94B4
:100310002F036894EE24E5F800E820E440E656E078
:1003200060EB79E0CE0102960E94FA028BE1FE01B9
:100330003296ACE3B0E201900D928A95E1F78CE33E
:1003400090E20E942F03E0EAF0E0828187608283DE
:10035000789481E290E20E949403BE016F5F7F4F28
:1003600086E090E20E948303882399F387E590E278
:100370000E94940369818CE390E20E948C03E9CF90
:100380001F920F920FB60F92112408B60F9218BE4B
:1003900009B60F9219BE0BB60F921BBE2F933F9357
:1003A0004F935F936F937F938F939F93AF93BF937D
:1003B000EF93FF9381E290E20E946503FF91EF913A
:1003C000BF91AF919F918F917F916F915F914F916D
:1003D0003F912F910F900BBE0F9009BE0F9008BE5A
:1003E0000F900FBE0F901F9018951F920F920FB68F
:1003F0000F92112408B60F9218BE09B60F9219BEBB
:100400000BB60F921BBE2F933F934F935F936F9347
:100410007F938F939F93AF93BF93EF93FF9386E068
:1004200090E20E946503FF91EF91BF91AF919F9180
:100430008F917F916F915F914F913F912F910F908D
:100440000BBE0F9009BE0F9008BE0F900FBE0F900D
:100450001F9018951F920F920FB60F92112408B695
:100460000F9218BE09B60F9219BE0BB60F921BBEA3
:100470002F933F934F935F936F937F938F939F93AC
:10048000AF93BF93EF93FF9387E590E20E946503DC
:10049000FF91EF91BF91AF919F918F917F916F915C
:1004A0005F914F913F912F910F900BBE0F9009BE1E
:1004B0000F9008BE0F900FBE0F901F9018951F92BF
:1004C0000F920FB60F92112408B60F9218BE09B6FC
:1004D0000F9219BE0BB60F921BBE2F933F934F93F3
:1004E0005F936F937F938F939F93AF93BF93EF939C
:1004F000FF938CE390E20E946503FF91EF91BF911F
:10050000AF919F918F917F916F915F914F913F91AB
:100510002F910F900BBE0F9009BE0F9008BE0F9049
:100520000FBE0F901F901895009739F0FC011282B2
:1005300013821482158281E0089580E00895CF939C
:10054000DF93EC01CB016E837F830E94B10388832C
:100550009983CE010E94940281E0DF91CF910895AA
:10056000FC01892BF1F0A081B18182819381A80FD8
:10057000B91F6C9326813781828193810196B901DD
:100580000E949D038283938344815581841795073C
:1005900051F40196B9010E949D038483958381E003
:1005A000089580E0089581E00895FC01892BE1F031
:1005B00061157105D9F022813381848195812817D5
:1005C0003907B1F0A081B181A80FB91F8C91DB016F
:1005D0008C93848195810196668177810E949D0329
:1005E0008483958381E0089580E0089580E00895F4
:1005F00080E00895CF92DF92EF920F93CF93DF9335
:10060000CDB7DEB76B97CDBFDEBF6C0169837A8350
:100610004B835C832D830E83EF82188619861A869E
:1006200060E870E0CE010C960E949F0260E870E0E6
:10063000CE0144960E949F028BE1FE013196D601C5
:1006400001900D928A95E1F7C6016B96CDBFDEBF92
:10065000DF91CF910F91EF90DF90CF900895FC0143
:10066000A081B1818BE916968C93A081B1811796F8
:100670001C92A081B18113968C911397806113967F
:100680008C93A081B18188E114968C93A081B18173
:1006900083E015968C93A281B381858115968C9306
:1006A000A281B381858111968C93A281B3818481CB
:1006B00012968C93A281B381848116968C93A28129
:1006C000B381868111968C930895FC01A281B38138
:1006D000868117968C93A081B1816C916287818508
:1006E000882319F0813031F008956E3759F481E094
:1006F000818708956E3711F411860895CF010B9606
:100700000E94B00208950B960E94D50291E08111DB
:1007100001C090E0892F0895DC01ED91FC91818169
:1007200085FFFDCF60830895DC011296ED91FC9169
:10073000139716968C9187830895AA1BBB1B51E1D2
:1007400007C0AA1FBB1FA617B70710F0A61BB70B41
:10075000881F991F5A95A9F780959095BC01CD01E6
:1007600008950F931F93CF93DF938230910510F478
:1007700082E090E0E0917420F091752020E030E07C
:10078000A0E0B0E0309719F14081518102811381DE
:1007900048175907C8F08417950769F4109731F086
:1007A00012960C93129713961C9327C000937420F3
:1007B0001093752022C02115310519F042175307F7
:1007C00018F49A01BD01EF01DF01F801DBCF21151B
:1007D0003105F9F0281B390B2430310580F48A816A
:1007E0009B816115710521F0FB018283938304C015
:1007F0008093742090937520FE01329644C0FE01D0
:10080000E20FF31F8193919322503109288339839A
:100810003AC02091722030917320232B41F4209113
:100820000220309103202093722030937320209176
:100830000020309101202115310541F42DB73EB73C
:100840004091042050910520241B350BE09172202B
:10085000F0917320E217F307A0F42E1B3F0B28172B
:10086000390778F0AC014E5F5F4F2417350748F029
:100870004E0F5F1F4093722050937320819391938A
:1008800002C0E0E0F0E0CF01DF91CF911F910F9126
:100890000895CF93DF93009709F481C0FC0132974C
:1008A00012821382A0917420B0917520109781F468
:1008B00020813181820F931F20917220309173200B
:1008C0002817390751F5E0937220F093732067C021
:1008D000ED0120E030E0CE17DF0740F44A815B8174
:1008E0009E0141155105F1F0EA01F5CFC283D38392
:1008F00040815181840F951FC817D90759F4888109
:100900009981840F951F0296808391838A819B81B0
:10091000828393832115310529F4E0937420F093A9
:1009200075203DC0E901EA83FB8349915991C40FC9
:10093000D51FEC17FD0761F480819181840F951F0D
:100940000296E90188839983828193818A839B83BC
:10095000E0E0F0E012968D919C911397009719F0CA
:10096000FD01DC01F7CF8D919C9111979D012E5FC8
:100970003F4F820F931F20917220309173202817D0
:10098000390769F4309729F4109274201092752079
:1009900002C012821382A0937220B0937320DF9161
:0809A000CF910895F894FFCFF8
:0609A80000007620200093
:100210001ABE1BBE20E2A6E0B0E201C01D92A33CC4
:10022000B207E1F710E2A0E0B0E2E2E2FBE000E0BA
:100230000BBF02C007900D92A630B107D9F71BBEC5
:100240000E945C010C948F050C9400000F931F9387
:10025000CF93DF9388E080934506CEE5D0E204EAB1
:1002600010E2699183E490E20E943704C017D1073D
:10027000C1F788E080934606DF91CF911F910F91DF
:1002800008950F931F93CF93DF9388E080934506E3
:10029000C6E0D0E20DE010E2699183E490E20E94B2
:1002A0003704C017D107C1F788E080934606DF9175
:1002B000CF911F910F910895CF93DF93CDB7DEB704
:1002C0006C97CDBFDEBFE0E5F0E088E1858380E19B
:1002D0008083818184FFFDCF88ED84BF14E010937B
:1002E00040006894EE24E4F808E024E040E456E09E
:1002F00060EA78E0CE0102960E94A4038BE1FE0141
:100300003296A8E2B0E201900D928A95E1F788E07A
:10031000809341066894EE24E5F800E820E440E488
:1003200056E060EB78E0CE0102960E94A4038BE1D8
:10033000FE013296ADE0B0E201900D928A95E1F7B0
:100340008DE090E20E94D9036894EE24E4F808E07E
:1003500024E040E656E060EA79E0CE0102960E9491
:10036000A4038BE1FE013296A4EAB0E201900D9263
:100370008A95E1F784EA90E20E94D9036894EE241A
:10038000E5F800E820E440E656E060EB79E0CE01D5
:1003900002960E94A4038BE1FE013296A3E4B0E230
:1003A00001900D928A95E1F783E490E20E94D903CF
:1003B000E0E6F6E092E0928321E0228388E1818BFF
:1003C000808BE0EAF0E08281876082837894EEE5BA
:1003D000F0E28EE7808321839283138390E49483F9
:1003E0008093A320E6E0F0E2808386830DE010E2B4
:1003F0000F2EF0E6EF2EF6E0FF2EF02D0F2EF0E49C
:10040000CF2EF6E0DF2EF02D6894BB24B3F888E2FF
:1004100090E20E943F04F8018185823039F584EA38
:1004200090E20E944804F601B5826EE783E490E210
:100430000E94370405C0698183E490E20E9437047A
:10044000BE016F5F7F4FC8010E942E048111F3CF60
:100450006EE783E490E20E943704F601B68284EAF4
:1004600090E20E945104F8011186D1CFF7018085F6
:1004700081FD16C084EA90E20E94480483E490E281
:100480000E94260184EA90E20E945104FFE724E8DA
:100490008EE1F15020408040E1F700C00000B7CF6E
:1004A000F701808580FDB3CF84EA90E20E94480482
:1004B00083E490E20E94410184EA90E20E945104A8
:1004C000FFE724E88EE1F15020408040E1F700C0D2
:1004D00000009DCF1F920F920FB60F92112408B605
:1004E0000F9218BE09B60F9219BE0BB60F921BBE23
:1004F0002F933F934F935F936F937F938F939F932C
:10050000AF93BF93EF93FF9388E290E20E940F04B2
:10051000FF91EF91BF91AF919F918F917F916F91DB
:100520005F914F913F912F910F900BBE0F9009BE9D
:100530000F9008BE0F900FBE0F901F9018951F923E
:100540000F920FB60F92112408B60F9218BE09B67B
:100550000F9219BE0BB60F921BBE2F933F934F9372
:100560005F936F937F938F939F93AF93BF93EF931B
:10057000FF938DE090E20E940F04FF91EF91BF91F5
:10058000AF919F918F917F916F915F914F913F912B
:100590002F910F900BBE0F9009BE0F9008BE0F90C9
:1005A0000FBE0F901F9018951F920F920FB60F92CB
:1005B000112408B60F9218BE09B60F9219BE0BB6D9
:1005C0000F921BBE2F933F934F935F936F937F9335
:1005D0008F939F93AF93BF93EF93FF9384EA90E23F
:1005E0000E940F04FF91EF91BF91AF919F918F9166
:1005F0007F916F915F914F913F912F910F900BBE23
:100600000F9009BE0F9008BE0F900FBE0F901F9065
:1006100018951F920F920FB60F92112408B60F92E1
:1006200018BE09B60F9219BE0BB60F921BBE2F93C0
:100630003F934F935F936F937F938F939F93AF936A
:10064000BF93EF93FF9383E490E20E940F04FF9126
:10065000EF91BF91AF919F918F917F916F915F913A
:100660004F913F912F910F900BBE0F9009BE0F90AD
:1006700008BE0F900FBE0F901F901895009739F08D
:10068000FC01128213821482158281E0089580E0B9
:100690000895CF93DF93EC01CB016E837F830E949B
:1006A0006E0488839983CE010E943E0381E0DF912E
:1006B000CF910895FC01892BF1F0A081B181828155
:1006C0009381A80FB91F6C93268137818281938112
:1006D0000196B9010E945A04828393834481558113
:1006E0008417950751F40196B9010E945A04848336
:1006F000958381E0089580E0089581E00895FC01EC
:10070000892BE1F061157105D9F022813381848153
:10071000958128173907B1F0A081B181A80FB91FC1
:100720008C91DB018C938481958101966681778120
:100730000E945A048483958381E0089580E008959F
:1007400080E0089580E00895CF92DF92EF920F93BA
:10075000CF93DF93CDB7DEB76B97CDBFDEBF6C0114
:1007600069837A834B835C832D830E83EF821886A3
:1007700019861A8660E870E0CE010C960E94490343
:1007800060E870E0CE0144960E9449038BE1FE01CF
:100790003196D60101900D928A95E1F7C6016B96CC
:1007A000CDBFDEBFDF91CF910F91EF90DF90CF9063
:1007B0000895FC01A081B18182E016968C93A081FE
:1007C000B18117961C92A081B18113968C911397D9
:1007D000806113968C93A081B18188E114968C93EB
:1007E000A081B18183E015968C93A281B38185812C
:1007F00015968C93A281B381858111968C93A281E9
:10080000B381848112968C93A281B38184811696E0
:100810008C93A281B381868111968C930895FC01FB
:10082000A281B381868117968C93A081B1816C914E
:1008300062878185882319F0813031F008956E3701
:1008400061F481E0818708956E3719F482E0818731
:100850000895CF010B960E945A0308950B960E94AB
:100860007F0391E0811101C090E0892F0895DC01A0
:10087000ED91FC91818185FFFDCF60830895DC01BE
:100880001296ED91FC91139716968C91878308959B
:10089000DC011296ED91FC91139716968C9185834D
:1008A0000895DC011296ED91FC91139716968C91A8
:1008B00086830895AA1BBB1B51E107C0AA1FBB1F5B
:1008C000A617B70710F0A61BB70B881F991F5A95DC
:1008D000A9F780959095BC01CD0108950F931F93C2
:1008E000CF93DF938230910510F482E090E0E091A5
:1008F000C120F091C22020E030E0A0E0B0E03097CD
:1009000019F1408151810281138148175907C8F0BC
:100910008417950769F4109731F012960C9312978B
:1009200013961C9327C00093C1201093C22022C0AD
:100930002115310519F04217530718F49A01BD012A
:10094000EF01DF01F801DBCF21153105F9F0281B9C
:10095000390B2430310580F48A819B816115710542
:1009600021F0FB018283938304C08093C120909384
:10097000C220FE01329644C0FE01E20FF31F8193B4
:10098000919322503109288339833AC02091BF20A6
:100990003091C020232B41F420910220309103207C
:1009A0002093BF203093C02020910020309101205F
:1009B0002115310541F42DB73EB7409104205091E7
:1009C0000520241B350BE091BF20F091C020E217D9
:1009D000F307A0F42E1B3F0B2817390778F0AC0162
:1009E0004E5F5F4F2417350748F04E0F5F1F40934F
:1009F000BF205093C0208193919302C0E0E0F0E0CB
:100A0000CF01DF91CF911F910F910895CF93DF9385
:100A1000009709F481C0FC01329712821382A091E1
:100A2000C120B091C220109781F420813181820FC2
:100A3000931F2091BF203091C0202817390751F50E
:100A4000E093BF20F093C02067C0ED0120E030E0CC
:100A5000CE17DF0740F44A815B819E0141155105A5
:100A6000F1F0EA01F5CFC283D38340815181840F35
:100A7000951FC817D90759F488819981840F951F4C
:100A80000296808391838A819B818283938321153F
:100A9000310529F4E093C120F093C2203DC0E90163
:100AA000EA83FB8349915991C40FD51FEC17FD07C9
:100AB00061F480819181840F951F0296E9018883FA
:100AC0009983828193818A839B83E0E0F0E0129690
:100AD0008D919C911397009719F0FD01DC01F7CFE0
:100AE0008D919C9111979D012E5F3F4F820F931F17
:100AF0002091BF203091C0202817390769F4309722
:100B000029F41092C1201092C22002C012821382D6
:100B1000A093BF20B093C020DF91CF910895F894A7
:020B2000FFCF05
:060B22000000C3202000CA
:00000001FF
......@@ -5,8 +5,8 @@ S11300200C9424010C9424010C9424010C942401B8
S11300300C9424010C9424010C9424010C942401A8
S11300400C9424010C9424010C9424010C94240198
S11300500C9424010C9424010C9424010C94240188
S11300600C9424010C94C0010C9424010C942401DC
S11300700C94F5010C9424010C9424010C94240197
S11300600C9424010C946A020C9424010C94240131
S11300700C949F020C9424010C9424010C942401EC
S11300800C9424010C9424010C9424010C94240158
S11300900C9424010C9424010C9424010C94240148
S11300A00C9424010C9424010C9424010C94240138
......@@ -21,7 +21,7 @@ S11301200C9424010C9424010C9424010C942401B7
S11301300C9424010C9424010C9424010C942401A7
S11301400C9424010C9424010C9424010C94240197
S11301500C9424010C9424010C9424010C94240187
S11301600C942A020C9424010C9424010C945F0234
S11301600C94D4020C9424010C9424010C940903DF
S11301700C9424010C9424010C9424010C94240167
S11301800C9424010C9424010C9424010C94240157
S11301900C9424010C9424010C9424010C94240147
......@@ -32,127 +32,151 @@ S11301D00C9424010C9424010C9424010C94240107
S11301E00C9424010C9424010C9424010C942401F7
S11301F00C9424010C9424010C94240111241FBE9A
S1130200CFEFCDBFDFE3DEBF00E00CBF18BE19BEE9
S11302101ABE1BBE10E2A0E0B0E2E8EAF9E000E09A
S11302200BBF02C007900D92A630B107D9F71BBED1
S113023020E2A6E0B0E201C01D92A637B207E1F7C2
S11302400E9426010C94D2040C940000CF93DF93F7
S1130250CDB7DEB76C97CDBFDEBFE0E5F0E088E157
S1130260858380E18083818184FFFDCF88ED84BF15
S113027084E0809340006894EE24E4F808E024E0ED
S113028040E456E060EA78E0CE0102960E94FA0269
S11302908BE1FE013296A1E2B0E201900D928A95C3
S11302A0E1F781E290E20E942F036894EE24E5F8DE
S11302B000E820E440E456E060EB78E0CE010296EA
S11302C00E94FA028BE1FE013296A6E0B0E20190B0
S11302D00D928A95E1F786E090E20E942F036894DC
S11302E0EE24E4F808E024E040E656E060EA79E031
S11302F0CE0102960E94FA028BE1FE013296A7E536
S1130300B0E201900D928A95E1F787E590E20E94B0
S11303102F036894EE24E5F800E820E440E656E074
S113032060EB79E0CE0102960E94FA028BE1FE01B5
S11303303296ACE3B0E201900D928A95E1F78CE33A
S113034090E20E942F03E0EAF0E0828187608283DA
S1130350789481E290E20E949403BE016F5F7F4F24
S113036086E090E20E948303882399F387E590E274
S11303700E94940369818CE390E20E948C03E9CF8C
S11303801F920F920FB60F92112408B60F9218BE47
S113039009B60F9219BE0BB60F921BBE2F933F9353
S11303A04F935F936F937F938F939F93AF93BF9379
S11303B0EF93FF9381E290E20E946503FF91EF9136
S11303C0BF91AF919F918F917F916F915F914F9169
S11303D03F912F910F900BBE0F9009BE0F9008BE56
S11303E00F900FBE0F901F9018951F920F920FB68B
S11303F00F92112408B60F9218BE09B60F9219BEB7
S11304000BB60F921BBE2F933F934F935F936F9343
S11304107F938F939F93AF93BF93EF93FF9386E064
S113042090E20E946503FF91EF91BF91AF919F917C
S11304308F917F916F915F914F913F912F910F9089
S11304400BBE0F9009BE0F9008BE0F900FBE0F9009
S11304501F9018951F920F920FB60F92112408B691
S11304600F9218BE09B60F9219BE0BB60F921BBE9F
S11304702F933F934F935F936F937F938F939F93A8
S1130480AF93BF93EF93FF9387E590E20E946503D8
S1130490FF91EF91BF91AF919F918F917F916F9158
S11304A05F914F913F912F910F900BBE0F9009BE1A
S11304B00F9008BE0F900FBE0F901F9018951F92BB
S11304C00F920FB60F92112408B60F9218BE09B6F8
S11304D00F9219BE0BB60F921BBE2F933F934F93EF
S11304E05F936F937F938F939F93AF93BF93EF9398
S11304F0FF938CE390E20E946503FF91EF91BF911B
S1130500AF919F918F917F916F915F914F913F91A7
S11305102F910F900BBE0F9009BE0F9008BE0F9045
S11305200FBE0F901F901895009739F0FC011282AE
S113053013821482158281E0089580E00895CF9398
S1130540DF93EC01CB016E837F830E94B103888328
S11305509983CE010E94940281E0DF91CF910895A6
S1130560FC01892BF1F0A081B18182819381A80FD4
S1130570B91F6C9326813781828193810196B901D9
S11305800E949D0382839383448155818417950738
S113059051F40196B9010E949D038483958381E0FF
S11305A0089580E0089581E00895FC01892BE1F02D
S11305B061157105D9F022813381848195812817D1
S11305C03907B1F0A081B181A80FB91F8C91DB016B
S11305D08C93848195810196668177810E949D0325
S11305E08483958381E0089580E0089580E00895F0
S11305F080E00895CF92DF92EF920F93CF93DF9331
S1130600CDB7DEB76B97CDBFDEBF6C0169837A834C
S11306104B835C832D830E83EF82188619861A869A
S113062060E870E0CE010C960E949F0260E870E0E2
S1130630CE0144960E949F028BE1FE013196D601C1
S113064001900D928A95E1F7C6016B96CDBFDEBF8E
S1130650DF91CF910F91EF90DF90CF900895FC013F
S1130660A081B1818BE916968C93A081B1811796F4
S11306701C92A081B18113968C911397806113967B
S11306808C93A081B18188E114968C93A081B1816F
S113069083E015968C93A281B381858115968C9302
S11306A0A281B381858111968C93A281B3818481C7
S11306B012968C93A281B381848116968C93A28125
S11306C0B381868111968C930895FC01A281B38134
S11306D0868117968C93A081B1816C916287818504
S11306E0882319F0813031F008956E3759F481E090
S11306F0818708956E3711F411860895CF010B9602
S11307000E94B00208950B960E94D50291E08111D7
S113071001C090E0892F0895DC01ED91FC91818165
S113072085FFFDCF60830895DC011296ED91FC9165
S1130730139716968C9187830895AA1BBB1B51E1CE
S113074007C0AA1FBB1FA617B70710F0A61BB70B3D
S1130750881F991F5A95A9F780959095BC01CD01E2
S113076008950F931F93CF93DF938230910510F474
S113077082E090E0E0917420F091752020E030E078
S1130780A0E0B0E0309719F14081518102811381DA
S113079048175907C8F08417950769F4109731F082
S11307A012960C93129713961C9327C000937420EF
S11307B01093752022C02115310519F042175307F3
S11307C018F49A01BD01EF01DF01F801DBCF211517
S11307D03105F9F0281B390B2430310580F48A8166
S11307E09B816115710521F0FB018283938304C011
S11307F08093742090937520FE01329644C0FE01CC
S1130800E20FF31F81939193225031092883398396
S11308103AC02091722030917320232B41F420910F
S11308200220309103202093722030937320209172
S11308300020309101202115310541F42DB73EB738
S11308404091042050910520241B350BE091722027
S1130850F0917320E217F307A0F42E1B3F0B281727
S1130860390778F0AC014E5F5F4F2417350748F025
S11308704E0F5F1F40937220509373208193919386
S113088002C0E0E0F0E0CF01DF91CF911F910F9122
S11308900895CF93DF93009709F481C0FC01329748
S11308A012821382A0917420B0917520109781F464
S11308B020813181820F931F209172203091732007
S11308C02817390751F5E0937220F093732067C01D
S11308D0ED0120E030E0CE17DF0740F44A815B8170
S11308E09E0141155105F1F0EA01F5CFC283D3838E
S11308F040815181840F951FC817D90759F4888105
S11309009981840F951F0296808391838A819B81AC
S1130910828393832115310529F4E0937420F093A5
S113092075203DC0E901EA83FB8349915991C40FC5
S1130930D51FEC17FD0761F480819181840F951F09
S11309400296E90188839983828193818A839B83B8
S1130950E0E0F0E012968D919C911397009719F0C6
S1130960FD01DC01F7CF8D919C9111979D012E5FC4
S11309703F4F820F931F20917220309173202817CC
S1130980390769F4309729F4109274201092752075
S113099002C012821382A0937220B0937320DF915D
S10B09A0CF910895F894FFCFF4
S10909A80000762020008F
S11302101ABE1BBE20E2A6E0B0E201C01D92A33CC0
S1130220B207E1F710E2A0E0B0E2E2E2FBE000E0B6
S11302300BBF02C007900D92A630B107D9F71BBEC1
S11302400E945C010C948F050C9400000F931F9383
S1130250CF93DF9388E080934506CEE5D0E204EAAD
S113026010E2699183E490E20E943704C017D10739
S1130270C1F788E080934606DF91CF911F910F91DB
S113028008950F931F93CF93DF9388E080934506DF
S1130290C6E0D0E20DE010E2699183E490E20E94AE
S11302A03704C017D107C1F788E080934606DF9171
S11302B0CF911F910F910895CF93DF93CDB7DEB700
S11302C06C97CDBFDEBFE0E5F0E088E1858380E197
S11302D08083818184FFFDCF88ED84BF14E0109377
S11302E040006894EE24E4F808E024E040E456E09A
S11302F060EA78E0CE0102960E94A4038BE1FE013D
S11303003296A8E2B0E201900D928A95E1F788E076
S1130310809341066894EE24E5F800E820E440E484
S113032056E060EB78E0CE0102960E94A4038BE1D4
S1130330FE013296ADE0B0E201900D928A95E1F7AC
S11303408DE090E20E94D9036894EE24E4F808E07A
S113035024E040E656E060EA79E0CE0102960E948D
S1130360A4038BE1FE013296A4EAB0E201900D925F
S11303708A95E1F784EA90E20E94D9036894EE2416
S1130380E5F800E820E440E656E060EB79E0CE01D1
S113039002960E94A4038BE1FE013296A3E4B0E22C
S11303A001900D928A95E1F783E490E20E94D903CB
S11303B0E0E6F6E092E0928321E0228388E1818BFB
S11303C0808BE0EAF0E08281876082837894EEE5B6
S11303D0F0E28EE7808321839283138390E49483F5
S11303E08093A320E6E0F0E2808386830DE010E2B0
S11303F00F2EF0E6EF2EF6E0FF2EF02D0F2EF0E498
S1130400CF2EF6E0DF2EF02D6894BB24B3F888E2FB
S113041090E20E943F04F8018185823039F584EA34
S113042090E20E944804F601B5826EE783E490E20C
S11304300E94370405C0698183E490E20E94370476
S1130440BE016F5F7F4FC8010E942E048111F3CF5C
S11304506EE783E490E20E943704F601B68284EAF0
S113046090E20E945104F8011186D1CFF7018085F2
S113047081FD16C084EA90E20E94480483E490E27D
S11304800E94260184EA90E20E945104FFE724E8D6
S11304908EE1F15020408040E1F700C00000B7CF6A
S11304A0F701808580FDB3CF84EA90E20E9448047E
S11304B083E490E20E94410184EA90E20E945104A4
S11304C0FFE724E88EE1F15020408040E1F700C0CE
S11304D000009DCF1F920F920FB60F92112408B601
S11304E00F9218BE09B60F9219BE0BB60F921BBE1F
S11304F02F933F934F935F936F937F938F939F9328
S1130500AF93BF93EF93FF9388E290E20E940F04AE
S1130510FF91EF91BF91AF919F918F917F916F91D7
S11305205F914F913F912F910F900BBE0F9009BE99
S11305300F9008BE0F900FBE0F901F9018951F923A
S11305400F920FB60F92112408B60F9218BE09B677
S11305500F9219BE0BB60F921BBE2F933F934F936E
S11305605F936F937F938F939F93AF93BF93EF9317
S1130570FF938DE090E20E940F04FF91EF91BF91F1
S1130580AF919F918F917F916F915F914F913F9127
S11305902F910F900BBE0F9009BE0F9008BE0F90C5
S11305A00FBE0F901F9018951F920F920FB60F92C7
S11305B0112408B60F9218BE09B60F9219BE0BB6D5
S11305C00F921BBE2F933F934F935F936F937F9331
S11305D08F939F93AF93BF93EF93FF9384EA90E23B
S11305E00E940F04FF91EF91BF91AF919F918F9162
S11305F07F916F915F914F913F912F910F900BBE1F
S11306000F9009BE0F9008BE0F900FBE0F901F9061
S113061018951F920F920FB60F92112408B60F92DD
S113062018BE09B60F9219BE0BB60F921BBE2F93BC
S11306303F934F935F936F937F938F939F93AF9366
S1130640BF93EF93FF9383E490E20E940F04FF9122
S1130650EF91BF91AF919F918F917F916F915F9136
S11306604F913F912F910F900BBE0F9009BE0F90A9
S113067008BE0F900FBE0F901F901895009739F089
S1130680FC01128213821482158281E0089580E0B5
S11306900895CF93DF93EC01CB016E837F830E9497
S11306A06E0488839983CE010E943E0381E0DF912A
S11306B0CF910895FC01892BF1F0A081B181828151
S11306C09381A80FB91F6C9326813781828193810E
S11306D00196B9010E945A0482839383448155810F
S11306E08417950751F40196B9010E945A04848332
S11306F0958381E0089580E0089581E00895FC01E8
S1130700892BE1F061157105D9F02281338184814F
S1130710958128173907B1F0A081B181A80FB91FBD
S11307208C91DB018C93848195810196668177811C
S11307300E945A048483958381E0089580E008959B
S113074080E0089580E00895CF92DF92EF920F93B6
S1130750CF93DF93CDB7DEB76B97CDBFDEBF6C0110
S113076069837A834B835C832D830E83EF8218869F
S113077019861A8660E870E0CE010C960E9449033F
S113078060E870E0CE0144960E9449038BE1FE01CB
S11307903196D60101900D928A95E1F7C6016B96C8
S11307A0CDBFDEBFDF91CF910F91EF90DF90CF905F
S11307B00895FC01A081B18182E016968C93A081FA
S11307C0B18117961C92A081B18113968C911397D5
S11307D0806113968C93A081B18188E114968C93E7
S11307E0A081B18183E015968C93A281B381858128
S11307F015968C93A281B381858111968C93A281E5
S1130800B381848112968C93A281B38184811696DC
S11308108C93A281B381868111968C930895FC01F7
S1130820A281B381868117968C93A081B1816C914A
S113083062878185882319F0813031F008956E37FD
S113084061F481E0818708956E3719F482E081872D
S11308500895CF010B960E945A0308950B960E94A7
S11308607F0391E0811101C090E0892F0895DC019C
S1130870ED91FC91818185FFFDCF60830895DC01BA
S11308801296ED91FC91139716968C918783089597
S1130890DC011296ED91FC91139716968C91858349
S11308A00895DC011296ED91FC91139716968C91A4
S11308B086830895AA1BBB1B51E107C0AA1FBB1F57
S11308C0A617B70710F0A61BB70B881F991F5A95D8
S11308D0A9F780959095BC01CD0108950F931F93BE
S11308E0CF93DF938230910510F482E090E0E091A1
S11308F0C120F091C22020E030E0A0E0B0E03097C9
S113090019F1408151810281138148175907C8F0B8
S11309108417950769F4109731F012960C93129787
S113092013961C9327C00093C1201093C22022C0A9
S11309302115310519F04217530718F49A01BD0126
S1130940EF01DF01F801DBCF21153105F9F0281B98
S1130950390B2430310580F48A819B81611571053E
S113096021F0FB018283938304C08093C120909380
S1130970C220FE01329644C0FE01E20FF31F8193B0
S1130980919322503109288339833AC02091BF20A2
S11309903091C020232B41F4209102203091032078
S11309A02093BF203093C02020910020309101205B
S11309B02115310541F42DB73EB7409104205091E3
S11309C00520241B350BE091BF20F091C020E217D5
S11309D0F307A0F42E1B3F0B2817390778F0AC015E
S11309E04E5F5F4F2417350748F04E0F5F1F40934B
S11309F0BF205093C0208193919302C0E0E0F0E0C7
S1130A00CF01DF91CF911F910F910895CF93DF9381
S1130A10009709F481C0FC01329712821382A091DD
S1130A20C120B091C220109781F420813181820FBE
S1130A30931F2091BF203091C0202817390751F50A
S1130A40E093BF20F093C02067C0ED0120E030E0C8
S1130A50CE17DF0740F44A815B819E0141155105A1
S1130A60F1F0EA01F5CFC283D38340815181840F31
S1130A70951FC817D90759F488819981840F951F48
S1130A800296808391838A819B818283938321153B
S1130A90310529F4E093C120F093C2203DC0E9015F
S1130AA0EA83FB8349915991C40FD51FEC17FD07C5
S1130AB061F480819181840F951F0296E9018883F6
S1130AC09983828193818A839B83E0E0F0E012968C
S1130AD08D919C911397009719F0FD01DC01F7CFDC
S1130AE08D919C9111979D012E5F3F4F820F931F13
S1130AF02091BF203091C0202817390769F430971E
S1130B0029F41092C1201092C22002C012821382D2
S1130B10A093BF20B093C020DF91CF910895F894A3
S1050B20FFCF01
S1090B220000C3202000C6
S9030000FC
No preview for this file type
No preview for this file type
......@@ -27,6 +27,25 @@ tinyport_t tp2;
tinyport_t tp3; //nhat used at the moment
tinyport_t tp4;
uint8_t tpacket1[70];
uint8_t tpacket2[7];
void testpacket1(tinyport_t *tp){
PORTC.OUTSET = PIN3_bm;
for(int i = 0; i < 70; i ++){
tp_write(&tp4, tpacket1[i]);
}
PORTC.OUTCLR = PIN3_bm;
}
void testpacket2(tinyport_t *tp){
PORTC.OUTSET = PIN3_bm;
for(int i = 0; i < 7; i ++){
tp_write(&tp4, tpacket2[i]);
}
PORTC.OUTCLR = PIN3_bm;
}
int main(void){
// Neil: overclocking (rad)
OSC.PLLCTRL = OSC_PLLFAC4_bm | OSC_PLLFAC3_bm; // 2 MHz * 24 = 48 MHz
......@@ -38,7 +57,8 @@ int main(void){
// uart, port, rx, tx, stat
tp1 = tp_new(&USARTC0, &PORTC, PIN2_bm, PIN3_bm, PIN4_bm);
tp_init(&tp1);
//tp_init(&tp1);
PORTC.DIRSET = PIN3_bm;
tp2 = tp_new(&USARTC1, &PORTC, PIN6_bm, PIN7_bm, PIN5_bm);
tp_init(&tp2);
......@@ -49,6 +69,10 @@ int main(void){
tp4 = tp_new(&USARTD1, &PORTD, PIN6_bm, PIN7_bm, PIN5_bm);
tp_init(&tp4);
PORTD.DIRCLR = PIN1_bm;
PORTD.DIRCLR = PIN0_bm; // button ready
PORTD.PIN1CTRL = PORT_OPC_PULLUP_gc;
PORTD.PIN0CTRL = PORT_OPC_PULLUP_gc;
// system interrupt setup (allow low level interrupts)
PMIC.CTRL |= PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
......@@ -56,28 +80,49 @@ int main(void){
// globally enable interrupts
sei();
while(1){
tpacket1[0] = 126; // start delimiter
tpacket1[1] = 1; // destination address (this and lower)
tpacket1[2] = 2; // # edges from source
tpacket1[3] = 4; // source address
tpacket1[4] = 64; // # of bytes in payload
tpacket1[69] = 126;
tpacket2[0] = 126; // start delimiter
tpacket2[6] = 126; // end delimiter
uint8_t data;
while(1){
tp_statflash(&tp1);
if(tp2.pstate == TP_PSTATE_HASPACKET){
tp_stathi(&tp3);
PORTC.OUTSET = PIN3_bm;
if(tp_read(&tp2, &data)){
tp_statflash(&tp3);
tp_write(&tp4, 126);
while(tp_read(&tp2, &data)){
tp_write(&tp4, data);
}
tp_write(&tp4, 126);
PORTC.OUTCLR = PIN3_bm;
tp_statlo(&tp3);
tp2.pstate = TP_PSTATE_OUTSIDE;
} else if (!(PORTD.IN & PIN1_bm)){
tp_stathi(&tp3);
testpacket1(&tp4);
tp_statlo(&tp3);
_delay_ms(500); // basically, debounce button
} else if (!(PORTD.IN & PIN0_bm)) {
tp_stathi(&tp3);
testpacket2(&tp4);
tp_statlo(&tp3);
_delay_ms(500);
}
// the below only works when bounded by nointerrupts() and interrupts();
}
}
uint8_t pcount = 0;
uint8_t psize = 12;
// passing 2 -> 4
void handoff(tinyport_t *tp_from){ // puts data in 'core' of system
//
}
/*
turns off global interrupt control
my understanding is that interrupts still get scheduled, but not executed
......
......@@ -71,7 +71,7 @@ void tp_rxISR(tinyport_t *tp){ // towards a passalong
break;
case TP_PSTATE_INSIDE:
if(tp->bumpdata == 126){
tp->pstate = TP_PSTATE_OUTSIDE;
tp->pstate = TP_PSTATE_HASPACKET;
} else {
rb_put(&tp->rbrx, tp->bumpdata);
}
......@@ -92,7 +92,7 @@ uint8_t tp_read(tinyport_t *tp, uint8_t *data){ // TODO: set at pointer, return
// https://lost-contact.mit.edu/afs/sur5r.net/service/drivers+doc/Atmel/ATXMEGA/AVR1307/code/doxygen/usart__driver_8c.html#7fdb922f6b858bef8515e23229efd970
void tp_write(tinyport_t *tp, uint8_t data){
while(!(tp->uart->STATUS & USART_DREIF_bm)); // while not ready, wait (this is blocking)
while(!(tp->uart->STATUS & USART_DREIF_bm)); // while not ready, wait (needs work a better way)
tp->uart->DATA = data;
}
......
......@@ -14,7 +14,7 @@
#define TP_TXBUF_SIZE 128
#define TP_RXBUF_SIZE 128
#define TP_UART_BAUDCONTROLB 0
#define TP_UART_BAUDCONTROLA 155 // 19200: 155, 1M: 2
#define TP_UART_BAUDCONTROLA 2 // 19200: 155, 115200: 25, 230400: 12, 428600: 6, 1M: 2, 1.5M: 1, 3M: 0
#define TP_RX_STATE_EMPTY 0
#define TP_RX_STATE_HASDATA 1
......@@ -24,6 +24,7 @@
#define TP_PSTATE_OUTSIDE 0
#define TP_PSTATE_INSIDE 1
#define TP_PSTATE_HASPACKET 2
typedef struct {
USART_t *uart;
......
results/daisychain/daisychain-measurement.jpg

127 KiB

results/daisychain/daisychain-setup.jpg

277 KiB

# Daisy Chained Message Passing
## Setup
In this baseline test, our switches are connected in series. On receiving a packet on Port 2, it is automatically forwarded to Port 4, with no computation done otherwise. This will give us a baseline performance metric while developing algorithms that necessarily perform *some* computation with each packet before forwarding it, as well as handling messages on multiple ports, etc.
![img of setup](https://github.com/jakeread/tinynets/blob/master/results/daisychain/daisychain-setup.jpg)
We test a packet that is 70 Bytes long - 560 bits and a packet that is 7 bytes long (our minimum). The code used to buffer and pass the message is included under /results/daisychain/code . Each switch sets a pin high during the interval that it is sending bytes, and we use a logic analyzer to track this status across multiple switches. This is how we measure message passing time.
![img of logic](https://github.com/jakeread/tinynets/blob/master/results/daisychain/daisychain-measurement.jpg)
Results are as follows. The expected T_message is simply (bits/packet)/bitrate - any additional message time is due to system design and implementation. Critically, UART uses a start and stop bit, per byte.
Bitrate | T_message (us) | P_size | T_message* (us) | % Difference
--- | --- | --- | ---
115200 | 4861 | 70 | 5858 | 21
115200 | 486 | 7 | 586 | 21
230400 | 2431 | 70 | 2930 | 21
230400 | 243 | 7 | 295 | 21
428600 | 1307 | 70 | 1580 | 21
428600 | 131 | 7 | 161 | 23
1M | 560 | 70 | 679 | 21
1M | 56 | 7 | 71 | 27
3M | 187 | 70 | 245 | 31
3M | 19 | 7 | 43 | 126
Critically, we see a ~20% increase with lower bitrates - largely due to the extra two bits (start and stop) per packet. At higher bitrates, processor overhead also becomes apparent, nearly doubling message times. This is a key indicator that our system performance will hinge on driving switch computation to a minimum, an observation made in class...
File added
/*
* atxmega-a4u-wakeup.c
*
* Created: 10/19/2017 11:24:49 PM
* Author : Jake
*/
#define BUTTON1 0 // on port D
#define BUTTON1_bm (1 << BUTTON1)
#define BUTTON2 1 // on port D
#define BUTTON2_bm (1 << BUTTON2)
#define BLINK_DELAY_MS 500
#define F_CPU 20000000UL // so that the system knows how many clock ticks are in one second, so that delay functions are accurate
#define NEWLINE 0x0A
#include <avr/io.h>
#include <avr/interrupt.h> // NEED this for Interrupts - only to use sei() to enable global interrupt flag
#include <util/delay.h>
#include "ringbuffer.h"
#include "tinyport.h"
tinyport_t tp1; //power, at the moment
tinyport_t tp2;
tinyport_t tp3; //nhat used at the moment
tinyport_t tp4;
uint8_t tpacket1[70];
uint8_t tpacket2[7];
void testpacket1(tinyport_t *tp){
PORTC.OUTSET = PIN3_bm;
for(int i = 0; i < 70; i ++){
tp_write(&tp4, tpacket1[i]);
}
PORTC.OUTCLR = PIN3_bm;
}
void testpacket2(tinyport_t *tp){
PORTC.OUTSET = PIN3_bm;
for(int i = 0; i < 7; i ++){
tp_write(&tp4, tpacket2[i]);
}
PORTC.OUTCLR = PIN3_bm;
}
int main(void){
// Neil: overclocking (rad)
OSC.PLLCTRL = OSC_PLLFAC4_bm | OSC_PLLFAC3_bm; // 2 MHz * 24 = 48 MHz
OSC.CTRL = OSC_PLLEN_bm; // enable PLL
while (!(OSC.STATUS & OSC_PLLRDY_bm)); // wait for PLL to be ready
CCP = CCP_IOREG_gc; // enable protected register change
CLK.CTRL = CLK_SCLKSEL_PLL_gc; // switch to PLL
// uart, port, rx, tx, stat
tp1 = tp_new(&USARTC0, &PORTC, PIN2_bm, PIN3_bm, PIN4_bm);
//tp_init(&tp1);
PORTC.DIRSET = PIN3_bm;
tp2 = tp_new(&USARTC1, &PORTC, PIN6_bm, PIN7_bm, PIN5_bm);
tp_init(&tp2);
tp3 = tp_new(&USARTD0, &PORTD, PIN2_bm, PIN3_bm, PIN4_bm);
tp_init(&tp3);
tp4 = tp_new(&USARTD1, &PORTD, PIN6_bm, PIN7_bm, PIN5_bm);
tp_init(&tp4);
PORTD.DIRCLR = PIN1_bm;
PORTD.DIRCLR = PIN0_bm; // button ready
PORTD.PIN1CTRL = PORT_OPC_PULLUP_gc;
PORTD.PIN0CTRL = PORT_OPC_PULLUP_gc;
// system interrupt setup (allow low level interrupts)
PMIC.CTRL |= PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
// globally enable interrupts
sei();
tpacket1[0] = 126; // start delimiter
tpacket1[1] = 1; // destination address (this and lower)
tpacket1[2] = 2; // # edges from source
tpacket1[3] = 4; // source address
tpacket1[4] = 64; // # of bytes in payload
tpacket1[69] = 126;
tpacket2[0] = 126; // start delimiter
tpacket2[6] = 126; // end delimiter
uint8_t data;
while(1){
tp_statflash(&tp1);
if(tp2.pstate == TP_PSTATE_HASPACKET){
tp_stathi(&tp3);
PORTC.OUTSET = PIN3_bm;
tp_write(&tp4, 126);
while(tp_read(&tp2, &data)){
tp_write(&tp4, data);
}
tp_write(&tp4, 126);
PORTC.OUTCLR = PIN3_bm;
tp_statlo(&tp3);
tp2.pstate = TP_PSTATE_OUTSIDE;
} else if (!(PORTD.IN & PIN1_bm)){
tp_stathi(&tp3);
testpacket1(&tp4);
tp_statlo(&tp3);
_delay_ms(500); // basically, debounce button
} else if (!(PORTD.IN & PIN0_bm)) {
tp_stathi(&tp3);
testpacket2(&tp4);
tp_statlo(&tp3);
_delay_ms(500);
}
// the below only works when bounded by nointerrupts() and interrupts();
}
}
/*
turns off global interrupt control
my understanding is that interrupts still get scheduled, but not executed
when interrupts are turned back on, they fire.
*/
void nointerrupts(){
PMIC.CTRL |= ~PMIC_LOLVLEN_bm | ~PMIC_MEDLVLEN_bm | ~PMIC_HILVLEN_bm;
}
/*
turns on global interrupt control
*/
void interrupts(){
PMIC.CTRL |= PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
}
// hookup ISRs to port-abstracted interrupt functions
ISR(USARTC0_RXC_vect){
tp_rxISR(&tp1);
}
ISR(USARTC1_RXC_vect){
tp_rxISR(&tp2);
}
ISR(USARTD0_RXC_vect){
tp_rxISR(&tp3);
}
ISR(USARTD1_RXC_vect){
tp_rxISR(&tp4);
}
/*
ISR(USARTC1_DRE_vect){
tp_txISR(&tp2);
}
ISR(USARTC0_DRE_vect){
tp_txISR(&tp1);
}
ISR(USARTD0_DRE_vect){
tp_txISR(&tp3);
}
ISR(USARTD1_DRE_vect){
tp_txISR(&tp4);
}
*/
\ No newline at end of file
#include "ringbuffer.h"
#include <stdlib.h>
#include <avr/io.h>
uint8_t rb_init(ringbuffer_t *rb, size_t size){
rb->size = size;
rb->buffer = malloc(rb->size);
rb_reset(rb);
return 1;
}
uint8_t rb_reset(ringbuffer_t *rb){
if(rb){
rb->head = 0;
rb->tail = 0;
return 1;
} else {
return 0;
}
}
uint8_t rb_put(ringbuffer_t *rb, uint8_t data){
if(rb){
rb->buffer[rb->head] = data;
rb->head = (rb->head + 1) % rb->size; // for wrap around
if(rb->head == rb->tail){
rb->tail = (rb->tail + 1) % rb->size;
}
return 1;
} else {
return 0;
}
}
uint8_t rb_get(ringbuffer_t *rb, uint8_t *data){
if(rb && data && !rb_empty(*rb)){
*data = rb->buffer[rb->tail];
rb->tail = (rb->tail + 1) % rb->size;
return 1;
} else {
return 0;
}
}
uint8_t rb_empty(ringbuffer_t rb){
return (rb.head == rb.tail);
}
uint8_t rb_full(ringbuffer_t rb){
return ((rb.head + 1) % rb.size) == rb.tail;
}
\ No newline at end of file
#ifndef RINGBUFFER_H
#define RINGBUFFER_H
/*
a ringbuffer,
s/o https://github.com/dhess/c-ringbuf
s/o https://embeddedartistry.com/blog/2017/4/6/circular-buffers-in-cc
*/
#include <avr/io.h>
#include <stdlib.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
typedef struct {
uint8_t * buffer;
size_t head;
size_t tail;
size_t size;
} ringbuffer_t;
uint8_t rb_init(ringbuffer_t *rb, size_t size);
// sets tail to head
uint8_t rb_reset(ringbuffer_t *rb);
// writes one byte to next slot
uint8_t rb_put(ringbuffer_t *rb, uint8_t data);
// reads one byte from buffer
uint8_t rb_get(ringbuffer_t *rb, uint8_t *data);
uint8_t rb_empty(ringbuffer_t rb);
uint8_t rb_full(ringbuffer_t rb);
#endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment