Planering inbyggda system
From Datateknik
(Difference between revisions)
(→Labb 2 - Blinky LED etc etc) |
(→Labb 2 - Blinky LED etc etc) |
||
Line 39: | Line 39: | ||
* You can '''draw''' some awesome diagrams in [https://fritzing.org/home/ fritzing], but you can *NOT* '''simulate''' i.e. make the LED blink | * You can '''draw''' some awesome diagrams in [https://fritzing.org/home/ fritzing], but you can *NOT* '''simulate''' i.e. make the LED blink | ||
* Physical device programmed with web-based compiler [[File:LPC1768withUSBcable.jpg|x300px]] [[File:mbed-webIDE.png|x300px]] | * Physical device programmed with web-based compiler [[File:LPC1768withUSBcable.jpg|x300px]] [[File:mbed-webIDE.png|x300px]] | ||
+ | 3.1 Starting to Program................................................................................. 37 | ||
+ | 3.1.1 Thinking About the First Program.................................................................. 37 | ||
+ | 3.1.2 Using the mbed API ............................................................................... 40 | ||
+ | 3.1.3 Exploring the while Loop.......................................................................... 41 | ||
+ | 3.2 Voltages as Logic Values............................................................................. 42 | ||
+ | 3.3 Digital Output on the mbed........................................................................... 44 | ||
+ | 3.3.1 Using Light Emitting Diodes ...................................................................... 44 | ||
+ | 3.3.2 Using mbed External Pins ......................................................................... 46 | ||
+ | 3.4 Using Digital Inputs................................................................................. 47 | ||
+ | 3.4.1 Connecting Switches to a Digital System........................................................... 47 | ||
+ | 3.4.2 The DigitalIn API ................................................................................ 48 | ||
+ | 3.4.3 Using if to Respond to a Switch Input ............................................................ 49 | ||
+ | 3.5 Digital Input and Output With the Application Board.................................................. 51 | ||
+ | 3.6 Interfacing Simple Optodevices ...................................................................... 54 | ||
+ | 3.6.1 Optoreflective and Transmissive Sensors........................................................... 54 | ||
+ | 3.6.2 Connecting an Optosensor to the mbed.............................................................. 55 | ||
+ | 3.6.3 Seven-Segment Displays............................................................................ 56 | ||
+ | 3.6.4 Connecting a Seven-Segment Display to the mbed ................................................... 58 | ||
+ | 3.7 Switching Larger DC Loads............................................................................ 61 | ||
+ | 3.7.1 Applying Transistor Switching..................................................................... 61 | ||
+ | 3.7.2 Switching a Motor With the mbed................................................................... 63 | ||
+ | 3.7.3 Switching Multiple Seven-Segment Displays......................................................... 64 | ||
+ | 3.8 Mini Project: Letter Counter ........................................................................ 65 | ||
==h2== | ==h2== |
Revision as of 14:33, 15 October 2019
prequel
Contents |
Kursböcker
LABBAR
Labb 1 - von Neumann & Assemblerprogrammering
von Neumann
- Fetch-Decode-Store CYCLE
- BBC: https://www.bbc.co.uk/bitesize/guides/z2342hv/revision/5 (Inqluding test!!)
- Flash: Click Next: https://www.hartismere.com/20398/CPU-Fetch-Decode-Execute-Animation
- Bra bok/Wiki KORT, med frågor -- https://en.wikibooks.org/wiki/A-level_Computing/AQA/Computer_Components,_The_Stored_Program_Concept_and_the_Internet/Machine_Level_Architecture/The_Fetch%E2%80%93Execute_cycle_and_the_role_of_registers_within_it
- https://www.ciss100.com/lecture-topics-modules/architecture-hardware/fetch-execute-cycle/
- ONLINE: https://tools.withcode.uk/cpu/
- Download: https://sourceforge.net/projects/johnnysimulator/
- CRAZY DETAIL: http://www.visual6502.org/sim/varm/armgl.html
- BAD??: https://www.mathematik.uni-marburg.de/~thormae/lectures/ti1/code/cpusim/index.html
- Artikel med referenser: https://www.tandfonline.com/doi/full/10.11120/ital.2010.09010100
ARM assembler
Vilken assembler passar till följande kod:
int square(int num) { register int temp; register float x; temp = 4; x = 3.1415; return temp + (int) x; }
Kontrollera på sidan https://godbolt.org/ Glöm inte att ändra till gcc för ARM
Labb 2 - Blinky LED etc etc
- You can draw some awesome diagrams in fritzing, but you can *NOT* simulate i.e. make the LED blink
- Physical device programmed with web-based compiler
3.1 Starting to Program................................................................................. 37 3.1.1 Thinking About the First Program.................................................................. 37 3.1.2 Using the mbed API ............................................................................... 40 3.1.3 Exploring the while Loop.......................................................................... 41 3.2 Voltages as Logic Values............................................................................. 42 3.3 Digital Output on the mbed........................................................................... 44 3.3.1 Using Light Emitting Diodes ...................................................................... 44 3.3.2 Using mbed External Pins ......................................................................... 46 3.4 Using Digital Inputs................................................................................. 47 3.4.1 Connecting Switches to a Digital System........................................................... 47 3.4.2 The DigitalIn API ................................................................................ 48 3.4.3 Using if to Respond to a Switch Input ............................................................ 49 3.5 Digital Input and Output With the Application Board.................................................. 51 3.6 Interfacing Simple Optodevices ...................................................................... 54 3.6.1 Optoreflective and Transmissive Sensors........................................................... 54 3.6.2 Connecting an Optosensor to the mbed.............................................................. 55 3.6.3 Seven-Segment Displays............................................................................ 56 3.6.4 Connecting a Seven-Segment Display to the mbed ................................................... 58 3.7 Switching Larger DC Loads............................................................................ 61 3.7.1 Applying Transistor Switching..................................................................... 61 3.7.2 Switching a Motor With the mbed................................................................... 63 3.7.3 Switching Multiple Seven-Segment Displays......................................................... 64 3.8 Mini Project: Letter Counter ........................................................................ 65