From 6d0e569a3fbc02ad1538ceb7e172399b45345341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Tue, 11 Jun 2013 14:47:29 +0200 Subject: [PATCH] created software directory --- display/db_bp_led_panel.brd | 581 ++++ display/db_bp_led_panel.sch | 2374 +++++++++++++++++ display/software/.idea/.name | 1 + display/software/.idea/compiler.xml | 23 + .../.idea/copyright/profiles_settings.xml | 5 + display/software/.idea/encodings.xml | 5 + display/software/.idea/misc.xml | 8 + display/software/.idea/modules.xml | 10 + .../software/.idea/scopes/scope_settings.xml | 5 + display/software/.idea/uiDesigner.xml | 125 + display/software/.idea/vcs.xml | 7 + display/software/.idea/workspace.xml | 486 ++++ display/software/displayboard/Makefile | 56 + .../software/displayboard/displayboard.iml | 12 + display/software/powerboard/.dep/adc.o.d | 33 + display/software/powerboard/.dep/main.o.d | 47 + display/software/powerboard/.dep/utils.o.d | 43 + display/software/powerboard/Makefile | 436 +++ display/software/powerboard/main.eep | 1 + display/software/powerboard/main.elf | Bin 0 -> 9594 bytes display/software/powerboard/main.hex | 27 + display/software/powerboard/main.lss | 399 +++ display/software/powerboard/main.map | 458 ++++ display/software/powerboard/main.sym | 75 + display/software/powerboard/powerboard.iml | 10 + display/software/powerboard/src/adc.c | 41 + display/software/powerboard/src/adc.h | 8 + display/software/powerboard/src/adc.lst | 155 ++ display/software/powerboard/src/adc.o | Bin 0 -> 4244 bytes display/software/powerboard/src/asciiart.h | 138 + display/software/powerboard/src/main.c | 88 + display/software/powerboard/src/main.h | 26 + display/software/powerboard/src/main.lst | 175 ++ display/software/powerboard/src/main.o | Bin 0 -> 4836 bytes display/software/powerboard/src/utils.c | 14 + display/software/powerboard/src/utils.h | 9 + display/software/powerboard/src/utils.lst | 62 + display/software/powerboard/src/utils.o | Bin 0 -> 3680 bytes 38 files changed, 5943 insertions(+) create mode 100644 display/db_bp_led_panel.brd create mode 100644 display/db_bp_led_panel.sch create mode 100644 display/software/.idea/.name create mode 100644 display/software/.idea/compiler.xml create mode 100644 display/software/.idea/copyright/profiles_settings.xml create mode 100644 display/software/.idea/encodings.xml create mode 100644 display/software/.idea/misc.xml create mode 100644 display/software/.idea/modules.xml create mode 100644 display/software/.idea/scopes/scope_settings.xml create mode 100644 display/software/.idea/uiDesigner.xml create mode 100644 display/software/.idea/vcs.xml create mode 100644 display/software/.idea/workspace.xml create mode 100644 display/software/displayboard/Makefile create mode 100644 display/software/displayboard/displayboard.iml create mode 100644 display/software/powerboard/.dep/adc.o.d create mode 100644 display/software/powerboard/.dep/main.o.d create mode 100644 display/software/powerboard/.dep/utils.o.d create mode 100644 display/software/powerboard/Makefile create mode 100644 display/software/powerboard/main.eep create mode 100755 display/software/powerboard/main.elf create mode 100644 display/software/powerboard/main.hex create mode 100644 display/software/powerboard/main.lss create mode 100644 display/software/powerboard/main.map create mode 100644 display/software/powerboard/main.sym create mode 100644 display/software/powerboard/powerboard.iml create mode 100644 display/software/powerboard/src/adc.c create mode 100644 display/software/powerboard/src/adc.h create mode 100644 display/software/powerboard/src/adc.lst create mode 100644 display/software/powerboard/src/adc.o create mode 100644 display/software/powerboard/src/asciiart.h create mode 100644 display/software/powerboard/src/main.c create mode 100644 display/software/powerboard/src/main.h create mode 100644 display/software/powerboard/src/main.lst create mode 100644 display/software/powerboard/src/main.o create mode 100644 display/software/powerboard/src/utils.c create mode 100644 display/software/powerboard/src/utils.h create mode 100644 display/software/powerboard/src/utils.lst create mode 100644 display/software/powerboard/src/utils.o diff --git a/display/db_bp_led_panel.brd b/display/db_bp_led_panel.brd new file mode 100644 index 0000000..3ae59e6 --- /dev/null +++ b/display/db_bp_led_panel.brd @@ -0,0 +1,581 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +db_bp_led_panel + + + +<b>Harting & 3M Connectors</b><p> +Low profile connectors, straight<p> +<author>Created by librarian@cadsoft.de</author> + + +<b>HARTING</b> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +14 +1 +2 + + + + + + + + + + + + + + + + + + +<b>LEDs</b><p> +<author>Created by librarian@cadsoft.de</author><br> +Extended by Federico Battaglin <author>&lt;federico.rd@fdpinternational.com&gt;</author> with DUOLED + + +<B>LED</B><p> +5 mm, round + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + +<b>EAGLE Design Rules</b> +<p> +Die Standard-Design-Rules sind so gewählt, dass sie für +die meisten Anwendungen passen. Sollte ihre Platine +besondere Anforderungen haben, treffen Sie die erforderlichen +Einstellungen hier und speichern die Design Rules unter +einem neuen Namen ab. +<b>EAGLE Design Rules</b> +<p> +The default Design Rules have been set to cover +a wide range of applications. Your particular design +may have different requirements, so please make the +necessary adjustments and save your customized +design rules under a new name. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/display/db_bp_led_panel.sch b/display/db_bp_led_panel.sch new file mode 100644 index 0000000..e7e6684 --- /dev/null +++ b/display/db_bp_led_panel.sch @@ -0,0 +1,2374 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Date: +>LAST_DATE_TIME +Sheet: +>SHEET +REV: +TITLE: +Document Number: +>DRAWING_NAME + + + + + + + +<b>FRAME</b><p> +DIN A4, landscape with extra doc field + + + + + + + + + + + + + + + +<b>Harting & 3M Connectors</b><p> +Low profile connectors, straight<p> +<author>Created by librarian@cadsoft.de</author> + + +<b>HARTING</b> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +14 +1 +2 + + + + + + + + + + + + + + + + +<b>HARTING</b> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1 +2 +>NAME +>VALUE +14 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<b>3M</b> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + +<b>3M</b> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>VALUE +>NAME + + + + + + + + + + + + + + + + + + +<b>HARTING</b> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<b>LEDs</b><p> +<author>Created by librarian@cadsoft.de</author><br> +Extended by Federico Battaglin <author>&lt;federico.rd@fdpinternational.com&gt;</author> with DUOLED + + +<b>CHICAGO MINIATURE LAMP, INC.</b><p> +7022X Series SMT LEDs 1206 Package Size + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + +<B>LED</B><p> +5 mm, square, Siemens + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<B>LED</B><p> +2 x 5 mm, rectangle + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<B>LED</B><p> +3 mm, round + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<B>LED</B><p> +5 mm, round + + + + + + + + + + + +>NAME +>VALUE + + +<B>LED</B><p> +1 mm, round, Siemens + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<B>LED BLOCK</B><p> +1 LED, Siemens + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>LED HOLDER</b><p> +Siemens + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>LED HOLDER</b><p> +Siemens + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>LED HOLDER</b><p> +Siemens + + + + + + + + + + + + + + + + + +A+ +K- +>NAME +>VALUE + + + + + +<b>LED HOLDER</b><p> +Siemens + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE ++ +- + + +<B>IR LED</B><p> +infrared emitting diode, Infineon +TO-18, lead spacing 2.54 mm, cathode marking<p> +Inifineon + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<B>IR LED</B><p> +infrared emitting diode, Infineon +TO-18, lead spacing 2.54 mm, cathode marking<p> +Inifineon + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<B>LED</B><p> +rectangle, 5.7 x 3.2 mm + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<B>IR LED</B><p> +IR transmitter Siemens + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>TOPLED® High-optical Power LED (HOP)</b><p> +Source: http://www.osram.convergy.de/ ... ls_t675.pdf + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +A +C + + + + + + + +<b>BLUE LINETM Hyper Mini TOPLED® Hyper-Bright LED</b><p> +Source: http://www.osram.convergy.de/ ... LB M676.pdf + + + + + + + + + + + + + + +A +C +>NAME +>VALUE + + + + + + + +<b>Super SIDELED® High-Current LED</b><p> +LG A672, LP A672 <br> +Source: http://www.osram.convergy.de/ ... LG_LP_A672.pdf (2004.05.13) + + + + + + + + + + + + + + + + + + + +C +A +>NAME +>VALUE + + + + + + + +<b>SmartLEDTM Hyper-Bright LED</b><p> +Source: http://www.osram.convergy.de/ ... LA_LO_LS_LY L896.pdf + + + + + + + + +>NAME +>VALUE + + + + + +<b>Hyper TOPLED® RG Hyper-Bright LED</b><p> +Source: http://www.osram.convergy.de/ ... LA_LO_LS_LY T776.pdf + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +A +C + + + + + + + + + + +<b>Hyper Micro SIDELED®</b><p> +Source: http://www.osram.convergy.de/ ... LA_LO_LS_LY Y876.pdf + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + +<b>Power TOPLED®</b><p> +Source: http://www.osram.convergy.de/ ... LA_LO_LA_LY E67B.pdf + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +C +A +C +C + + + + + + + + + + + +<b>Hyper CHIPLED Hyper-Bright LED</b><p> +LB Q993<br> +Source: http://www.osram.convergy.de/ ... Lb_q993.pdf + + + + +>NAME +>VALUE + + + + + + + +<b>Hyper CHIPLED Hyper-Bright LED</b><p> +LB R99A<br> +Source: http://www.osram.convergy.de/ ... lb_r99a.pdf + + + + +>NAME +>VALUE + + + + + + + +<b>Mini TOPLED Santana®</b><p> +Source: http://www.osram.convergy.de/ ... LG M470.pdf + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + +<b>CHIPLED</b><p> +Source: http://www.osram.convergy.de/ ... LG_R971.pdf + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + +<b>CHIPLED</b><p> +Source: http://www.osram.convergy.de/ ... LG_LY N971.pdf + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + +<b>CHIPLED</b><p> +Source: http://www.osram.convergy.de/ ... LG_LY Q971.pdf + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + +<b>CHIPLED-0603</b><p> +Recommended Solder Pad useable for SmartLEDTM and Chipled - Package 0603<br> +Package able to withstand TTW-soldering heat<br> +Package suitable for TTW-soldering<br> +Source: http://www.osram.convergy.de/ ... LO_LS_LY L89K.pdf + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + + +<b>SmartLED TTW</b><p> +Recommended Solder Pad useable for SmartLEDTM and Chipled - Package 0603<br> +Package able to withstand TTW-soldering heat<br> +Package suitable for TTW-soldering<br> +Source: http://www.osram.convergy.de/ ... LO_LS_LY L89K.pdf + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + +<b>Lumileds Lighting. LUXEON®</b> with cool pad<p> +Source: K2.pdf + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<b>Lumileds Lighting. LUXEON®</b> without cool pad<p> +Source: K2.pdf + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + + + + + + + +<B>LED</B><p> +10 mm, round + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>SURFACE MOUNT LED LAMP</b> 3.5x2.8mm<p> +Source: http://www.kingbright.com/manager/upload/pdf/KA-3528ASYC(Ver1189474662.1) + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + + +<b>SML0805-2CW-TR (0805 PROFILE)</b> COOL WHITE<p> +Source: http://www.ledtronics.com/ds/smd-0603/Dstr0093.pdf + + + + + + + + + + + +>NAME +>VALUE + + +<b>SML10XXKH-TR (HIGH INTENSITY) LED</b><p> +<table> +<tr><td>SML10R3KH-TR</td><td>ULTRA RED</td></tr> +<tr><td>SML10E3KH-TR</td><td>SUPER REDSUPER BLUE</td></tr> +<tr><td>SML10O3KH-TR</td><td>SUPER ORANGE</td></tr> +<tr><td>SML10PY3KH-TR</td><td>PURE YELLOW</td></tr> +<tr><td>SML10OY3KH-TR</td><td>ULTRA YELLOW</td></tr> +<tr><td>SML10AG3KH-TR</td><td>AQUA GREEN</td></tr> +<tr><td>SML10BG3KH-TR</td><td>BLUE GREEN</td></tr> +<tr><td>SML10PB1KH-TR</td><td>SUPER BLUE</td></tr> +<tr><td>SML10CW1KH-TR</td><td>WHITE</td></tr> +</table> + +Source: http://www.ledtronics.com/ds/smd-1206/dstr0094.PDF + + + + + + + +>NAME +>VALUE + + + + + + + + + +<b>SML0603-XXX (HIGH INTENSITY) LED</b><p> +<table> +<tr><td>AG3K</td><td>AQUA GREEN</td></tr> +<tr><td>B1K</td><td>SUPER BLUE</td></tr> +<tr><td>R1K</td><td>SUPER RED</td></tr> +<tr><td>R3K</td><td>ULTRA RED</td></tr> +<tr><td>O3K</td><td>SUPER ORANGE</td></tr> +<tr><td>O3KH</td><td>SOFT ORANGE</td></tr> +<tr><td>Y3KH</td><td>SUPER YELLOW</td></tr> +<tr><td>Y3K</td><td>SUPER YELLOW</td></tr> +<tr><td>2CW</td><td>WHITE</td></tr> +</table> +Source: http://www.ledtronics.com/ds/smd-0603/Dstr0092.pdf + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + +<b>LED</b><p> +<u>OSRAM</u>:<br> + +- <u>CHIPLED</u><br> +LG R971, LG N971, LY N971, LG Q971, LY Q971, LO R971, LY R971 +LH N974, LH R974<br> +LS Q976, LO Q976, LY Q976<br> +LO Q996<br> + +- <u>Hyper CHIPLED</u><br> +LW Q18S<br> +LB Q993, LB Q99A, LB R99A<br> + +- <u>SideLED</u><br> +LS A670, LO A670, LY A670, LG A670, LP A670<br> +LB A673, LV A673, LT A673, LW A673<br> +LH A674<br> +LY A675<br> +LS A676, LA A676, LO A676, LY A676, LW A676<br> +LS A679, LY A679, LG A679<br> + +- <u>Hyper Micro SIDELED®</u><br> +LS Y876, LA Y876, LO Y876, LY Y876<br> +LT Y87S<br> + +- <u>SmartLED</u><br> +LW L88C, LW L88S<br> +LB L89C, LB L89S, LG L890<br> +LS L89K, LO L89K, LY L89K<br> +LS L896, LA L896, LO L896, LY L896<br> + +- <u>TOPLED</u><br> +LS T670, LO T670, LY T670, LG T670, LP T670<br> +LSG T670, LSP T670, LSY T670, LOP T670, LYG T670<br> +LG T671, LOG T671, LSG T671<br> +LB T673, LV T673, LT T673, LW T673<br> +LH T674<br> +LS T676, LA T676, LO T676, LY T676, LB T676, LH T676, LSB T676, LW T676<br> +LB T67C, LV T67C, LT T67C, LS T67K, LO T67K, LY T67K, LW E67C<br> +LS E67B, LA E67B, LO E67B, LY E67B, LB E67C, LV E67C, LT E67C<br> +LW T67C<br> +LS T679, LY T679, LG T679<br> +LS T770, LO T770, LY T770, LG T770, LP T770<br> +LB T773, LV T773, LT T773, LW T773<br> +LH T774<br> +LS E675, LA E675, LY E675, LS T675<br> +LS T776, LA T776, LO T776, LY T776, LB T776<br> +LHGB T686<br> +LT T68C, LB T68C<br> + +- <u>Hyper Mini TOPLED®</u><br> +LB M676<br> + +- <u>Mini TOPLED Santana®</u><br> +LG M470<br> +LS M47K, LO M47K, LY M47K +<p> +Source: http://www.osram.convergy.de<p> + +<u>LUXEON:</u><br> +- <u>LUMILED®</u><br> +LXK2-PW12-R00, LXK2-PW12-S00, LXK2-PW14-U00, LXK2-PW14-V00<br> +LXK2-PM12-R00, LXK2-PM12-S00, LXK2-PM14-U00<br> +LXK2-PE12-Q00, LXK2-PE12-R00, LXK2-PE12-S00, LXK2-PE14-T00, LXK2-PE14-U00<br> +LXK2-PB12-K00, LXK2-PB12-L00, LXK2-PB12-M00, LXK2-PB14-N00, LXK2-PB14-P00, LXK2-PB14-Q00<br> +LXK2-PR12-L00, LXK2-PR12-M00, LXK2-PR14-Q00, LXK2-PR14-R00<br> +LXK2-PD12-Q00, LXK2-PD12-R00, LXK2-PD12-S00<br> +LXK2-PH12-R00, LXK2-PH12-S00<br> +LXK2-PL12-P00, LXK2-PL12-Q00, LXK2-PL12-R00 +<p> +Source: www.luxeon.com<p> + +<u>KINGBRIGHT:</U><p> +KA-3528ASYC<br> +Source: www.kingbright.com + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/display/software/.idea/.name b/display/software/.idea/.name new file mode 100644 index 0000000..102e082 --- /dev/null +++ b/display/software/.idea/.name @@ -0,0 +1 @@ +bikegenerator \ No newline at end of file diff --git a/display/software/.idea/compiler.xml b/display/software/.idea/compiler.xml new file mode 100644 index 0000000..217af47 --- /dev/null +++ b/display/software/.idea/compiler.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/display/software/.idea/copyright/profiles_settings.xml b/display/software/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..3572571 --- /dev/null +++ b/display/software/.idea/copyright/profiles_settings.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/display/software/.idea/encodings.xml b/display/software/.idea/encodings.xml new file mode 100644 index 0000000..e206d70 --- /dev/null +++ b/display/software/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/display/software/.idea/misc.xml b/display/software/.idea/misc.xml new file mode 100644 index 0000000..a3368f0 --- /dev/null +++ b/display/software/.idea/misc.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/display/software/.idea/modules.xml b/display/software/.idea/modules.xml new file mode 100644 index 0000000..8f2a2e1 --- /dev/null +++ b/display/software/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/display/software/.idea/scopes/scope_settings.xml b/display/software/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/display/software/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/display/software/.idea/uiDesigner.xml b/display/software/.idea/uiDesigner.xml new file mode 100644 index 0000000..3b00020 --- /dev/null +++ b/display/software/.idea/uiDesigner.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/display/software/.idea/vcs.xml b/display/software/.idea/vcs.xml new file mode 100644 index 0000000..def6a6a --- /dev/null +++ b/display/software/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/display/software/.idea/workspace.xml b/display/software/.idea/workspace.xml new file mode 100644 index 0000000..599dce6 --- /dev/null +++ b/display/software/.idea/workspace.xml @@ -0,0 +1,486 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + localhost + 5050 + + + + + + + 1370952913198 + 1370952913198 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/display/software/displayboard/Makefile b/display/software/displayboard/Makefile new file mode 100644 index 0000000..c84bdf2 --- /dev/null +++ b/display/software/displayboard/Makefile @@ -0,0 +1,56 @@ +COMPILER=G++ + +# todo: object files into output path, processing c / c++ files in the same time (?), nested directories for source files (?) +C = c +OUTPUT_PATH = out/production/displayboard/ +SOURCE_PATH = src/ +EXE = $(OUTPUT_PATH)displayboard + +ifeq ($(COMPILER), G++) + ifeq ($(OS),Windows_NT) + OBJ = obj + else + OBJ = o + endif + COPT = -O2 + CCMD = g++ + OBJFLAG = -o + EXEFLAG = -o +# INCLUDES = -I../.includes + INCLUDES = +# LIBS = -lgc + LIBS = +# LIBPATH = -L../gc/.libs + LIBPATH = + CPPFLAGS = $(COPT) -g $(INCLUDES) + LDFLAGS = $(LIBPATH) -g $(LIBS) + DEP = dep +else + OBJ = obj + COPT = /O2 + CCMD = cl + OBJFLAG = /Fo + EXEFLAG = /Fe +# INCLUDES = /I..\\.includes + INCLUDES = +# LIBS = ..\\.libs\\libgc.lib + LIBS = + CPPFLAGS = $(COPT) /DEBUG $(INCLUDES) + LDFLAGS = /DEBUG +endif + +OBJS := $(patsubst %.$(C),%.$(OBJ),$(wildcard $(SOURCE_PATH)*.$(C))) + +%.$(OBJ):%.$(C) + @echo Compiling $(basename $<)... + $(CCMD) -c $(CPPFLAGS) $(CXXFLAGS) $< $(OBJFLAG)$@ + +all: $(OBJS) + @echo Linking... + $(CCMD) $(LDFLAGS) $^ $(LIBS) $(EXEFLAG) $(EXE) + +clean: + rm -rf $(SOURCE_PATH)*.$(OBJ) $(EXE) + +rebuild: clean all +#rebuild is not entirely correct \ No newline at end of file diff --git a/display/software/displayboard/displayboard.iml b/display/software/displayboard/displayboard.iml new file mode 100644 index 0000000..7694e87 --- /dev/null +++ b/display/software/displayboard/displayboard.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/display/software/powerboard/.dep/adc.o.d b/display/software/powerboard/.dep/adc.o.d new file mode 100644 index 0000000..6d4161e --- /dev/null +++ b/display/software/powerboard/.dep/adc.o.d @@ -0,0 +1,33 @@ +src/adc.o: src/adc.c /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/io.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/sfr_defs.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/inttypes.h \ + /usr/lib/gcc/avr/4.5.3/include/stdint.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/stdint.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/iom8.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/portpins.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/common.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/version.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/fuse.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/lock.h + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/io.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/sfr_defs.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/inttypes.h: + +/usr/lib/gcc/avr/4.5.3/include/stdint.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/stdint.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/iom8.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/portpins.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/common.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/version.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/fuse.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/lock.h: diff --git a/display/software/powerboard/.dep/main.o.d b/display/software/powerboard/.dep/main.o.d new file mode 100644 index 0000000..d826568 --- /dev/null +++ b/display/software/powerboard/.dep/main.o.d @@ -0,0 +1,47 @@ +src/main.o: src/main.c \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/io.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/sfr_defs.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/inttypes.h \ + /usr/lib/gcc/avr/4.5.3/include/stdint.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/stdint.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/iom8.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/portpins.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/common.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/version.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/fuse.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/lock.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/interrupt.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/pgmspace.h \ + /usr/lib/gcc/avr/4.5.3/include/stddef.h src/utils.h src/adc.h + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/io.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/sfr_defs.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/inttypes.h: + +/usr/lib/gcc/avr/4.5.3/include/stdint.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/stdint.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/iom8.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/portpins.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/common.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/version.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/fuse.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/lock.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/interrupt.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/pgmspace.h: + +/usr/lib/gcc/avr/4.5.3/include/stddef.h: + +src/utils.h: + +src/adc.h: diff --git a/display/software/powerboard/.dep/utils.o.d b/display/software/powerboard/.dep/utils.o.d new file mode 100644 index 0000000..fc9ba1a --- /dev/null +++ b/display/software/powerboard/.dep/utils.o.d @@ -0,0 +1,43 @@ +src/utils.o: src/utils.c \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/io.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/sfr_defs.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/inttypes.h \ + /usr/lib/gcc/avr/4.5.3/include/stdint.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/stdint.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/iom8.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/portpins.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/common.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/version.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/fuse.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/lock.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay_basic.h \ + /usr/lib/gcc/avr/4.5.3/../../../avr/include/math.h + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/io.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/sfr_defs.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/inttypes.h: + +/usr/lib/gcc/avr/4.5.3/include/stdint.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/stdint.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/iom8.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/portpins.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/common.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/version.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/fuse.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/lock.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay_basic.h: + +/usr/lib/gcc/avr/4.5.3/../../../avr/include/math.h: diff --git a/display/software/powerboard/Makefile b/display/software/powerboard/Makefile new file mode 100644 index 0000000..7b33ff9 --- /dev/null +++ b/display/software/powerboard/Makefile @@ -0,0 +1,436 @@ +# Hey Emacs, this is a -*- makefile -*- +# +# WinAVR makefile written by Eric B. Weddington, J�rg Wunsch, et al. +# Released to the Public Domain +# Please read the make user manual! +# +# Additional material for this makefile was submitted by: +# Tim Henigan +# Peter Fleury +# Reiner Patommel +# Sander Pool +# Frederik Rouleau +# Markus Pfaff +# +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB). +# +# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio +# 4.07 or greater). +# +# make program = Download the hex file to the device, using avrdude. Please +# customize the avrdude settings below first! +# +# make filename.s = Just compile filename.c into the assembler code only +# +# To rebuild project do "make clean" then "make all". +# + +# mth 2004/09 +# Differences from WinAVR 20040720 sample: +# - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum) +# - F_OSC Define in CFLAGS and AFLAGS + + +# MCU name +MCU = atmega8 + +# Main Oscillator Frequency +# This is only used to define F_OSC in all assembler and c-sources. +F_OSC = 8000000 + +# Output format. (can be srec, ihex, binary) +FORMAT = ihex + +# Target file name (without extension). +TARGET = main + + +# List C source files here. (C dependencies are automatically generated.) +SRC = src/$(TARGET).c src/adc.c src/utils.c + + +# List Assembler source files here. +# Make them always end in a capital .S. Files ending in a lowercase .s +# will not be considered source files but generated files (assembler +# output from the compiler), and will be deleted upon "make clean"! +# Even though the DOS/Win* filesystem matches both .s and .S the same, +# it will preserve the spelling of the filenames, and gcc itself does +# care about how the name is spelled on its command-line. +ASRC = + + + +# Optimization level, can be [0, 1, 2, 3, s]. +# 0 = turn off optimization. s = optimize for size. +# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) +OPT = s + +# Debugging format. +# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2. +# AVR (extended) COFF requires stabs, plus an avr-objcopy run. +#DEBUG = stabs +DEBUG = dwarf-2 + +# List any extra directories to look for include files here. +# Each directory must be seperated by a space. +EXTRAINCDIRS = src/ + + +# Compiler flag to set the C Standard level. +# c89 - "ANSI" C +# gnu89 - c89 plus GCC extensions +# c99 - ISO C99 standard (not yet fully implemented) +# gnu99 - c99 plus GCC extensions +CSTANDARD = -std=gnu99 + +# Place -D or -U options here +CDEFS = + +# Place -I options here +CINCS = + + +# Compiler flags. +# -g*: generate debugging information +# -O*: optimization level +# -f...: tuning, see GCC manual and avr-libc documentation +# -Wall...: warning level +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns...: create assembler listing +CFLAGS = -g$(DEBUG) +CFLAGS += $(CDEFS) $(CINCS) +CFLAGS += -O$(OPT) +CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums +CFLAGS += -Wall -Wstrict-prototypes +CFLAGS += -Wa,-adhlns=$(<:.c=.lst) +CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) +CFLAGS += $(CSTANDARD) +CFLAGS += -DF_OSC=$(F_OSC) + + + +# Assembler flags. +# -Wa,...: tell GCC to pass this to the assembler. +# -ahlms: create listing +# -gstabs: have the assembler create line number information; note that +# for use in COFF files, additional information about filenames +# and function names needs to be present in the assembler source +# files -- see avr-libc docs [FIXME: not yet described there] +ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs +ASFLAGS += -DF_OSC=$(F_OSC) + + +#Additional libraries. + +# Minimalistic printf version +PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min + +# Floating point printf version (requires MATH_LIB = -lm below) +PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt + +PRINTF_LIB = + +# Minimalistic scanf version +SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min + +# Floating point + %[ scanf version (requires MATH_LIB = -lm below) +SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt + +SCANF_LIB = + +MATH_LIB = -lm + +# External memory options + +# 64 KB of external RAM, starting after internal RAM (ATmega128!), +# used for variables (.data/.bss) and heap (malloc()). +#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff + +# 64 KB of external RAM, starting after internal RAM (ATmega128!), +# only used for heap (malloc()). +#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff + +EXTMEMOPTS = + +# Linker flags. +# -Wl,...: tell GCC to pass this to linker. +# -Map: create map file +# --cref: add cross reference to map file +LDFLAGS = -Wl,-Map=$(TARGET).map,--cref +LDFLAGS += $(EXTMEMOPTS) +LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) + + + + +# Programming support using avrdude. Settings and variables. + +# Programming hardware: alf avr910 avrisp bascom bsd +# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 +# +# Type: avrdude -c ? +# to get a full listing. +# +AVRDUDE_PROGRAMMER = usbasp + +# com1 = serial port. Use lpt1 to connect to parallel port. +AVRDUDE_PORT = + +AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex +#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep + + +# Uncomment the following if you want avrdude's erase cycle counter. +# Note that this counter needs to be initialized first using -Yn, +# see avrdude manual. +#AVRDUDE_ERASE_COUNTER = -y + +# Uncomment the following if you do /not/ wish a verification to be +# performed after programming the device. +#AVRDUDE_NO_VERIFY = -V + +# Increase verbosity level. Please use this when submitting bug +# reports about avrdude. See +# to submit bug reports. +#AVRDUDE_VERBOSE = -v -v + +AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) +AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) +AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) +AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) + + + +# --------------------------------------------------------------------------- + +# Define directories, if needed. +DIRAVR = c:/winavr +DIRAVRBIN = $(DIRAVR)/bin +DIRAVRUTILS = $(DIRAVR)/utils/bin +DIRINC = . +DIRLIB = $(DIRAVR)/avr/lib + + +# Define programs and commands. +SHELL = sh +CC = avr-gcc +OBJCOPY = avr-objcopy +OBJDUMP = avr-objdump +SIZE = avr-size +NM = avr-nm +AVRDUDE = avrdude +REMOVE = rm -f +COPY = cp + + + + +# Define Messages +# English +MSG_ERRORS_NONE = Errors: none +MSG_BEGIN = -------- begin -------- +MSG_END = -------- end -------- +MSG_SIZE_BEFORE = Size before: +MSG_SIZE_AFTER = Size after: +MSG_COFF = Converting to AVR COFF: +MSG_EXTENDED_COFF = Converting to AVR Extended COFF: +MSG_FLASH = Creating load file for Flash: +MSG_EEPROM = Creating load file for EEPROM: +MSG_EXTENDED_LISTING = Creating Extended Listing: +MSG_SYMBOL_TABLE = Creating Symbol Table: +MSG_LINKING = Linking: +MSG_COMPILING = Compiling: +MSG_ASSEMBLING = Assembling: +MSG_CLEANING = Cleaning project: + + + + +# Define all object files. +OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) + +# Define all listing files. +LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) + + +# Compiler flags to generate dependency files. +### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d +GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d + +# Combine all necessary flags and optional flags. +# Add target processor to flags. +ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS) +ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) + + + + + +# Default target. +all: begin gccversion sizebefore build sizeafter finished end + +build: elf hex eep lss sym + +elf: $(TARGET).elf +hex: $(TARGET).hex +eep: $(TARGET).eep +lss: $(TARGET).lss +sym: $(TARGET).sym + + + +# Eye candy. +# AVR Studio 3.x does not check make's exit code but relies on +# the following magic strings to be generated by the compile job. +begin: + @echo + @echo $(MSG_BEGIN) + +finished: + @echo $(MSG_ERRORS_NONE) + +end: + @echo $(MSG_END) + @echo + + +# Display size of file. +HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex +ELFSIZE = $(SIZE) -A $(TARGET).elf +sizebefore: + @if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi + +sizeafter: + @if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi + + + +# Display compiler version information. +gccversion : + @$(CC) --version + + + +# Program the device. +program: $(TARGET).hex $(TARGET).eep + $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) + + + + +# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. +COFFCONVERT=$(OBJCOPY) --debugging \ +--change-section-address .data-0x800000 \ +--change-section-address .bss-0x800000 \ +--change-section-address .noinit-0x800000 \ +--change-section-address .eeprom-0x810000 + + +coff: $(TARGET).elf + @echo + @echo $(MSG_COFF) $(TARGET).cof + $(COFFCONVERT) -O coff-avr $< $(TARGET).cof + + +extcoff: $(TARGET).elf + @echo + @echo $(MSG_EXTENDED_COFF) $(TARGET).cof + $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof + + + +# Create final output files (.hex, .eep) from ELF output file. +%.hex: %.elf + @echo + @echo $(MSG_FLASH) $@ + $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ + +%.eep: %.elf + @echo + @echo $(MSG_EEPROM) $@ + -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ + --change-section-lma .eeprom=0 -O $(FORMAT) $< $@ + +# Create extended listing file from ELF output file. +%.lss: %.elf + @echo + @echo $(MSG_EXTENDED_LISTING) $@ + $(OBJDUMP) -h -S $< > $@ + +# Create a symbol table from ELF output file. +%.sym: %.elf + @echo + @echo $(MSG_SYMBOL_TABLE) $@ + $(NM) -n $< > $@ + + + +# Link: create ELF output file from object files. +.SECONDARY : $(TARGET).elf +.PRECIOUS : $(OBJ) +%.elf: $(OBJ) + @echo + @echo $(MSG_LINKING) $@ + $(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) + + +# Compile: create object files from C source files. +%.o : %.c + @echo + @echo $(MSG_COMPILING) $< + $(CC) -c $(ALL_CFLAGS) $< -o $@ + + +# Compile: create assembler files from C source files. +%.s : %.c + $(CC) -S $(ALL_CFLAGS) $< -o $@ + + +# Assemble: create object files from assembler source files. +%.o : %.S + @echo + @echo $(MSG_ASSEMBLING) $< + $(CC) -c $(ALL_ASFLAGS) $< -o $@ + + + +# Target: clean project. +clean: begin clean_list finished end + +clean_list : + @echo + @echo $(MSG_CLEANING) + $(REMOVE) $(TARGET).hex + $(REMOVE) $(TARGET).eep + $(REMOVE) $(TARGET).obj + $(REMOVE) $(TARGET).cof + $(REMOVE) $(TARGET).elf + $(REMOVE) $(TARGET).map + $(REMOVE) $(TARGET).obj + $(REMOVE) $(TARGET).a90 + $(REMOVE) $(TARGET).sym + $(REMOVE) $(TARGET).lnk + $(REMOVE) $(TARGET).lss + $(REMOVE) $(OBJ) + $(REMOVE) $(LST) + $(REMOVE) $(SRC:.c=.s) + $(REMOVE) $(SRC:.c=.d) + $(REMOVE) .dep/* + + + +# Include the dependency files. +-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*) + + +# Listing of phony targets. +.PHONY : all begin finish end sizebefore sizeafter gccversion \ +build elf hex eep lss sym coff extcoff \ +clean clean_list program + diff --git a/display/software/powerboard/main.eep b/display/software/powerboard/main.eep new file mode 100644 index 0000000..7c166a1 --- /dev/null +++ b/display/software/powerboard/main.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/display/software/powerboard/main.elf b/display/software/powerboard/main.elf new file mode 100755 index 0000000000000000000000000000000000000000..cc212c8ee8e127ea9a93ad2a091c921b8051989b GIT binary patch literal 9594 zcmcgx3vgW3c|K=XkCj%|)A)^7rV4l(*tKlQb{sGU%f_ZaTpI`k!qsZ`TH1KEyX-@@ z39*IaAlnoyOBNWMU_(PG#z}G9q%ekf+jLr(LgZO^!#%Zx_I%(lS@xj|NOnsnP-bX8Gq=z z4|G5D(yq4-P8@z|-%Eo(-+Ox7!NAzi$)WC{Q+rPC*}3ObU~F(AFt+E9n%=n&r3WYC z6CG!$`PJFkXC}^0j)z7XMjF1?Fw)evfAq-c;DK&6d?2dy!^5LdH8|R>jvUy3pkcV- z`whdP;aOvY=Z0SR>cssoEPHI}V@n_X?fC8!VQ&!)R#qjqvxvueQC_HrY0$Yl{zFaqjGK-93?+I9LDf{HoB*&<_s& z)AXai{`3`#CRR;sn0Q(Ljh=Pp6&*UzaA0!y?cuY-?*Hm(#bcpUp|?Vlp(kgatUg!$ZguN_J~{Vf z@LcfS;O5ZQ(4Nqvp*aT=?{$x5#sOA~e ztUNn(sVh~Zhp$r29$u-Yd-!TK!^5l8EDv9!u%xZfrLI-;JiJ=X_i&eL_3#>XiHFx> z%y#Hf*QrZAyiVZt0$(rip9p+|z&8qflfa)7c!R)yD)2^uHwk>Rz_$o|tH7TZ_%?xW z7x)VT-y!gw0)J89y971_?iM&IaF4(-f#U+30&f<$SKvN@69Rup;4K0t1@0F(C2(5c zjKFsboE11Ha9-eozyktr6?mJ#+XcQy;4ce&ufSgsc!$6{1s)XmK7n@${8fQ>3;Z>K z?-zJT;5`EG6?mV(4+#8c0zWA5Ljvy?cv#>A0*?qhD)2#p#{_;@;70^LB=DmGKPK>D zfxj;BHw1oM;3EPb75E8(pA`7d1^%YMPYL`N0zWPAUkdz;z{doBR^a0Te@ozR3;b6C zKPT`Bfxjd0Ne}ZK$#>&5h;7)QxOXsgsUO$?DQ$QrVCYhBcxAiPk8#SdLzj9}{jrCC zqAvIFPgU5%XVoGPx9Mv={3+c<9Le`*BC*(({EfH8uMOwaKspg$k#E1MT^YuJ8Ox`$ zxfN^MRX7~+ez9!6J<`iGya`r4(YTRF<;`rikjc}QdxqWj3ahnsNHZ3)6FdLw*gEa} z=b_&9f&70)6?Xm#Sh{-;&F)6D>t`LO!SacIGmB0n^6GWaOgfv-+4SE*d(FHtkWS{K zy{4)}3Gz&OtC>~n!TO_#lY@X^pi0d|^eGPPO4Kn9wl#__GaQ1#9#e&`0oSh}q2n0oAO@eV zS_a`iLVORQPX{_7Dtwig0p*{d>fQ}Zebplr6_rIxR6j@&s61tf>OB-XKxa9kQtMd{ zgH}x8id_ofy@aq|2zA zt*NB#c|_WCIR<7}d7Q8Lh?t)1saRkc(~v`P5M*y zEkS?%-1;WntQ)J)jW!hwu7nD6G(-98R|G#BT;BrcI{E^a*39FI?+gnwO@rHGKi%nQvutT-C%nM?SQ>!akOsn*&^r64? zr50GMLAJ5psaUDTlGW99SJuG|orMddC8Z+-Rf$wAS%{nV4jhj0DxJ&6v5$rO?5(iUw+@vrQMQ}` zc@y|WkZhFl3y!?gk$iw@N6GxSBfsRxq?1oM2l?D%XiqsCl6x`BZFBT|glB45U8mO0M<))R#P^)Wwz$Z?UX?FCXGC^5HII7iOYs zu6)tqMMwUfBmW+fL*wg^Lw(iZ+(lTPlKF2q@=Ztn43aMVg~QJ~{C!B4`)|l*NKP;9 ze2}bXI%Er^wJAYz3t_tpoqWD#Kh|~shJ2qoWLf<_uKOL9YNU`)VCgW;+1@6M#LZ-M zyS-@37cfV`QBiXAtDMns52)}x1r2wH3hjS;hX&aQLU}7BoyTqRW1V3A|1*i8mEPG_ z*J^Q;u{K&RyE+mCJ`vbDJkBSeLU29-{GZ6R=ZeRc;&HC@$$msyCc zkDSZmW`~!Te-3&&Xg*{tox=ITjH~Nzx}|k>tM%Ft2X=8N7ia!LDwpU@neokU z=p%jUelwCR#G*MH#`5uWq$jb(>@`znHi~;qB%a7+FmsVydUJkjG;2nzOF>UMnvJVu zI@Q~1C0^w`VHc1rH}X@i6w&^SnKg5w2rcmzjPPoKbz&HW)Rt6wYsxUJ3fh;V265XE z*A=I87{ApQBbP2@W2VBmQYkZ8x^nRDA+H;$9D0#NC)lk0F7Qlv`(VG9EJm~OLVy4E zjb^Tp%){5X-tYofNF?)#l!2GBVXb8&wmrtm9M+#x@pPdFw;IF1ZPC88048Evaz>ov zv!Kf#@E{_ihC{i#Si9gX6~Ssdxx95 z3V>>#T6BbxdqSPMYg8Mfx_eYdM>REk4yJ0Ux#t5~D6FswsjQXOTHQ&p!-hz`z-nl`k<7G!&?Q#I0 zMR;Ys9LQa|Jo*w_tMFlvDJzXdIuJ`&-H$9wA9(AkRL;HL{{PFVaBh2lKH3AB&)Txj zMR{{uUWI#dIcC}>(H>-~aNO)E^cvA@G}Vix>d;J~Cl&24@kDBK+Rcmh^kmHemn9P^ z)5V*!DB}`Qc`_YywWv71J%fsWhrn+De1UWB8F;!lN`({b`B7>CIN!B?L|!=gZOF}| zsaxbyfvKn6tEimsaRy4hZ|Ql~<%S7V&UddH-1_*>fs2{fQN#92!OiP}%Ein*2)oxy zW?mlKkam4ovh{A~L|(VRfNB66(^F!=ZXKyIySezlvRe$ywd2$4V%B$bx>9EdoZxn0 z2%L6&7cpe;Z^LV%AR#0FI1y@f75=yRvQW728)bIS<7qw)of}*`eistmR`J0lrG`>w!B2-{@h23zK{SmVA9-a*N3SL$t^LLEZ3&Xm2|j z!!gwfTI~gj3w{`!|EbtPTYply+f*w&^<89S5P8mQ20snScN#+@_>UluI_1gV1efK{ zgVX1DU0CHWhXtJOmehrqXbpL!IaG=F~e zIJoTpGvGWuG0_>ar@FU$A^@bjpf`zZa1vq##%K|Go@ zZ~!uJ{>kDjG)0$8r!&@t$GT>0+PLOA+%XJe(*|Rm3vRH$>eU-8iSs)y4!st>$IPZ3 zVqY0bhxbA}G0>lm=Mo);nL&kuTTL41O*&&_vgux&onT;pDl*!|T@BX)_^x86;@0&?-g>-hmcmpvMq@8?$&`9*FQR6C*|KUy ztMKlWBJKS8WqnQ(w@k0XcGl<)cv%S(%Gq%*N~Q@v^-pO5cPqDsxVbsX+nA^5oN~J~ z4C@=5Gy8U5?J-y%uDntmsG!e`W~MY_e5O?G;?nKWE7abJeA^SQU+mUwZ$KB@q70L> nAisxAZDYAIx8W<6TqG!Ct6VR!cP?HeFelE{FE7n6udM$E@Y$bm literal 0 HcmV?d00001 diff --git a/display/software/powerboard/main.hex b/display/software/powerboard/main.hex new file mode 100644 index 0000000..a9f6a44 --- /dev/null +++ b/display/software/powerboard/main.hex @@ -0,0 +1,27 @@ +:1000000012C021C020C01FC01EC01DC03EC01BC0EA +:100010001AC019C018C017C016C015C014C013C02C +:1000200012C011C010C011241FBECFE5D4E0DEBF46 +:10003000CDBF10E0A0E6B0E001C01D92A236B1072E +:10004000E1F71FD0ABC0DCCF8EB58B608EBD82EEEA +:1000500094E09BBD8ABD80E189BF7894089587B301 +:10006000876087BB88B3887F88BB089580E0089548 +:10007000882311F481E001C080E064E034D080E0A6 +:100080000895EDDF19D0E0DFFFCF1F920F920FB67A +:100090000F9211248F939F93809160009091610043 +:1000A000019690936100809360009F918F910F90D3 +:1000B0000FBE0F901F90189580E487B983E086B932 +:1000C000379A369A3699FECF84B195B1089597B193 +:1000D0008F71907E892B87B9369A3699FECF24B1DD +:1000E00035B1C9010895BF92CF92DF92EF92FF928E +:1000F0000F931F93D82EB62ECC24EE24FF24870115 +:100100000AC08D2DE4DFAC0160E070E0E40EF51E66 +:10011000061F171FC394CB14A0F32B2D30E040E033 +:1001200050E0C801B70118D0C9011F910F91FF908D +:10013000EF90DF90CF90BF900895882309F484E674 +:1001400090E007C0E3ECF9E03197F1F700C0000060 +:100150009F5F9817B8F30895A1E21A2EAA1BBB1B44 +:10016000FD010DC0AA1FBB1FEE1FFF1FA217B30783 +:10017000E407F50720F0A21BB30BE40BF50B661F99 +:10018000771F881F991F1A9469F76095709580955D +:1001900090959B01AC01BD01CF010895F894FFCF6C +:00000001FF diff --git a/display/software/powerboard/main.lss b/display/software/powerboard/main.lss new file mode 100644 index 0000000..6c5d085 --- /dev/null +++ b/display/software/powerboard/main.lss @@ -0,0 +1,399 @@ + +main.elf: file format elf32-avr + +Sections: +Idx Name Size VMA LMA File off Algn + 0 .text 000001a0 00000000 00000000 00000074 2**1 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 1 .bss 00000002 00800060 00800060 00000214 2**0 + ALLOC + 2 .stab 000006cc 00000000 00000000 00000214 2**2 + CONTENTS, READONLY, DEBUGGING + 3 .stabstr 00000054 00000000 00000000 000008e0 2**0 + CONTENTS, READONLY, DEBUGGING + 4 .debug_aranges 00000060 00000000 00000000 00000934 2**0 + CONTENTS, READONLY, DEBUGGING + 5 .debug_pubnames 000000d4 00000000 00000000 00000994 2**0 + CONTENTS, READONLY, DEBUGGING + 6 .debug_info 0000040e 00000000 00000000 00000a68 2**0 + CONTENTS, READONLY, DEBUGGING + 7 .debug_abbrev 000002a5 00000000 00000000 00000e76 2**0 + CONTENTS, READONLY, DEBUGGING + 8 .debug_line 00000384 00000000 00000000 0000111b 2**0 + CONTENTS, READONLY, DEBUGGING + 9 .debug_frame 000000d0 00000000 00000000 000014a0 2**2 + CONTENTS, READONLY, DEBUGGING + 10 .debug_str 000001cd 00000000 00000000 00001570 2**0 + CONTENTS, READONLY, DEBUGGING + 11 .debug_loc 0000017b 00000000 00000000 0000173d 2**0 + CONTENTS, READONLY, DEBUGGING + 12 .debug_pubtypes 000000ac 00000000 00000000 000018b8 2**0 + CONTENTS, READONLY, DEBUGGING + +Disassembly of section .text: + +00000000 <__vectors>: + 0: 12 c0 rjmp .+36 ; 0x26 <__ctors_end> + 2: 21 c0 rjmp .+66 ; 0x46 <__bad_interrupt> + 4: 20 c0 rjmp .+64 ; 0x46 <__bad_interrupt> + 6: 1f c0 rjmp .+62 ; 0x46 <__bad_interrupt> + 8: 1e c0 rjmp .+60 ; 0x46 <__bad_interrupt> + a: 1d c0 rjmp .+58 ; 0x46 <__bad_interrupt> + c: 3e c0 rjmp .+124 ; 0x8a <__vector_6> + e: 1b c0 rjmp .+54 ; 0x46 <__bad_interrupt> + 10: 1a c0 rjmp .+52 ; 0x46 <__bad_interrupt> + 12: 19 c0 rjmp .+50 ; 0x46 <__bad_interrupt> + 14: 18 c0 rjmp .+48 ; 0x46 <__bad_interrupt> + 16: 17 c0 rjmp .+46 ; 0x46 <__bad_interrupt> + 18: 16 c0 rjmp .+44 ; 0x46 <__bad_interrupt> + 1a: 15 c0 rjmp .+42 ; 0x46 <__bad_interrupt> + 1c: 14 c0 rjmp .+40 ; 0x46 <__bad_interrupt> + 1e: 13 c0 rjmp .+38 ; 0x46 <__bad_interrupt> + 20: 12 c0 rjmp .+36 ; 0x46 <__bad_interrupt> + 22: 11 c0 rjmp .+34 ; 0x46 <__bad_interrupt> + 24: 10 c0 rjmp .+32 ; 0x46 <__bad_interrupt> + +00000026 <__ctors_end>: + 26: 11 24 eor r1, r1 + 28: 1f be out 0x3f, r1 ; 63 + 2a: cf e5 ldi r28, 0x5F ; 95 + 2c: d4 e0 ldi r29, 0x04 ; 4 + 2e: de bf out 0x3e, r29 ; 62 + 30: cd bf out 0x3d, r28 ; 61 + +00000032 <__do_clear_bss>: + 32: 10 e0 ldi r17, 0x00 ; 0 + 34: a0 e6 ldi r26, 0x60 ; 96 + 36: b0 e0 ldi r27, 0x00 ; 0 + 38: 01 c0 rjmp .+2 ; 0x3c <.do_clear_bss_start> + +0000003a <.do_clear_bss_loop>: + 3a: 1d 92 st X+, r1 + +0000003c <.do_clear_bss_start>: + 3c: a2 36 cpi r26, 0x62 ; 98 + 3e: b1 07 cpc r27, r17 + 40: e1 f7 brne .-8 ; 0x3a <.do_clear_bss_loop> + 42: 1f d0 rcall .+62 ; 0x82
+ 44: ab c0 rjmp .+342 ; 0x19c <_exit> + +00000046 <__bad_interrupt>: + 46: dc cf rjmp .-72 ; 0x0 <__vectors> + +00000048 : + +volatile uint16_t syscounter = 0; + +void timer_init(void) { + // clock is 8MHz + TCCR1B |= _BV(WGM12) | _BV(CS11) | _BV(CS10) ; // CTC Mode for Timer 1 (16Bit) with prescale of 64 + 48: 8e b5 in r24, 0x2e ; 46 + 4a: 8b 60 ori r24, 0x0B ; 11 + 4c: 8e bd out 0x2e, r24 ; 46 + OCR1A = 1250; // 100Hz + 4e: 82 ee ldi r24, 0xE2 ; 226 + 50: 94 e0 ldi r25, 0x04 ; 4 + 52: 9b bd out 0x2b, r25 ; 43 + 54: 8a bd out 0x2a, r24 ; 42 + TIMSK = _BV(OCIE1A); + 56: 80 e1 ldi r24, 0x10 ; 16 + 58: 89 bf out 0x39, r24 ; 57 + sei(); // enable interrupts + 5a: 78 94 sei +} + 5c: 08 95 ret + +0000005e : + +void ports_init(void) { + DDR_SW |= _BV(LOADSW) | _BV(GENSW) | _BV(DUMPSW); + 5e: 87 b3 in r24, 0x17 ; 23 + 60: 87 60 ori r24, 0x07 ; 7 + 62: 87 bb out 0x17, r24 ; 23 + PORT_SW &= ~(_BV(LOADSW) | _BV(GENSW) | _BV(DUMPSW)); + 64: 88 b3 in r24, 0x18 ; 24 + 66: 88 7f andi r24, 0xF8 ; 248 + 68: 88 bb out 0x18, r24 ; 24 +} + 6a: 08 95 ret + +0000006c : + // voltage has a divider (12V - 56k - ADC - 27k - GND) + // so + uint8_t voltage = 0; + + return voltage; +} + 6c: 80 e0 ldi r24, 0x00 ; 0 + 6e: 08 95 ret + +00000070 : +uint8_t get_power(power_source source) { + + uint16_t voltage = get_voltage(); + uint16_t amperes; + + if(source == generated) { + 70: 88 23 and r24, r24 + 72: 11 f4 brne .+4 ; 0x78 + amperes = adc_read_avg(AD_I_GEN, 4); + 74: 81 e0 ldi r24, 0x01 ; 1 + 76: 01 c0 rjmp .+2 ; 0x7a + } else { + amperes = adc_read_avg(AD_I_LOAD, 4); + 78: 80 e0 ldi r24, 0x00 ; 0 + 7a: 64 e0 ldi r22, 0x04 ; 4 + 7c: 34 d0 rcall .+104 ; 0xe6 + } + + return 0; +} + 7e: 80 e0 ldi r24, 0x00 ; 0 + 80: 08 95 ret + +00000082
: + + + +int main(void) { + ports_init(); + 82: ed df rcall .-38 ; 0x5e + adc_init(); + 84: 19 d0 rcall .+50 ; 0xb8 + timer_init(); + 86: e0 df rcall .-64 ; 0x48 + 88: ff cf rjmp .-2 ; 0x88 + +0000008a <__vector_6>: + + return(0); +} + +// system timer +SIGNAL(TIMER1_COMPA_vect) { + 8a: 1f 92 push r1 + 8c: 0f 92 push r0 + 8e: 0f b6 in r0, 0x3f ; 63 + 90: 0f 92 push r0 + 92: 11 24 eor r1, r1 + 94: 8f 93 push r24 + 96: 9f 93 push r25 + syscounter++; + 98: 80 91 60 00 lds r24, 0x0060 + 9c: 90 91 61 00 lds r25, 0x0061 + a0: 01 96 adiw r24, 0x01 ; 1 + a2: 90 93 61 00 sts 0x0061, r25 + a6: 80 93 60 00 sts 0x0060, r24 +} + aa: 9f 91 pop r25 + ac: 8f 91 pop r24 + ae: 0f 90 pop r0 + b0: 0f be out 0x3f, r0 ; 63 + b2: 0f 90 pop r0 + b4: 1f 90 pop r1 + b6: 18 95 reti + +000000b8 : + + +void adc_init(void) { + uint16_t dummyResult; + // AVCC with external capacitor at AREF pin + ADMUX = _BV(REFS0); + b8: 80 e4 ldi r24, 0x40 ; 64 + ba: 87 b9 out 0x07, r24 ; 7 + + // set frequency prescaler to 8 + ADCSRA = _BV(ADPS1) | _BV(ADPS0); + bc: 83 e0 ldi r24, 0x03 ; 3 + be: 86 b9 out 0x06, r24 ; 6 + + // enable ADC + ADCSRA |= _BV(ADEN); + c0: 37 9a sbi 0x06, 7 ; 6 + + // make a dummy read out + ADCSRA |= _BV(ADSC); + c2: 36 9a sbi 0x06, 6 ; 6 + while (ADCSRA & _BV(ADSC) ) { + c4: 36 99 sbic 0x06, 6 ; 6 + c6: fe cf rjmp .-4 ; 0xc4 + } + + // we have to read, otherwise the next result is not available + dummyResult = ADCW; + c8: 84 b1 in r24, 0x04 ; 4 + ca: 95 b1 in r25, 0x05 ; 5 +} + cc: 08 95 ret + +000000ce : + + +uint16_t adc_read_single(uint8_t channel) { + ADMUX = (ADMUX & ~(0x1F)) | (channel & 0x1F); + ce: 97 b1 in r25, 0x07 ; 7 + d0: 8f 71 andi r24, 0x1F ; 31 + d2: 90 7e andi r25, 0xE0 ; 224 + d4: 89 2b or r24, r25 + d6: 87 b9 out 0x07, r24 ; 7 + ADCSRA |= _BV(ADSC); + d8: 36 9a sbi 0x06, 6 ; 6 + while (ADCSRA & (1< + } + return ADCW; + de: 24 b1 in r18, 0x04 ; 4 + e0: 35 b1 in r19, 0x05 ; 5 +} + e2: c9 01 movw r24, r18 + e4: 08 95 ret + +000000e6 : + +uint16_t adc_read_avg(uint8_t channel, uint8_t nsamples) { + e6: bf 92 push r11 + e8: cf 92 push r12 + ea: df 92 push r13 + ec: ef 92 push r14 + ee: ff 92 push r15 + f0: 0f 93 push r16 + f2: 1f 93 push r17 + f4: d8 2e mov r13, r24 + f6: b6 2e mov r11, r22 + uint32_t sum = 0; + + for (uint8_t i=0; i + sum += adc_read_single(channel); + 102: 8d 2d mov r24, r13 + 104: e4 df rcall .-56 ; 0xce + 106: ac 01 movw r20, r24 + 108: 60 e0 ldi r22, 0x00 ; 0 + 10a: 70 e0 ldi r23, 0x00 ; 0 + 10c: e4 0e add r14, r20 + 10e: f5 1e adc r15, r21 + 110: 06 1f adc r16, r22 + 112: 17 1f adc r17, r23 +} + +uint16_t adc_read_avg(uint8_t channel, uint8_t nsamples) { + uint32_t sum = 0; + + for (uint8_t i=0; i + sum += adc_read_single(channel); + } + + return (uint16_t)(sum / nsamples); + 11a: 2b 2d mov r18, r11 + 11c: 30 e0 ldi r19, 0x00 ; 0 + 11e: 40 e0 ldi r20, 0x00 ; 0 + 120: 50 e0 ldi r21, 0x00 ; 0 + 122: c8 01 movw r24, r16 + 124: b7 01 movw r22, r14 + 126: 18 d0 rcall .+48 ; 0x158 <__udivmodsi4> +} + 128: c9 01 movw r24, r18 + 12a: 1f 91 pop r17 + 12c: 0f 91 pop r16 + 12e: ff 90 pop r15 + 130: ef 90 pop r14 + 132: df 90 pop r13 + 134: cf 90 pop r12 + 136: bf 90 pop r11 + 138: 08 95 ret + +0000013a : +#include + + +void wait(uint8_t count) { + uint8_t i; + if(count == 0) count = 100; + 13a: 88 23 and r24, r24 + 13c: 09 f4 brne .+2 ; 0x140 + 13e: 84 e6 ldi r24, 0x64 ; 100 + for(i=0;i + #else + //round up by default + __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); + #endif + + __builtin_avr_delay_cycles(__ticks_dc); + 144: e3 ec ldi r30, 0xC3 ; 195 + 146: f9 e0 ldi r31, 0x09 ; 9 + 148: 31 97 sbiw r30, 0x01 ; 1 + 14a: f1 f7 brne .-4 ; 0x148 + 14c: 00 c0 rjmp .+0 ; 0x14e + 14e: 00 00 nop + 150: 9f 5f subi r25, 0xFF ; 255 + 152: 98 17 cp r25, r24 + 154: b8 f3 brcs .-18 ; 0x144 + _delay_ms(10); + } +} + 156: 08 95 ret + +00000158 <__udivmodsi4>: + 158: a1 e2 ldi r26, 0x21 ; 33 + 15a: 1a 2e mov r1, r26 + 15c: aa 1b sub r26, r26 + 15e: bb 1b sub r27, r27 + 160: fd 01 movw r30, r26 + 162: 0d c0 rjmp .+26 ; 0x17e <__udivmodsi4_ep> + +00000164 <__udivmodsi4_loop>: + 164: aa 1f adc r26, r26 + 166: bb 1f adc r27, r27 + 168: ee 1f adc r30, r30 + 16a: ff 1f adc r31, r31 + 16c: a2 17 cp r26, r18 + 16e: b3 07 cpc r27, r19 + 170: e4 07 cpc r30, r20 + 172: f5 07 cpc r31, r21 + 174: 20 f0 brcs .+8 ; 0x17e <__udivmodsi4_ep> + 176: a2 1b sub r26, r18 + 178: b3 0b sbc r27, r19 + 17a: e4 0b sbc r30, r20 + 17c: f5 0b sbc r31, r21 + +0000017e <__udivmodsi4_ep>: + 17e: 66 1f adc r22, r22 + 180: 77 1f adc r23, r23 + 182: 88 1f adc r24, r24 + 184: 99 1f adc r25, r25 + 186: 1a 94 dec r1 + 188: 69 f7 brne .-38 ; 0x164 <__udivmodsi4_loop> + 18a: 60 95 com r22 + 18c: 70 95 com r23 + 18e: 80 95 com r24 + 190: 90 95 com r25 + 192: 9b 01 movw r18, r22 + 194: ac 01 movw r20, r24 + 196: bd 01 movw r22, r26 + 198: cf 01 movw r24, r30 + 19a: 08 95 ret + +0000019c <_exit>: + 19c: f8 94 cli + +0000019e <__stop_program>: + 19e: ff cf rjmp .-2 ; 0x19e <__stop_program> diff --git a/display/software/powerboard/main.map b/display/software/powerboard/main.map new file mode 100644 index 0000000..0191eaf --- /dev/null +++ b/display/software/powerboard/main.map @@ -0,0 +1,458 @@ +Archive member included because of file (symbol) + +/usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o) + src/adc.o (__udivmodsi4) +/usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) + /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o (exit) +/usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) + src/main.o (__do_clear_bss) + +Memory Configuration + +Name Origin Length Attributes +text 0x0000000000000000 0x0000000000002000 xr +data 0x0000000000800060 0x000000000000ffa0 rw !x +eeprom 0x0000000000810000 0x0000000000010000 rw !x +fuse 0x0000000000820000 0x0000000000000400 rw !x +lock 0x0000000000830000 0x0000000000000400 rw !x +signature 0x0000000000840000 0x0000000000000400 rw !x +*default* 0x0000000000000000 0xffffffffffffffff + +Linker script and memory map + +LOAD /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +LOAD src/main.o +LOAD src/adc.o +LOAD src/utils.o +LOAD /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a +LOAD /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a +LOAD /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a +LOAD /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a + +.hash + *(.hash) + +.dynsym + *(.dynsym) + +.dynstr + *(.dynstr) + +.gnu.version + *(.gnu.version) + +.gnu.version_d + *(.gnu.version_d) + +.gnu.version_r + *(.gnu.version_r) + +.rel.init + *(.rel.init) + +.rela.init + *(.rela.init) + +.rel.text + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + +.rela.text + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + +.rel.fini + *(.rel.fini) + +.rela.fini + *(.rela.fini) + +.rel.rodata + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + +.rela.rodata + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + +.rel.data + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + +.rela.data + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + +.rel.ctors + *(.rel.ctors) + +.rela.ctors + *(.rela.ctors) + +.rel.dtors + *(.rel.dtors) + +.rela.dtors + *(.rela.dtors) + +.rel.got + *(.rel.got) + +.rela.got + *(.rela.got) + +.rel.bss + *(.rel.bss) + +.rela.bss + *(.rela.bss) + +.rel.plt + *(.rel.plt) + +.rela.plt + *(.rela.plt) + +.text 0x0000000000000000 0x1a0 + *(.vectors) + .vectors 0x0000000000000000 0x26 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o + 0x0000000000000000 __vectors + 0x0000000000000000 __vector_default + *(.vectors) + *(.progmem.gcc*) + *(.progmem*) + 0x0000000000000026 . = ALIGN (0x2) + 0x0000000000000026 __trampolines_start = . + *(.trampolines) + .trampolines 0x0000000000000026 0x0 linker stubs + *(.trampolines*) + 0x0000000000000026 __trampolines_end = . + *(.jumptables) + *(.jumptables*) + *(.lowtext) + *(.lowtext*) + 0x0000000000000026 __ctors_start = . + *(.ctors) + 0x0000000000000026 __ctors_end = . + 0x0000000000000026 __dtors_start = . + *(.dtors) + 0x0000000000000026 __dtors_end = . + SORT(*)(.ctors) + SORT(*)(.dtors) + *(.init0) + .init0 0x0000000000000026 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o + 0x0000000000000026 __init + *(.init0) + *(.init1) + *(.init1) + *(.init2) + .init2 0x0000000000000026 0xc /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o + *(.init2) + *(.init3) + *(.init3) + *(.init4) + .init4 0x0000000000000032 0x10 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) + 0x0000000000000032 __do_clear_bss + *(.init4) + *(.init5) + *(.init5) + *(.init6) + *(.init6) + *(.init7) + *(.init7) + *(.init8) + *(.init8) + *(.init9) + .init9 0x0000000000000042 0x4 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o + *(.init9) + *(.text) + .text 0x0000000000000046 0x2 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o + 0x0000000000000046 __vector_1 + 0x0000000000000046 __vector_12 + 0x0000000000000046 __bad_interrupt + 0x0000000000000046 __vector_3 + 0x0000000000000046 __vector_11 + 0x0000000000000046 __vector_13 + 0x0000000000000046 __vector_17 + 0x0000000000000046 __vector_7 + 0x0000000000000046 __vector_5 + 0x0000000000000046 __vector_4 + 0x0000000000000046 __vector_9 + 0x0000000000000046 __vector_2 + 0x0000000000000046 __vector_15 + 0x0000000000000046 __vector_8 + 0x0000000000000046 __vector_14 + 0x0000000000000046 __vector_10 + 0x0000000000000046 __vector_16 + 0x0000000000000046 __vector_18 + .text 0x0000000000000048 0x70 src/main.o + 0x0000000000000048 timer_init + 0x000000000000005e ports_init + 0x000000000000006c get_voltage + 0x0000000000000070 get_power + 0x0000000000000082 main + 0x000000000000008a __vector_6 + .text 0x00000000000000b8 0x82 src/adc.o + 0x00000000000000b8 adc_init + 0x00000000000000ce adc_read_single + 0x00000000000000e6 adc_read_avg + .text 0x000000000000013a 0x1e src/utils.o + 0x000000000000013a wait + .text 0x0000000000000158 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o) + .text 0x0000000000000158 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) + .text 0x0000000000000158 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) + 0x0000000000000158 . = ALIGN (0x2) + *(.text.*) + .text.libgcc 0x0000000000000158 0x44 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o) + 0x0000000000000158 __udivmodsi4 + .text.libgcc 0x000000000000019c 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) + .text.libgcc 0x000000000000019c 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) + 0x000000000000019c . = ALIGN (0x2) + *(.fini9) + .fini9 0x000000000000019c 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) + 0x000000000000019c exit + 0x000000000000019c _exit + *(.fini9) + *(.fini8) + *(.fini8) + *(.fini7) + *(.fini7) + *(.fini6) + *(.fini6) + *(.fini5) + *(.fini5) + *(.fini4) + *(.fini4) + *(.fini3) + *(.fini3) + *(.fini2) + *(.fini2) + *(.fini1) + *(.fini1) + *(.fini0) + .fini0 0x000000000000019c 0x4 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) + *(.fini0) + 0x00000000000001a0 _etext = . + +.data 0x0000000000800060 0x0 load address 0x00000000000001a0 + 0x0000000000800060 PROVIDE (__data_start, .) + *(.data) + .data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o + .data 0x0000000000800060 0x0 src/main.o + .data 0x0000000000800060 0x0 src/adc.o + .data 0x0000000000800060 0x0 src/utils.o + .data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o) + .data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) + .data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) + *(.data*) + *(.rodata) + *(.rodata*) + *(.gnu.linkonce.d*) + 0x0000000000800060 . = ALIGN (0x2) + 0x0000000000800060 _edata = . + 0x0000000000800060 PROVIDE (__data_end, .) + +.bss 0x0000000000800060 0x2 + 0x0000000000800060 PROVIDE (__bss_start, .) + *(.bss) + .bss 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o + .bss 0x0000000000800060 0x2 src/main.o + 0x0000000000800060 syscounter + .bss 0x0000000000800062 0x0 src/adc.o + .bss 0x0000000000800062 0x0 src/utils.o + .bss 0x0000000000800062 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o) + .bss 0x0000000000800062 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) + .bss 0x0000000000800062 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) + *(.bss*) + *(COMMON) + 0x0000000000800062 PROVIDE (__bss_end, .) + 0x00000000000001a0 __data_load_start = LOADADDR (.data) + 0x00000000000001a0 __data_load_end = (__data_load_start + SIZEOF (.data)) + +.noinit 0x0000000000800062 0x0 + 0x0000000000800062 PROVIDE (__noinit_start, .) + *(.noinit*) + 0x0000000000800062 PROVIDE (__noinit_end, .) + 0x0000000000800062 _end = . + 0x0000000000800062 PROVIDE (__heap_start, .) + +.eeprom 0x0000000000810000 0x0 + *(.eeprom*) + 0x0000000000810000 __eeprom_end = . + +.fuse + *(.fuse) + *(.lfuse) + *(.hfuse) + *(.efuse) + +.lock + *(.lock*) + +.signature + *(.signature*) + +.stab 0x0000000000000000 0x6cc + *(.stab) + .stab 0x0000000000000000 0x6cc /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o + +.stabstr 0x0000000000000000 0x54 + *(.stabstr) + .stabstr 0x0000000000000000 0x54 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o + +.stab.excl + *(.stab.excl) + +.stab.exclstr + *(.stab.exclstr) + +.stab.index + *(.stab.index) + +.stab.indexstr + *(.stab.indexstr) + +.comment + *(.comment) + +.debug + *(.debug) + +.line + *(.line) + +.debug_srcinfo + *(.debug_srcinfo) + +.debug_sfnames + *(.debug_sfnames) + +.debug_aranges 0x0000000000000000 0x60 + *(.debug_aranges) + .debug_aranges + 0x0000000000000000 0x20 src/main.o + .debug_aranges + 0x0000000000000020 0x20 src/adc.o + .debug_aranges + 0x0000000000000040 0x20 src/utils.o + +.debug_pubnames + 0x0000000000000000 0xd4 + *(.debug_pubnames) + .debug_pubnames + 0x0000000000000000 0x75 src/main.o + .debug_pubnames + 0x0000000000000075 0x44 src/adc.o + .debug_pubnames + 0x00000000000000b9 0x1b src/utils.o + +.debug_info 0x0000000000000000 0x40e + *(.debug_info) + .debug_info 0x0000000000000000 0x19c src/main.o + .debug_info 0x000000000000019c 0x136 src/adc.o + .debug_info 0x00000000000002d2 0x13c src/utils.o + *(.gnu.linkonce.wi.*) + +.debug_abbrev 0x0000000000000000 0x2a5 + *(.debug_abbrev) + .debug_abbrev 0x0000000000000000 0x113 src/main.o + .debug_abbrev 0x0000000000000113 0xb4 src/adc.o + .debug_abbrev 0x00000000000001c7 0xde src/utils.o + +.debug_line 0x0000000000000000 0x384 + *(.debug_line) + .debug_line 0x0000000000000000 0x144 src/main.o + .debug_line 0x0000000000000144 0x13b src/adc.o + .debug_line 0x000000000000027f 0x105 src/utils.o + +.debug_frame 0x0000000000000000 0xd0 + *(.debug_frame) + .debug_frame 0x0000000000000000 0x70 src/main.o + .debug_frame 0x0000000000000070 0x40 src/adc.o + .debug_frame 0x00000000000000b0 0x20 src/utils.o + +.debug_str 0x0000000000000000 0x1cd + *(.debug_str) + .debug_str 0x0000000000000000 0x116 src/main.o + 0x159 (size before relaxing) + .debug_str 0x0000000000000116 0x56 src/adc.o + 0x11a (size before relaxing) + .debug_str 0x000000000000016c 0x61 src/utils.o + 0x12e (size before relaxing) + +.debug_loc 0x0000000000000000 0x17b + *(.debug_loc) + .debug_loc 0x0000000000000000 0x1e src/main.o + .debug_loc 0x000000000000001e 0xcf src/adc.o + .debug_loc 0x00000000000000ed 0x8e src/utils.o + +.debug_macinfo + *(.debug_macinfo) +OUTPUT(main.elf elf32-avr) +LOAD linker stubs + +.debug_pubtypes + 0x0000000000000000 0xac + .debug_pubtypes + 0x0000000000000000 0x3c src/main.o + .debug_pubtypes + 0x000000000000003c 0x38 src/adc.o + .debug_pubtypes + 0x0000000000000074 0x38 src/utils.o + +Cross Reference Table + +Symbol File +__bad_interrupt /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__bss_end /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) +__bss_start /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) +__do_clear_bss /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) + src/main.o +__heap_end /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__init /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__stack /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__udivmodsi4 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o) + src/adc.o +__vector_1 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_10 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_11 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_12 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_13 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_14 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_15 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_16 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_17 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_18 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_2 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_3 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_4 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_5 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_6 src/main.o + /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_7 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_8 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_9 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vector_default /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +__vectors /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +_exit /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) +adc_init src/adc.o + src/main.o +adc_read_avg src/adc.o + src/main.o +adc_read_single src/adc.o +exit /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) + /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +get_power src/main.o +get_voltage src/main.o +main src/main.o + /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o +ports_init src/main.o +syscounter src/main.o +timer_init src/main.o +wait src/utils.o diff --git a/display/software/powerboard/main.sym b/display/software/powerboard/main.sym new file mode 100644 index 0000000..5a2f98f --- /dev/null +++ b/display/software/powerboard/main.sym @@ -0,0 +1,75 @@ +00000000 W __heap_end +00000000 a __tmp_reg__ +00000000 a __tmp_reg__ +00000000 a __tmp_reg__ +00000000 W __vector_default +00000000 T __vectors +00000001 a __zero_reg__ +00000001 a __zero_reg__ +00000001 a __zero_reg__ +00000026 T __ctors_end +00000026 T __ctors_start +00000026 T __dtors_end +00000026 T __dtors_start +00000026 W __init +00000026 T __trampolines_end +00000026 T __trampolines_start +00000032 T __do_clear_bss +00000034 a __CCP__ +00000034 a __CCP__ +00000034 a __CCP__ +0000003a t .do_clear_bss_loop +0000003c t .do_clear_bss_start +0000003d a __SP_L__ +0000003d a __SP_L__ +0000003d a __SP_L__ +0000003e a __SP_H__ +0000003e a __SP_H__ +0000003e a __SP_H__ +0000003f a __SREG__ +0000003f a __SREG__ +0000003f a __SREG__ +00000046 T __bad_interrupt +00000046 W __vector_1 +00000046 W __vector_10 +00000046 W __vector_11 +00000046 W __vector_12 +00000046 W __vector_13 +00000046 W __vector_14 +00000046 W __vector_15 +00000046 W __vector_16 +00000046 W __vector_17 +00000046 W __vector_18 +00000046 W __vector_2 +00000046 W __vector_3 +00000046 W __vector_4 +00000046 W __vector_5 +00000046 W __vector_7 +00000046 W __vector_8 +00000046 W __vector_9 +00000048 T timer_init +0000005e T ports_init +0000006c T get_voltage +00000070 T get_power +00000082 T main +0000008a T __vector_6 +000000b8 T adc_init +000000ce T adc_read_single +000000e6 T adc_read_avg +0000013a T wait +00000158 T __udivmodsi4 +00000164 t __udivmodsi4_loop +0000017e t __udivmodsi4_ep +0000019c T _exit +0000019c W exit +0000019e t __stop_program +000001a0 A __data_load_end +000001a0 A __data_load_start +000001a0 T _etext +0000045f W __stack +00800060 B __bss_start +00800060 T _edata +00800060 B syscounter +00800062 B __bss_end +00800062 N _end +00810000 N __eeprom_end diff --git a/display/software/powerboard/powerboard.iml b/display/software/powerboard/powerboard.iml new file mode 100644 index 0000000..2d6149f --- /dev/null +++ b/display/software/powerboard/powerboard.iml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/display/software/powerboard/src/adc.c b/display/software/powerboard/src/adc.c new file mode 100644 index 0000000..42e7b4c --- /dev/null +++ b/display/software/powerboard/src/adc.c @@ -0,0 +1,41 @@ +#include + + +void adc_init(void) { + uint16_t dummyResult; + // AVCC with external capacitor at AREF pin + ADMUX = _BV(REFS0); + + // set frequency prescaler to 8 + ADCSRA = _BV(ADPS1) | _BV(ADPS0); + + // enable ADC + ADCSRA |= _BV(ADEN); + + // make a dummy read out + ADCSRA |= _BV(ADSC); + while (ADCSRA & _BV(ADSC) ) { + } + + // we have to read, otherwise the next result is not available + dummyResult = ADCW; +} + + +uint16_t adc_read_single(uint8_t channel) { + ADMUX = (ADMUX & ~(0x1F)) | (channel & 0x1F); + ADCSRA |= _BV(ADSC); + while (ADCSRA & (1<xLa+g1 zqlQ?z;)6fFVq%Q`s4*JQ1fxF$CBgW|M@(o8iAEElCKz8y{l2*~ySK%tCp-6i=P_qy z&YYQh_pxb7ZFUUl=%XXyow|w;u00-t~ffczF2O zaMQ8phM#_T@W2yG2Tu6f&f!~z�zjr-sfAogcb5G&VG~+EM)~`fl`W=g*yEodZff zJhDtae^c!qDUMudyS!jh$DEFjpZRR2Tw1zp`AGN3){)cdJtd!?Q5{F89vvIJICy^W z+~BFfrekWlx~{FgCEPZzZMvGFrcDwFbxKRi9Z-pcXG^&4wwBc`o7zPhjJ`>vF{q7MnPVBD#!S9!4Ewjz5W?1gH8hg>Jq~2F#y4QTl$x~E z=#S|SO?`MMB5#1}@l@kF!rrRNRFzEjedj7FEz$o=2zoYZ?u}MI#dltKg|qLt&^k^K zo4ra-)S?GXm=+tZIU}mm_JQ(Rgb&G1AfEC#R^^qF603NnST>W0rIX2+(^rbE zjNTHxITnqYA61!rGFwTxB2Fq9O|rDTatfJ@_WGOAsJCQ}{69X+_+4$dm2H13Pvo;F z_*>cbn_=u$Z~M0!y)t~_xJburq$VWObb|hDt0xGGRp|#3`RTZzQ z-BsmO6*a7g@mgy3U7>|SQ#YQ$sPtB{i|l|8@zm6fr+)yuPzE%jCgPcVrmPPFg_7%} z;$9}7&bqqTYdWVdtz+;StjA!TR!~f<;$`7kAzsl1fumEn`6dXY`DlK>1}*b(u!cmE zy-q&wW@W=YJ0oi%x{m9!tK_{*I`5_;@G42RkWWWyDh#3>gENoy7IJPZTS+>e50m9o zA(qHIUQY@A6idkoG%q#SiA8|@NL$)~CF17W&>t^Riyftfd|zLvpRaKS>MjWiFfUP>ar;qY#RZWbDS zXybXl-pKm>0Q@dmkZe4bGOy_W@>>BP+lO%&?;Qd|*0vV1#Wd}Kz+-30!aJb|uA}=Z zkq=%?#$dd^@I4SQ@wh%4uP4w4P`<^&y9o^07!G8M zX_}9l*5cs&KjO<`P)!@M9xwRJoX zZ2JI8tWjhYfgx+FLJr0&2I5UMHpYJo&GrG5G~z`F3|ZUjkc08|BOc!&oZoa~W4sU0 z*k?H!X#nxAu|Xgcvaye?JwSOGoBs)cA=`x0_GX_X>@Ff zg_@6!b%EFCG;uyiW`M%ATf~bqec>3d*dkI)#OmQKzuprJ&p{YmCVJ z&%jK#fD^M8DD#!h&w?FB<_D@J=Ei)N#pBzzt=kZf3&7U+MhmuRux8Cx&C9tW-q2}{ z_qnBl5o&Mo+S}T^!D}*KJ@I%YmFdeBQeKAn#pO$* z0{_wAjo`l+yczrtgLw{FPwdOu)_DU?0Q2uD^+jOb&BO + {56,68,130,2,2,4,8,16,0,16}, // ? + {126,153,153,165,133,157,164,166,125,60},// @ + {16,40,68,130,130,254,130,130,130,130}, // A + {248,132,132,132,248,132,130,130,130,252},// B + {60,66,128,128,128,128,128,128,66,60}, // C + {248,132,130,130,130,130,130,130,132,248},// D + {124,64,64,64,124,64,64,64,64,124}, // E + {124,64,64,64,124,64,64,64,64,64}, // F + {56,64,128,128,128,140,130,130,132,120},// G + {130,130,130,130,254,130,130,130,130,130},// H + {124,16,16,16,16,16,16,16,16,124}, // I + {2,2,2,2,2,2,2,2,68,56}, // J + {132,136,144,160,192,192,160,144,136,132},// K + {128,128,128,128,128,128,128,128,128,248},// L + {130,198,170,170,146,130,130,130,130,130},// M + {130,194,162,162,146,146,138,138,134,130},// N + {56,68,130,130,130,130,130,130,68,56}, // O + {252,130,130,130,252,128,128,128,128,128},// P + {56,68,130,130,130,130,130,138,68,58}, // Q + {252,130,130,130,252,136,132,130,130,130},// R + {62,64,128,128,96,24,4,2,2,252}, // S + {254,16,16,16,16,16,16,16,16,16}, // T + {130,130,130,130,130,130,130,130,68,56},// U + {130,130,130,130,130,130,130,68,40,16}, // V + {130,130,130,130,146,170,170,198,198,130},// W + {130,68,68,40,16,16,40,68,68,130}, // X + {130,130,130,68,56,16,16,16,16,16}, // Y + {254,4,8,8,16,16,32,32,64,254}, // Z + {56,32,32,32,32,32,32,32,32,56}, // [ + {128,64,64,64,32,32,16,16,8,12}, // backslash + {112,16,16,16,16,16,16,16,16,112}, // ] + {16,16,40,68,0,0,0,0,0,0}, // ^ + {0,0,0,0,0,0,0,0,0,124}, // _ + {24,4,0,0,0,0,0,0,0,0}, // ` + {0,0,0,112,136,8,120,136,136,248}, // a + {0,0,0,128,128,128,240,136,136,240}, + {0,0,0,0,112,128,128,128,128,112}, + {0,0,0,8,8,8,120,136,136,120}, + {0,0,0,0,112,136,248,128,128,120}, + {0,0,0,16,32,32,112,32,32,32}, + {0,0,0,120,136,136,120,8,8,240}, + {0,0,0,128,128,128,240,136,136,136}, + {0,0,0,32,0,32,32,32,32,32}, + {0,0,0,16,0,16,16,16,144,96}, + {0,0,0,128,128,144,160,192,160,144}, + {0,0,0,32,32,32,32,32,32,32}, + {0,0,0,0,108,84,84,84,84,84}, + {0,0,0,0,240,136,136,136,136,136}, + {0,0,0,0,112,136,136,136,136,112}, + {0,0,0,0,120,68,68,120,64,64}, + {0,0,0,0,120,136,136,120,8,8}, + {0,0,0,0,176,192,128,128,128,128}, + {0,0,0,0,112,128,64,32,16,224}, + {0,0,0,64,64,224,64,64,64,48}, + {0,0,0,0,136,136,136,136,136,112}, + {0,0,0,0,136,136,136,136,80,32}, + {0,0,0,0,146,146,146,84,84,40}, + {0,0,0,0,136,80,32,32,80,136}, + {0,0,0,0,136,136,80,32,32,64}, + {0,0,0,0,248,16,32,64,128,248}, // z + {24,24,24,24,56,56,24,24,24,24}, // { + {0,32,32,32,32,32,32,32,32,0}, // | + {24,24,24,24,28,28,24,24,24,24}, // } + {0,0,0,0,50,76,0,0,0,0}, // ~ + {0,0,0,0,126,98,98,98,126,0}, // kasten +}; + +#endif diff --git a/display/software/powerboard/src/main.c b/display/software/powerboard/src/main.c new file mode 100644 index 0000000..a51074b --- /dev/null +++ b/display/software/powerboard/src/main.c @@ -0,0 +1,88 @@ +#include +#include +#include +#include +#include "adc.h" + +#define AD_I_LOAD 0 +#define AD_I_GEN 1 +#define AD_V 2 + +#define LOADSW PB0 +#define GENSW PB1 +#define DUMPSW PB2 +#define PORT_SW PORTB +#define DDR_SW DDRB + +#define LOAD_ON PORT_SW |= _BV(LOADSW) +#define LOAD_OFF PORT_SW &= ~_BV(LOADSW) +#define GEN_ON PORT_SW |= _BV(GENSW) +#define GEN_OFF PORT_SW &= ~_BV(GENSW) +#define DUMP_ON PORT_SW |= _BV(DUMPSW) +#define DUMP_OFF PORT_SW &= ~_BV(DUMPSW) + +typedef enum { + generated, + consumed +} power_source; + + +volatile uint16_t syscounter = 0; + +void timer_init(void) { + // clock is 8MHz + TCCR1B |= _BV(WGM12) | _BV(CS11) | _BV(CS10) ; // CTC Mode for Timer 1 (16Bit) with prescale of 64 + OCR1A = 1250; // 100Hz + TIMSK = _BV(OCIE1A); + sei(); // enable interrupts +} + +void ports_init(void) { + DDR_SW |= _BV(LOADSW) | _BV(GENSW) | _BV(DUMPSW); + PORT_SW &= ~(_BV(LOADSW) | _BV(GENSW) | _BV(DUMPSW)); +} + +uint8_t get_voltage(void) { + // voltage has a divider (12V - 56k - ADC - 27k - GND) + // so + uint8_t voltage = 0; + + return voltage; +} + +uint8_t get_power(power_source source) { + + uint16_t voltage = get_voltage(); + uint16_t amperes; + + if(source == generated) { + amperes = adc_read_avg(AD_I_GEN, 4); + } else { + amperes = adc_read_avg(AD_I_LOAD, 4); + } + + return 0; +} + + + +int main(void) { + ports_init(); + adc_init(); + timer_init(); + + + + while(1) { + + } + + return(0); +} + +// system timer +SIGNAL(TIMER1_COMPA_vect) { + syscounter++; +} + + diff --git a/display/software/powerboard/src/main.h b/display/software/powerboard/src/main.h new file mode 100644 index 0000000..fb54471 --- /dev/null +++ b/display/software/powerboard/src/main.h @@ -0,0 +1,26 @@ +#ifndef _main_h + #define _main_h + + // count of lines on display + #define NUM_ROWS 10 + + enum tower_mode_t { + NONE, + ROTATE_CCW, + ROTATE_CW, + BLINK, + }; + + enum display_mode_t { + NORMAL, + SCROLL + }; + + struct message_t { + enum display_mode_t mode; + uint8_t speed; + char *text; + }; + +#endif + diff --git a/display/software/powerboard/src/main.lst b/display/software/powerboard/src/main.lst new file mode 100644 index 0000000..f032ddb --- /dev/null +++ b/display/software/powerboard/src/main.lst @@ -0,0 +1,175 @@ + 1 .file "main.c" + 2 __SREG__ = 0x3f + 3 __SP_H__ = 0x3e + 4 __SP_L__ = 0x3d + 5 __CCP__ = 0x34 + 6 __tmp_reg__ = 0 + 7 __zero_reg__ = 1 + 15 .Ltext0: + 16 .global timer_init + 18 timer_init: + 19 .LFB0: + 20 .LM1: + 21 /* prologue: function */ + 22 /* frame size = 0 */ + 23 /* stack size = 0 */ + 24 .L__stack_usage = 0 + 25 .LM2: + 26 0000 8EB5 in r24,78-32 + 27 0002 8B60 ori r24,lo8(11) + 28 0004 8EBD out 78-32,r24 + 29 .LM3: + 30 0006 82EE ldi r24,lo8(1250) + 31 0008 94E0 ldi r25,hi8(1250) + 32 000a 9BBD out 74+1-32,r25 + 33 000c 8ABD out 74-32,r24 + 34 .LM4: + 35 000e 80E1 ldi r24,lo8(16) + 36 0010 89BF out 89-32,r24 + 37 .LM5: + 38 /* #APP */ + 39 ; 37 "src/main.c" 1 + 40 0012 7894 sei + 41 ; 0 "" 2 + 42 /* epilogue start */ + 43 .LM6: + 44 /* #NOAPP */ + 45 0014 0895 ret + 46 .LFE0: + 48 .global ports_init + 50 ports_init: + 51 .LFB1: + 52 .LM7: + 53 /* prologue: function */ + 54 /* frame size = 0 */ + 55 /* stack size = 0 */ + 56 .L__stack_usage = 0 + 57 .LM8: + 58 0016 87B3 in r24,55-32 + 59 0018 8760 ori r24,lo8(7) + 60 001a 87BB out 55-32,r24 + 61 .LM9: + 62 001c 88B3 in r24,56-32 + 63 001e 887F andi r24,lo8(-8) + 64 0020 88BB out 56-32,r24 + 65 /* epilogue start */ + 66 .LM10: + 67 0022 0895 ret + 68 .LFE1: + 70 .global get_voltage + 72 get_voltage: + 73 .LFB2: + 74 .LM11: + 75 /* prologue: function */ + 76 /* frame size = 0 */ + 77 /* stack size = 0 */ + 78 .L__stack_usage = 0 + 79 .LVL0: + 80 .LM12: + 81 0024 80E0 ldi r24,lo8(0) + 82 /* epilogue start */ + 83 0026 0895 ret + 84 .LFE2: + 86 .global get_power + 88 get_power: + 89 .LFB3: + 90 .LM13: + 91 .LVL1: + 92 /* prologue: function */ + 93 /* frame size = 0 */ + 94 /* stack size = 0 */ + 95 .L__stack_usage = 0 + 96 .LM14: + 97 0028 8823 tst r24 + 98 002a 01F4 brne .L5 + 99 .LM15: + 100 002c 81E0 ldi r24,lo8(1) + 101 .LVL2: + 102 002e 00C0 rjmp .L7 + 103 .LVL3: + 104 .L5: + 105 .LM16: + 106 0030 80E0 ldi r24,lo8(0) + 107 .LVL4: + 108 .L7: + 109 0032 64E0 ldi r22,lo8(4) + 110 0034 00D0 rcall adc_read_avg + 111 .LM17: + 112 0036 80E0 ldi r24,lo8(0) + 113 /* epilogue start */ + 114 0038 0895 ret + 115 .LFE3: + 117 .global main + 119 main: + 120 .LFB4: + 121 .LM18: + 122 /* prologue: function */ + 123 /* frame size = 0 */ + 124 /* stack size = 0 */ + 125 .L__stack_usage = 0 + 126 .LM19: + 127 003a 00D0 rcall ports_init + 128 .LM20: + 129 003c 00D0 rcall adc_init + 130 .LM21: + 131 003e 00D0 rcall timer_init + 132 .L9: + 133 0040 00C0 rjmp .L9 + 134 .LFE4: + 136 .global __vector_6 + 138 __vector_6: + 139 .LFB5: + 140 .LM22: + 141 0042 1F92 push __zero_reg__ + 142 0044 0F92 push r0 + 143 0046 0FB6 in r0,__SREG__ + 144 0048 0F92 push r0 + 145 004a 1124 clr __zero_reg__ + 146 004c 8F93 push r24 + 147 004e 9F93 push r25 + 148 /* prologue: Signal */ + 149 /* frame size = 0 */ + 150 /* stack size = 5 */ + 151 .L__stack_usage = 5 + 152 .LM23: + 153 0050 8091 0000 lds r24,syscounter + 154 0054 9091 0000 lds r25,syscounter+1 + 155 0058 0196 adiw r24,1 + 156 005a 9093 0000 sts syscounter+1,r25 + 157 005e 8093 0000 sts syscounter,r24 + 158 /* epilogue start */ + 159 .LM24: + 160 0062 9F91 pop r25 + 161 0064 8F91 pop r24 + 162 0066 0F90 pop r0 + 163 0068 0FBE out __SREG__,r0 + 164 006a 0F90 pop r0 + 165 006c 1F90 pop __zero_reg__ + 166 006e 1895 reti + 167 .LFE5: + 169 .global syscounter + 170 .global syscounter + 171 .section .bss + 174 syscounter: + 175 0000 0000 .skip 2,0 + 240 .Letext0: +DEFINED SYMBOLS + *ABS*:0000000000000000 main.c + /tmp/cc5sOhJc.s:2 *ABS*:000000000000003f __SREG__ + /tmp/cc5sOhJc.s:3 *ABS*:000000000000003e __SP_H__ + /tmp/cc5sOhJc.s:4 *ABS*:000000000000003d __SP_L__ + /tmp/cc5sOhJc.s:5 *ABS*:0000000000000034 __CCP__ + /tmp/cc5sOhJc.s:6 *ABS*:0000000000000000 __tmp_reg__ + /tmp/cc5sOhJc.s:7 *ABS*:0000000000000001 __zero_reg__ + /tmp/cc5sOhJc.s:18 .text:0000000000000000 timer_init + /tmp/cc5sOhJc.s:50 .text:0000000000000016 ports_init + /tmp/cc5sOhJc.s:72 .text:0000000000000024 get_voltage + /tmp/cc5sOhJc.s:88 .text:0000000000000028 get_power + /tmp/cc5sOhJc.s:119 .text:000000000000003a main + /tmp/cc5sOhJc.s:138 .text:0000000000000042 __vector_6 + /tmp/cc5sOhJc.s:174 .bss:0000000000000000 syscounter + +UNDEFINED SYMBOLS +adc_read_avg +adc_init +__do_clear_bss diff --git a/display/software/powerboard/src/main.o b/display/software/powerboard/src/main.o new file mode 100644 index 0000000000000000000000000000000000000000..95187ca8fc1bc3d1e6389ff07dbfcfd5954fbb7e GIT binary patch literal 4836 zcmai1ZH!b`8Gg^qE-cJ;XFpop7A#X)ktob8beCeSK=^7&8{I%5N;H={Gnd&3vvbEg zGYixYwjT+UChfwOmIRZg+8-vy*o3M-5R1{MiH&KZ(L`gi)nCS>5x*0Dtj}{kcFwM8 zc;U?ZywCfd_nh;dbMC!+cK;Ixlv3hE$zkbOBEvl*&%rsS12)Nr+za>6d#hpSyPM__^!nubn@8{(8^lnfac}=QpT-K0PltXXeZE@-7*9 zSO2@Y{!;c*_WRjO10yfZy*4*Atmn18Pw9uMkO%NG7urlt_Awr28Jud@6HrNTkd1n00rT%4EnZ@GCYUXx&{REAwhs zuZjOy@4=y*_V$cR=iVTbkS2gJKDNIMMV2@IIOS<%K`CF!G{-hK}Mu9Yb>LJab zFsM?hyIOBq$5$rkNUfwJ)zxj3v3iWvV=Sfnri|)VYWNkz>JiMZG6~h%r@^l@)7qjo z!%%PINB35vv}Kj?<`$=&zLaz1rX}R+*BNhxQQdH7u4$rIN2+l>h97ef4(v4s9_Jh> zI4Ce5+D~O>vP0vn$+2JUq{oUkn z8o&B}sb*4=Lc5t1YSm()QYsa~>7+20AJ0En$mi{UQq_8?)-FdPQ(?89FY!7yTV-rm ze$woDx8C^&#ppFw-*X3jr#R=oZ&}`Zm*sVF!G>}Aqb_Suqm(YHQn&j$ zl>&{!FAESQ>g-5wPTQcgup9kOxVOIDwan%o`F`%dZ|7leLZenPISRGSK>TX?5`N8f z`#N@mr@2*~ijtsOueRhjFdK2wY8vw|Fe_0jn2u|$uoCG5OS=)DiW1?`hpOr#dqE4f9A&l9&| zy}rU^JQWpc?NZn@u+%EYg<|z&REg?Q5@Okfa<$p0g=Y%Q_(bbem_!9VdNB@@vMkB0 z$NK*PT|NAAhf|FxiJE45x(la%Ba_pO8ez- z#m_g-Otr$IjNlP;PC70a)h=IV<;nd_{~ByA3q#iz9z7rkFWas!8vihXF)hj-$ul> zU6AMd8nBxK-EU!B)`8>lRqV#S0_^9zihPfNbK-n+ApCqcy?j~gWB%`;xjumMJLJm| zSaH5@!S?gLgM7o_IKKhwW4<4vvCk+PAshR+vj->>_(u9Uffd(<+CP_X z;_Gi7B;R3oqj65ya#@Au=bJ^*-UR2w<#V>vKHnv`793BV)-&xe=_Mo3-=)tO&$N+S z3tU&{Q|Q*heXu`my@LE3fX&|mByTNzV$o-8er0y%w0u4&rYGser-mWZ=F4m`BCSvC zqKWx(hdPorA9;&JT6i)#lGeNA+e5O?nymjIX8KuZVq9ZwAA=r2 z#~gSrd(PuYz|OnnHg ziyHtribl*c^#uAF!Bz>m0WD8_>rr<{tu~#e1PAE&da9Z1H!Yr!Bq>&GW?k z#1||sAkVDDQ1Yt9p9KF+i+=_Emc>V)e{3=L=NH6wz3*7ez4$FL##)O!fAskGEap9U z-@|{mn6=@W*_U-4Bu0MnYb<7+HrSX$&|8S@_1tE8&U2^5zXyKY;x7UpB}Pu>IcD)5 z;IfVBhd$}?vBliS(>7*3@C6UQN^H+n2|ibolOAqbyaM{m7WY9vYcZb#ywmK<=l7h& ztmjn^>wQ7YI&j~%{70a#Sms%kP2a-YEMj_#oVG +#include + + +void wait(uint8_t count) { + uint8_t i; + if(count == 0) count = 100; + for(i=0;i}DE|Dd2s!ik=oWm+$o%G96IdPkH?b!D(T$W2$e*FFN&>8ER zToO5FpY4~QGpDT{>-Mg`Y_e-rSC7?ebt6GyK(g5_phS|(CE2wxyD9r{pGZpc8Ig3} z3i-92xvT|WTRIlFXgFqM^48W)6Fkx>(w-J(>xlCldRvD`HcFGgOgfP$6An*v@fvHW zkD*UwpUjGMrDdp({E{qI(TjcP9tI=QLq&&d0GUvGky6_f-z!D)k+2vlN%c7LfMT#l zEI5(&s)2SqJw``j5gmzCnkwuu=P4$1WRxS3QC5hLTgi_Rp~grYCk#WM-QI*JBKEm` zU^8l-iIbMq&g2|0Mb!~5BHdg@^2MBBCq%6D-BgfHPpmd$ES?KV^|ac%PHJUm9@J#QNx`UkXxoW;|!e*L8bPgQtU-7iU@QTGcKuUMEYl?u*5zc8G?FTcK!&+8v4 zuUe`!%I^P(Ei?kJBEn}qUt(nw7RqkLnaxk}BFC!S~5jN3Q#-Lv7@jt z_rY`2E0o)#3M0ba^d)kY!M>iF!^Y^mbbrBSVWlU28zD@{4RRBF}9T$AFpMZsFO)DF3RvF7;Ya1&Yv zQbYfBe6uByTg}Q2ywZWXT`ooYgo%+;gxV|Bh0%CJR3)>94w*unneb5C-2dBL;2- z5nso3tm7h_Tn8@*vyQ#MrVpT0@Qy_{d*tJHC!X)U#UlH`F(21w@=XB8^95LV4xAB_ z!vSG1eJk*t=XJz99mKdiPmYTv zHOEz79N0!SqtgasK%0Co0mt)=#Pad`Mj!KEKr?*+r2$8dK#TFc2|J!|S8QK;w2%2N zqOs2)8s#)P|9ljgRHqd8_oRcV%y_;w(qoUe3Hh;>|F-zR$z2=Olf?qY~P(!_=xM*w4p!3Jm&-+ya&|X z1k87j=SvA3dCqA38}#cM?}NUe@fGOzHRe8jqVeOY8N66LfyNw{ o_k_v$g~qHCvzFDs-)f$7X02E(9th*iSgK~YSjazN)}D#~6ZJBYfB*mh literal 0 HcmV?d00001