Commit 40e8c892 authored by Petter Breedveld's avatar Petter Breedveld

Finished day 3

parent 6d7fe9d0
:1000000019C02AC029C028C027C026C025C024C0C6
:1000100023C022C021C020C01FC01EC01DC01CC0E4
:100020001BC01AC019C018C017C016C0A2C014C087
:1000300013C012C011241FBECFEFCDBFDFE3DEBF60
:100040002EE3A0E0BEE301C01D92A430B207E1F7A9
:100050000E944E000C94E0000C940000E0E0F6E0FA
:1000600080818460808381818260818382818061DC
:100070008283828182838081816080830895E0E031
:10008000F6E08683838581608387808581608087B1
:10009000838580FFFDCF8091100608956CE675E0A2
:1000A00080E090E00E9497000E942E007894CDECB2
:1000B00086E00E943F0080958C9F912D112496959B
:1000C00096959695392F330F232F220F220F230F4A
:1000D000821B8093013E9C9F812D112486958695DD
:1000E0008695382F330F232F220F220F230F921BB9
:1000F0009093023E8093033E8093003E805D0E9479
:10010000AF008091023E805D0E94AF008091013E71
:10011000805D0E94AF0080E20E94AF002AE28CE284
:100120009AE0215080409040E1F70000C1CF0F934A
:100130001F93E0E2F4E024E025832183072F182FAA
:10014000292F3327E0E0F8E0018760878681806C03
:1001500086838581806885831F910F910895E0E0F3
:10016000F8E0948195FFFDCFE0E0F8E01382828310
:1001700008951F920F920FB60F9211242F933F9361
:100180004F935F936F937F938F939F93AF93BF939F
:10019000EF93FF93809100088F5F0E94AF00FF9163
:1001A000EF91BF91AF919F918F917F916F915F91EF
:1001B0004F913F912F910F900FBE0F901F90189568
:0401C000F894FFCFE1
:1000000019C035C034C033C032C031C030C02FC079
:100010002EC02DC02CC02BC02AC029C028C027C08C
:1000200026C025C024C023C022C021C089C01FC053
:100030001EC01DC011241FBECFEFCDBFDFE3DEBF4A
:100040001EE3A0E0BEE3E0E2FAE002C005900D92FC
:10005000AA33B107D9F72EE3AAE3BEE301C01D928C
:10006000A534B207E1F70E9459000C940E050C94D8
:100070000000E0E0F6E0808184608083818182601E
:100080008183828180618283828182838081816099
:1000900080830895E0E0F6E086838385816083872E
:1000A000808581608087838580FFFDCF80911006E9
:1000B00008956CE675E080E090E00E9487000E9461
:1000C00039007894C6E0DEE386E00E944A0080951D
:1000D00080933A3E1F928F93DF93CF930E94F90053
:1000E0009AE22CE28AE0915020408040E1F7000043
:1000F0000F900F900F900F90E7CFE0E0F8E0948121
:1001000095FFFDCF8093020880E090E00895E0E243
:10011000F4E0258124602583218124602183E0E0AF
:10012000F8E0608771878681806C8683858180682E
:10013000858360E070E08DE790E00E94AE00089556
:100140001F920F920FB60F9211248F938091000887
:100150008F910F900FBE0F901F9018950F931F93C4
:10016000CF93DF93009731F46115710519F480E0A6
:1001700090E03AC08B01EC016EE070E081E090E02D
:100180000E94E102FC01892B91F380E88383011531
:10019000110571F00287138781E8838380913B3ECC
:1001A00090913C3E892B21F4E0933B3EF0933C3E02
:1001B0002097C9F0C087D187838182608383809133
:1001C0003D3E90913E3E892B71F4E0933D3EF0938D
:1001D0003E3E80913F3E9091403E892B21F4E0933A
:1001E0003F3EF093403ECF01DF91CF911F910F91A1
:1001F0000895A0E0B0E0EFEFF0E00C94ED04AE0164
:100200004B5F5F4FFA0161917191AF0180913D3E6B
:1002100090913E3E0E940F01E2E00C940605ACE096
:10022000B0E0E5E1F1E00C94DD047C016B018A01B2
:10023000FC0116821782838181FFBDC1CE01019628
:100240004C01F7019381F60193FD859193FF819114
:100250006F01882309F4ABC1853239F493FD859190
:1002600093FF81916F01853229F4B70190E00E94DC
:100270004704E7CF512C312C20E02032A0F48B3200
:1002800069F030F4803259F0833269F420612CC077
:100290008D3239F0803339F4216026C02260246029
:1002A00023C0286021C027FD27C030ED380F3A3029
:1002B00078F426FF06C0FAE05F9E300D1124532E1D
:1002C00013C08AE0389E300D1124332E20620CC0FA
:1002D0008E3221F426FD6BC1206406C08C3611F4E9
:1002E000206802C0883641F4F60193FD859193FFA2
:1002F00081916F018111C1CF982F9F7D95549330CB
:1003000028F40C5F1F4FFFE3F9830DC0833631F0F3
:10031000833771F0833509F05BC022C0F80180811A
:1003200089830E5F1F4F44244394512C540115C000
:100330003801F2E06F0E711CF801A080B18026FF39
:1003400003C0652D70E002C06FEF7FEFC5012C8701
:100350000E943C042C0183012C852F77222E17C08C
:100360003801F2E06F0E711CF801A080B18026FF09
:1003700003C0652D70E002C06FEF7FEFC5012C87D1
:100380000E942A042C012C852068222E830123FC44
:100390001BC0832D90E048165906B0F4B70180E2E7
:1003A00090E00E9447043A94F4CFF50127FC859130
:1003B00027FE81915F01B70190E00E944704311050
:1003C0003A94F1E04F1A51084114510471F7E5C015
:1003D000843611F0893639F5F80127FF07C06081AE
:1003E0007181828193810C5F1F4F08C06081718190
:1003F000072E000C880B990B0E5F1F4F2F76722E65
:1004000097FF09C090958095709561957F4F8F4FAC
:100410009F4F2068722E2AE030E0A4010E947F04E2
:10042000A82EA81844C0853729F42F7EB22E2AE0C2
:1004300030E025C0F22FF97FBF2E8F36C1F018F4BF
:10044000883579F0B4C0803719F0883721F0AFC013
:100450002F2F2061B22EB4FE0DC08B2D8460B82EDC
:1004600009C024FF0AC09F2F9660B92E06C028E05D
:1004700030E005C020E130E002C020E132E0F801C8
:10048000B7FE07C060817181828193810C5F1F4F2D
:1004900006C06081718180E090E00E5F1F4FA40173
:1004A0000E947F04A82EA818FB2DFF777F2E76FED2
:1004B0000BC0372D3E7FA51450F474FE0AC072FCA9
:1004C00008C0372D3E7E05C0BA2C372D03C0BA2C8C
:1004D00001C0B52C34FF0DC0FE01EA0DF11D808175
:1004E000803311F4397E09C032FF06C0B394B3944F
:1004F00004C0832F867809F0B39433FD13C030FF16
:1005000006C05A2CB31418F4530C5B18B32CB31454
:1005100068F4B70180E290E03C870E944704B394FE
:100520003C85F5CFB31410F43B1801C0312C34FFD7
:1005300012C0B70180E390E03C870E9447043C85ED
:1005400032FF17C031FD03C088E790E002C088E5A4
:1005500090E0B7010CC0832F867859F031FF02C0BC
:100560008BE201C080E237FD8DE2B70190E00E948E
:100570004704A51438F4B70180E390E00E944704D3
:100580005A94F7CFAA94F401EA0DF11D8081B701C6
:1005900090E00E944704A110F5CF332009F451CE1A
:1005A000B70180E290E00E9447043A94F6CFF70149
:1005B0008681978102C08FEF9FEF2C96E2E10C9429
:1005C000F6040F931F93CF93DF93869F8001879F3D
:1005D000100D969F100D1124C8010E94FD02EC0120
:1005E000009729F0A80160E070E00E943504CE0178
:1005F000DF91CF911F910F910895CF93DF938230B8
:10060000910510F482E090E0E091433EF091443E89
:1006100020E030E0C0E0D0E0309711F1408151811E
:1006200048175907C0F04817590761F48281938130
:10063000209719F08A839B832BC08093433E90932D
:10064000443E26C02115310519F04217530718F40E
:100650009A01BE01DF01EF010280F381E02DDCCFC2
:100660002115310509F1281B390B2430310590F48F
:1006700012968D919C9113976115710521F0FB01E4
:100680008283938304C08093433E9093443EFD0154
:10069000329644C0FD01E20FF31F819391932250E3
:1006A00031092D933C933AC02091413E3091423E16
:1006B000232B41F42091023E3091033E2093413E92
:1006C0003093423E2091003E3091013E211531058C
:1006D00041F42DB73EB74091043E5091053E241B96
:1006E000350BE091413EF091423EE217F307A0F452
:1006F0002E1B3F0B2817390778F0AC014E5F5F4F78
:100700002417350748F04E0F5F1F4093413E50932A
:10071000423E8193919302C0E0E0F0E0CF01DF918F
:10072000CF9108950F931F93CF93DF93009709F410
:100730008CC0FC013297128213820091433E1091CB
:10074000443E0115110581F420813181820F931FF0
:100750002091413E3091423E2817390779F5E093C8
:10076000413EF093423E71C0D80140E050E0AE17E8
:10077000BF0750F412962D913C911397AD012115AE
:10078000310509F1D901F3CF9D01DA0122833383C9
:1007900060817181860F971F8217930769F4EC01BE
:1007A00028813981260F371F2E5F3F4F20833183E9
:1007B0008A819B8182839383452B29F4E093433E76
:1007C000F093443E42C01296ED93FC931397ED01D3
:1007D000499159919E01240F351FE217F30771F4D7
:1007E00080819181840F951F02968D939C93119720
:1007F0008281938112968D939C931397E0E0F0E0B1
:10080000D80112968D919C911397009719F0F801D9
:100810008C01F6CF8D919C9198012E5F3F4F820FF6
:10082000931F2091413E3091423E2817390769F4C9
:10083000309729F41092433E1092443E02C0128237
:1008400013820093413E1093423EDF91CF911F915E
:100850000F910895FC010590615070400110D8F788
:10086000809590958E0F9F1F0895DC0101C06D93B8
:1008700041505040E0F70895FC01615070400190F4
:100880000110D8F7809590958E0F9F1F08950F93B4
:100890001F93CF93DF93FB01238121FD03C08FEFD3
:1008A0009FEF28C022FF16C04681578124813581E1
:1008B0004217530744F4A081B1819D012F5F3F4F40
:1008C000208331838C93268137812F5F3F4F26838E
:1008D000378310C0EB01092F182F0084F185E02D1C
:1008E0000995892BE1F68E819F8101968E839F83E6
:1008F000812F902FDF91CF911F910F910895FA01D1
:10090000AA27283051F1203181F1E8946F936E7F4E
:100910006E5F7F4F8F4F9F4FAF4FB1E03ED0B4E03F
:100920003CD0670F781F891F9A1FA11D680F791F80
:100930008A1F911DA11D6A0F711D811D911DA11D91
:1009400020D009F468943F912AE0269F11243019A1
:10095000305D3193DEF6CF010895462F4770405D3C
:100960004193B3E00FD0C9F7F6CF462F4F70405DEB
:100970004A3318F0495D31FD4052419302D0A9F746
:10098000EACFB4E0A6959795879577956795BA9540
:10099000C9F700976105710508959B01AC010A2E06
:1009A00006945795479537952795BA95C9F7620FDD
:1009B000731F841F951FA01D08952F923F924F9281
:1009C0005F926F927F928F929F92AF92BF92CF92DF
:1009D000DF92EF92FF920F931F93CF93DF93CDB7E8
:1009E000DEB7CA1BDB0BCDBFDEBF09942A8839886E
:1009F00048885F846E847D848C849B84AA84B984B7
:100A0000C884DF80EE80FD800C811B81AA81B981C2
:100A1000CE0FD11DCDBFDEBFED010895F894FFCFFD
:100A20000000453E20004C6967687420696E74655B
:100A30006E736974792069732063757272656E7460
:100A40006C79202564206272696768746E657373BF
:0A0A500020706F696E7473210A00B4
:00000001FF
S01000005461736B315F4C462E737265635F
S113000019C02AC029C028C027C026C025C024C0C2
S113001023C022C021C020C01FC01EC01DC01CC0E0
S11300201BC01AC019C018C017C016C0A2C014C083
S113003013C012C011241FBECFEFCDBFDFE3DEBF5C
S11300402EE3A0E0BEE301C01D92A430B207E1F7A5
S11300500E944E000C94E0000C940000E0E0F6E0F6
S113006080818460808381818260818382818061D8
S11300708283828182838081816080830895E0E02D
S1130080F6E08683838581608387808581608087AD
S1130090838580FFFDCF8091100608956CE675E09E
S11300A080E090E00E9497000E942E007894CDECAE
S11300B086E00E943F0080958C9F912D1124969597
S11300C096959695392F330F232F220F220F230F46
S11300D0821B8093013E9C9F812D112486958695D9
S11300E08695382F330F232F220F220F230F921BB5
S11300F09093023E8093033E8093003E805D0E9475
S1130100AF008091023E805D0E94AF008091013E6D
S1130110805D0E94AF0080E20E94AF002AE28CE280
S11301209AE0215080409040E1F70000C1CF0F9346
S11301301F93E0E2F4E024E025832183072F182FA6
S1130140292F3327E0E0F8E0018760878681806CFF
S113015086838581806885831F910F910895E0E0EF
S1130160F8E0948195FFFDCFE0E0F8E0138282830C
S113017008951F920F920FB60F9211242F933F935D
S11301804F935F936F937F938F939F93AF93BF939B
S1130190EF93FF93809100088F5F0E94AF00FF915F
S11301A0EF91BF91AF919F918F917F916F915F91EB
S11301B04F913F912F910F900FBE0F901F90189564
S10701C0F894FFCFDD
S113000019C035C034C033C032C031C030C02FC075
S11300102EC02DC02CC02BC02AC029C028C027C088
S113002026C025C024C023C022C021C089C01FC04F
S11300301EC01DC011241FBECFEFCDBFDFE3DEBF46
S11300401EE3A0E0BEE3E0E2FAE002C005900D92F8
S1130050AA33B107D9F72EE3AAE3BEE301C01D9288
S1130060A534B207E1F70E9459000C940E050C94D4
S11300700000E0E0F6E0808184608083818182601A
S11300808183828180618283828182838081816095
S113009080830895E0E0F6E086838385816083872A
S11300A0808581608087838580FFFDCF80911006E5
S11300B008956CE675E080E090E00E9487000E945D
S11300C039007894C6E0DEE386E00E944A00809519
S11300D080933A3E1F928F93DF93CF930E94F9004F
S11300E09AE22CE28AE0915020408040E1F700003F
S11300F00F900F900F900F90E7CFE0E0F8E094811D
S113010095FFFDCF8093020880E090E00895E0E23F
S1130110F4E0258124602583218124602183E0E0AB
S1130120F8E0608771878681806C8683858180682A
S1130130858360E070E08DE790E00E94AE00089552
S11301401F920F920FB60F9211248F938091000883
S11301508F910F900FBE0F901F9018950F931F93C0
S1130160CF93DF93009731F46115710519F480E0A2
S113017090E03AC08B01EC016EE070E081E090E029
S11301800E94E102FC01892B91F380E8838301152D
S1130190110571F00287138781E8838380913B3EC8
S11301A090913C3E892B21F4E0933B3EF0933C3EFE
S11301B02097C9F0C087D18783818260838380912F
S11301C03D3E90913E3E892B71F4E0933D3EF09389
S11301D03E3E80913F3E9091403E892B21F4E09336
S11301E03F3EF093403ECF01DF91CF911F910F919D
S11301F00895A0E0B0E0EFEFF0E00C94ED04AE0160
S11302004B5F5F4FFA0161917191AF0180913D3E67
S113021090913E3E0E940F01E2E00C940605ACE092
S1130220B0E0E5E1F1E00C94DD047C016B018A01AE
S1130230FC0116821782838181FFBDC1CE01019624
S11302404C01F7019381F60193FD859193FF819110
S11302506F01882309F4ABC1853239F493FD85918C
S113026093FF81916F01853229F4B70190E00E94D8
S11302704704E7CF512C312C20E02032A0F48B32FC
S113028069F030F4803259F0833269F420612CC073
S11302908D3239F0803339F4216026C02260246025
S11302A023C0286021C027FD27C030ED380F3A3025
S11302B078F426FF06C0FAE05F9E300D1124532E19
S11302C013C08AE0389E300D1124332E20620CC0F6
S11302D08E3221F426FD6BC1206406C08C3611F4E5
S11302E0206802C0883641F4F60193FD859193FF9E
S11302F081916F018111C1CF982F9F7D95549330C7
S113030028F40C5F1F4FFFE3F9830DC0833631F0EF
S1130310833771F0833509F05BC022C0F801808116
S113032089830E5F1F4F44244394512C540115C0FC
S11303303801F2E06F0E711CF801A080B18026FF35
S113034003C0652D70E002C06FEF7FEFC5012C87FD
S11303500E943C042C0183012C852F77222E17C088
S11303603801F2E06F0E711CF801A080B18026FF05
S113037003C0652D70E002C06FEF7FEFC5012C87CD
S11303800E942A042C012C852068222E830123FC40
S11303901BC0832D90E048165906B0F4B70180E2E3
S11303A090E00E9447043A94F4CFF50127FC85912C
S11303B027FE81915F01B70190E00E94470431104C
S11303C03A94F1E04F1A51084114510471F7E5C011
S11303D0843611F0893639F5F80127FF07C06081AA
S11303E07181828193810C5F1F4F08C0608171818C
S11303F0072E000C880B990B0E5F1F4F2F76722E61
S113040097FF09C090958095709561957F4F8F4FA8
S11304109F4F2068722E2AE030E0A4010E947F04DE
S1130420A82EA81844C0853729F42F7EB22E2AE0BE
S113043030E025C0F22FF97FBF2E8F36C1F018F4BB
S1130440883579F0B4C0803719F0883721F0AFC00F
S11304502F2F2061B22EB4FE0DC08B2D8460B82ED8
S113046009C024FF0AC09F2F9660B92E06C028E059
S113047030E005C020E130E002C020E132E0F801C4
S1130480B7FE07C060817181828193810C5F1F4F29
S113049006C06081718180E090E00E5F1F4FA4016F
S11304A00E947F04A82EA818FB2DFF777F2E76FECE
S11304B00BC0372D3E7FA51450F474FE0AC072FCA5
S11304C008C0372D3E7E05C0BA2C372D03C0BA2C88
S11304D001C0B52C34FF0DC0FE01EA0DF11D808171
S11304E0803311F4397E09C032FF06C0B394B3944B
S11304F004C0832F867809F0B39433FD13C030FF12
S113050006C05A2CB31418F4530C5B18B32CB31450
S113051068F4B70180E290E03C870E944704B394FA
S11305203C85F5CFB31410F43B1801C0312C34FFD3
S113053012C0B70180E390E03C870E9447043C85E9
S113054032FF17C031FD03C088E790E002C088E5A0
S113055090E0B7010CC0832F867859F031FF02C0B8
S11305608BE201C080E237FD8DE2B70190E00E948A
S11305704704A51438F4B70180E390E00E944704CF
S11305805A94F7CFAA94F401EA0DF11D8081B701C2
S113059090E00E944704A110F5CF332009F451CE16
S11305A0B70180E290E00E9447043A94F6CFF70145
S11305B08681978102C08FEF9FEF2C96E2E10C9425
S11305C0F6040F931F93CF93DF93869F8001879F39
S11305D0100D969F100D1124C8010E94FD02EC011C
S11305E0009729F0A80160E070E00E943504CE0174
S11305F0DF91CF911F910F910895CF93DF938230B4
S1130600910510F482E090E0E091433EF091443E85
S113061020E030E0C0E0D0E0309711F1408151811A
S113062048175907C0F04817590761F4828193812C
S1130630209719F08A839B832BC08093433E909329
S1130640443E26C02115310519F04217530718F40A
S11306509A01BE01DF01EF010280F381E02DDCCFBE
S11306602115310509F1281B390B2430310590F48B
S113067012968D919C9113976115710521F0FB01E0
S11306808283938304C08093433E9093443EFD0150
S1130690329644C0FD01E20FF31F819391932250DF
S11306A031092D933C933AC02091413E3091423E12
S11306B0232B41F42091023E3091033E2093413E8E
S11306C03093423E2091003E3091013E2115310588
S11306D041F42DB73EB74091043E5091053E241B92
S11306E0350BE091413EF091423EE217F307A0F44E
S11306F02E1B3F0B2817390778F0AC014E5F5F4F74
S11307002417350748F04E0F5F1F4093413E509326
S1130710423E8193919302C0E0E0F0E0CF01DF918B
S1130720CF9108950F931F93CF93DF93009709F40C
S11307308CC0FC013297128213820091433E1091C7
S1130740443E0115110581F420813181820F931FEC
S11307502091413E3091423E2817390779F5E093C4
S1130760413EF093423E71C0D80140E050E0AE17E4
S1130770BF0750F412962D913C911397AD012115AA
S1130780310509F1D901F3CF9D01DA0122833383C5
S113079060817181860F971F8217930769F4EC01BA
S11307A028813981260F371F2E5F3F4F20833183E5
S11307B08A819B8182839383452B29F4E093433E72
S11307C0F093443E42C01296ED93FC931397ED01CF
S11307D0499159919E01240F351FE217F30771F4D3
S11307E080819181840F951F02968D939C9311971C
S11307F08281938112968D939C931397E0E0F0E0AD
S1130800D80112968D919C911397009719F0F801D5
S11308108C01F6CF8D919C9198012E5F3F4F820FF2
S1130820931F2091413E3091423E2817390769F4C5
S1130830309729F41092433E1092443E02C0128233
S113084013820093413E1093423EDF91CF911F915A
S11308500F910895FC010590615070400110D8F784
S1130860809590958E0F9F1F0895DC0101C06D93B4
S113087041505040E0F70895FC01615070400190F0
S11308800110D8F7809590958E0F9F1F08950F93B0
S11308901F93CF93DF93FB01238121FD03C08FEFCF
S11308A09FEF28C022FF16C04681578124813581DD
S11308B04217530744F4A081B1819D012F5F3F4F3C
S11308C0208331838C93268137812F5F3F4F26838A
S11308D0378310C0EB01092F182F0084F185E02D18
S11308E00995892BE1F68E819F8101968E839F83E2
S11308F0812F902FDF91CF911F910F910895FA01CD
S1130900AA27283051F1203181F1E8946F936E7F4A
S11309106E5F7F4F8F4F9F4FAF4FB1E03ED0B4E03B
S11309203CD0670F781F891F9A1FA11D680F791F7C
S11309308A1F911DA11D6A0F711D811D911DA11D8D
S113094020D009F468943F912AE0269F112430199D
S1130950305D3193DEF6CF010895462F4770405D38
S11309604193B3E00FD0C9F7F6CF462F4F70405DE7
S11309704A3318F0495D31FD4052419302D0A9F742
S1130980EACFB4E0A6959795879577956795BA953C
S1130990C9F700976105710508959B01AC010A2E02
S11309A006945795479537952795BA95C9F7620FD9
S11309B0731F841F951FA01D08952F923F924F927D
S11309C05F926F927F928F929F92AF92BF92CF92DB
S11309D0DF92EF92FF920F931F93CF93DF93CDB7E4
S11309E0DEB7CA1BDB0BCDBFDEBF09942A8839886A
S11309F048885F846E847D848C849B84AA84B984B3
S1130A00C884DF80EE80FD800C811B81AA81B981BE
S1130A10CE0FD11DCDBFDEBFED010895F894FFCFF9
S1130A200000453E20004C6967687420696E746557
S1130A306E736974792069732063757272656E745C
S1130A406C79202564206272696768746E657373BB
S10D0A5020706F696E7473210A00B0
S9030000FC
......@@ -15,7 +15,10 @@ main.d main.o: .././main.c \
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay_basic.h \
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\math.h \
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\interrupt.h \
.././adc.h .././uart.h
.././adc.h .././uart.h \
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\stdio.h \
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\4.9.2\include\stdarg.h \
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\4.9.2\include\stddef.h
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\io.h:
......@@ -52,3 +55,9 @@ d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\interrupt.h:
.././adc.h:
.././uart.h:
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\stdio.h:
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\4.9.2\include\stdarg.h:
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\4.9.2\include\stddef.h:
......@@ -11,7 +11,11 @@ uart.d uart.o: .././uart.c \
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\xmega.h \
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\fuse.h \
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\lock.h \
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\interrupt.h
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\interrupt.h \
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\stdio.h \
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\4.9.2\include\stdarg.h \
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\4.9.2\include\stddef.h \
.././uart.h
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\io.h:
......@@ -38,3 +42,11 @@ d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\fuse.h:
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\lock.h:
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\interrupt.h:
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\stdio.h:
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\4.9.2\include\stdarg.h:
d:\atmel\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\4.9.2\include\stddef.h:
.././uart.h:
......@@ -11,6 +11,7 @@ void adc_init(){
ADC0.CTRLA |= (ADC_RESSEL_8BIT_gc); //Set resolution, we choose 8 bits
ADC0.CTRLB |= (ADC_SAMPLNUM_ACC4_gc); //OPTIONAL: We can use multiple samples if we like, example here with 4
//More samples gives a better result but takes longer
ADC0.CTRLC |= (ADC_REFSEL_VDDREF_gc); //We select to use the supply voltage (VDD) as voltage reference
ADC0.CTRLC |= (ADC_PRESC_DIV2_gc); //ADC clock prescaler, best accuracy when run below 2MHz. (Here div2 ~1.46 MHz)
......@@ -21,6 +22,7 @@ void adc_init(){
uint8_t adc_read(uint8_t channel){
ADC0.MUXPOS = channel; //Select input on the ADC mux
//NOTE: We can use = here because this is the only thing the register holds. Neat!
ADC0.INTFLAGS |= (ADC_RESRDY_bm); //Clear the results ready flag
......
......@@ -18,32 +18,35 @@
#define LIGHT 6 // Light sensor is connected to ADC channel 6 (which is on port A pin 6)
uint8_t data, ones, tens, hundreds;
uint8_t data = 0;
int main(void)
{
uart_init(BAUD_9600);
uart_init(BAUD_9600); //Initiate the uart (provided in uart.c) with a baudrate of 9600
adc_init();
adc_init(); //Initiate the adc (The student has to write this function)
sei();
sei(); //If we want to receive via UART we need interrupts enabled.
//NOTE: UART isn't used to receive here and as such this isn't required.
while (1)
{
data = adc_read(6);
data = 0xff - data;
ones = (data%10);
data /= 10;
tens = (data%10);
data /= 10;
hundreds = (data%10);
data = adc_read(LIGHT); //Read the analog voltage on channel 6, connected to light sensor
uart_transmit(hundreds + 48);
uart_transmit(tens + 48);
uart_transmit(ones + 48);
uart_transmit(0x20); //Space
//The light sensor returns the ones complement (the opposite) of the brightness:
data = 0xff - data;
printf("Light intensity is currently %d brightness points!\n", data); //Print out the value neatly using printf
/*
About printf: Handles formatting of your print to terminal. This includes special characters, values of variables and more.
It takes one string and any variables you want to print.
Some handy special characters: \n = newline (enter), \t = tab
% marks a variable to be inserted in the string. %d = decimal, %x = hexadecimal, %f = floating point number (There are many more)
Variables to be inserted have to be provided comma separated after the string in order of appearance in string.
*/
_delay_ms(1000); //Wait a little before next read
}
......
......@@ -9,34 +9,42 @@
#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdio.h>
#include "uart.h"
void uart_init(unsigned long baud){
//From chapter 24.3 in datasheet
PORTB.OUTSET = (1 << PIN2_bp);
PORTB.DIRSET = (1 << PIN2_bp); //Setting up TX pin as output
USART0.BAUDH = (baud >> 8); //Shift register right by 8 bits
USART0.BAUDL = baud; //Set baud rate
PORTB.OUTSET |= (1 << PIN2_bp);
PORTB.DIRSET |= (1 << PIN2_bp); //Setting up TX pin as high output
USART0.BAUD = baud; //Set baudrate
//USART.CTRLC CMODE bits default to: async, 1 stop bit, 8 bit character size
USART0.CTRLB |= (1 << USART_RXEN_bp) | (1 << USART_TXEN_bp); //Enable RX and TX
USART0.CTRLA |= (1 << USART_RXCIE_bp); //Enable interupts on RX
fdevopen(uart_transmit, NULL); //This allows us to use printf instead of writing a single character at a time
//It also allows for easily printing variable values: printf("X is currently: %d \n", x_var);
}
// function to transmit data
void uart_transmit(unsigned char data){
while (!(USART0.STATUS & (1 << USART_DREIF_bp)));
USART0.TXDATAH = 0x00; //Is required!
USART0.TXDATAL = data;
int uart_transmit(char data, FILE* stream){
while (!(USART0.STATUS & (1 << USART_DREIF_bp))){
//Wait for ongoing transmission to finish (if there is one)
}
USART0.TXDATAL = data; //Put new data in register
return 0;
}
//Interrupt service routine for the receiver.
//Interrupt service routine for receiving
ISR(USART0_RXC_vect){
uint8_t data = USART0.RXDATAL; //We must read the data to clear the interrupt flag
//Do things with data (if you want)
uart_transmit(data + 1);
//Here we can do something with data if we would want that
}
\ No newline at end of file
......@@ -9,8 +9,10 @@
#ifndef UART_H_
#define UART_H_
void uart_init(unsigned long baud);
#include <stdio.h> //Required for the FILE* type to be recognzed in the uart_transmit prototype
void uart_transmit(unsigned char data);
void uart_init(unsigned long baud);
int uart_transmit(char data, FILE* stream);
#endif /* UART_H_ */
\ No newline at end of file
......@@ -11,6 +11,7 @@
#include "display.h"
const uint8_t bitmap[512] PROGMEM =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
......@@ -52,12 +53,12 @@ int main(void)
DISP_init();
//DISP_write_bitmap(bitmap); //Printing Bitmap
DISP_print("Hello World!"); //Printing text
DISP_write_bitmap(bitmap); //Printing Bitmap
//DISP_print("Hello World!"); //Printing text
while (1)
{
}
}
......@@ -13,15 +13,17 @@
// You need to setup SPI communication in SPI_MasterInit() and
// transmit data in SPI_MasterTransmit(...).
//
// HINT: Check out the defines in the file defines.h to see defines
// such as data direction registers and bit positions, and as always:
// HINT: Check out the , and as always:
// RTFD
//Oled is connected to alternate SPI pins
#define MOSI_BIT 2 //on port C
#define SCK_BIT 0 //on port C
#define SS_BIT 3 //on port C
#define SPI_PORT PORTC //
#define SPI_PORT PORTC //We can now use SPI_PORT.DIR, .OUT etc.
//We could also have defined bit masks for MOSI, SCL and SS.
//Then we wouldn't have to shift them all the time
......@@ -30,7 +32,7 @@ void SPI_MasterInit()
// Initialize the SPI port as master
// You will need to set MOSI, SCK, SS (slave select) as outputs
PORTMUX.CTRLB |= (1 << PORTMUX_SPI0_bp); //To use alternative SPI pins
PORTMUX.CTRLB |= PORTMUX_SPI0_bm; //To use alternative SPI pins
SPI_PORT.DIR |= (1 << MOSI_BIT) | (1 << SCK_BIT) | (1 << SS_BIT); //Set pins as output
......@@ -39,26 +41,28 @@ void SPI_MasterInit()
// Now enable SPI, Master and set clock rate
SPI0.CTRLA |= (1 << SPI_ENABLE_bp) | (1 << SPI_MASTER_bp); //Default clock divisor of 4 is fine
SPI0.CTRLA |= SPI_ENABLE_bm | SPI_MASTER_bm; //Default clock divisor of 4 is fine
//Make sure SS does not disable master mode
SPI0.CTRLB |= (1 << SPI_SSD_bp);
//Make sure SS does not disable master mode (Possibly not required)
SPI0.CTRLB |= SPI_SSD_bm;
}
void SPI_MasterTransmit(char cData)
{
// First select the correct slave by setting the slave select (SS) bit LOW
// First select the correct slave by setting its slave select (SS) LOW
PORTC.OUTCLR = (1 << SS_BIT);
// Then start the transmission by assigning the data to the SPI data register
SPI0.DATA = cData;
// Now wait for the data transmission to complete by periodically checking the SPI status register
//the SPI_IF is the only interupt flag with a function in non-buffered mode.
while(!(SPI0.INTFLAGS & (1 << SPI_IF_bp)));
//the SPI_IF and SPI_WRCOL is the only interrupt flag with a function in non-buffered mode.
while(!(SPI0.INTFLAGS & SPI_IF_bm)){
}
SPI0.DATA; //Dummy read to clear flag
// Finally set the slave select bit HIGH before leaving the function
......
#include <avr/io.h>
void adc_init(){
//This function sets up the required registers to initialize the ADC
/*
Not as much help this time around.
We want our ADC to run in 8 bit mode using the supply voltage (VDD) as reference.
The rest is up to you to find out.
*/
}
uint8_t adc_read(uint8_t channel){
//This function takes in a channel and returns the result of the ADC opperation on that channel
//Keep in mind an ADC operation takes a little time
}
#ifndef ADC_H_
#define ADC_H_
void adc_init(void); //This function initialezes the ADC module
uint8_t adc_read(uint8_t channel); //THis function takes in a channel and returns the result of the ADC measurement of the channel
#endif /* ADC_H_ */
\ No newline at end of file
#define F_CPU 3333333UL
#define BAUD_9600 ((4UL*F_CPU)/9600)
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "adc.h"