: Difference between revisions

From Fab Lab Wiki - by NMÍ Kvikan
Jump to navigation Jump to search
No edit summary
No edit summary
Line 190: Line 190:


=== serial output ===
=== serial output ===
* [http://fab.cba.mit.edu/about/fab/hello/serial/hello.serial.45.cad hello.serial.45.cad]
Einföld rafrás sem notar [[RS-232]] (serial) staðalinn til að senda 8 bita [[ASCII]] textastrenginn "Hello World!" aftur og aftur á 9600 bit per sekúndu.
* [http://fab.cba.mit.edu/about/fab/hello/serial/hello.serial.45.asm hello.serial.45.asm]
 
* [http://fab.cba.mit.edu/about/fab/hello/serial/hello.serial.45.hex hello.serial.45.hex]
Tvær útgáfur af forritskóðanum eru hér - annars vegar skrifað í smalamáli, og hinsvegar í C.
* [http://fab.cba.mit.edu/about/fab/hello/serial/hello.serial.45.c hello.serial.45.c]
 
* [http://fab.cba.mit.edu/about/fab/hello/serial/makefile makefile]
* [http://fab.cba.mit.edu/about/fab/hello/serial/hello.serial.45.cad hello.serial.45.cad] - rafrás, teikning
* [http://fab.cba.mit.edu/about/fab/hello/serial/hello.serial.45.asm hello.serial.45.asm] - smalamálskóði
* [http://fab.cba.mit.edu/about/fab/hello/serial/hello.serial.45.hex hello.serial.45.hex] - vélamál (vistþýtt)
* [http://fab.cba.mit.edu/about/fab/hello/serial/hello.serial.45.c hello.serial.45.c] - C kóði
* [http://fab.cba.mit.edu/about/fab/hello/serial/makefile makefile] - Make skrá fyrir C kóða


=== serial echo ===
=== serial echo ===
* [http://fab.cba.mit.edu/about/fab/hello/echo/hello.echo.45.cad hello.echo.45.cad]
Ögn flóknari rafrás sem notar [[RS-232]] (serial) staðalinn til að hlusta eftir textastrengjum og skrifa þá um leið til baka á 9600 bit per sekúndu. Svona rásir eru kallaðar "echo" rásir - gera ekkert nema endurvarpa gögnum.
* [http://fab.cba.mit.edu/about/fab/hello/echo/hello.echo.45.asm hello.echo.45.asm]
 
* [http://fab.cba.mit.edu/about/fab/hello/echo/hello.echo.45.c hello.echo.45.c]
Aftur, bæði smalamáls- og C forrit, en nú er líka útgáfa fyrir ATTiny44.
* [http://fab.cba.mit.edu/about/fab/hello/echo/makefile makefile]
 
* [http://fab.cba.mit.edu/about/fab/hello/echo/hello.echo.45.cad hello.echo.45.cad] - rafrás, teikning, ATTiny45
* [http://fab.cba.mit.edu/about/fab/hello/echo/hello.echo.45.asm hello.echo.45.asm] - smalamálskóði, ATTiny45
* [http://fab.cba.mit.edu/about/fab/hello/echo/hello.echo.45.c hello.echo.45.c] - C kóði, ATTiny45
* [http://fab.cba.mit.edu/about/fab/hello/echo/makefile makefile] - Make skrá fyrir C kóða, ATTiny45


* [http://fab.cba.mit.edu/about/fab/hello/echo/hello.echo.44.cad hello.echo.44.cad]
* [http://fab.cba.mit.edu/about/fab/hello/echo/hello.echo.44.cad hello.echo.44.cad] - rafrás, teikning, ATTiny44
* [http://fab.cba.mit.edu/about/fab/hello/echo/hello.echo.44.asm hello.echo.44.asm]
* [http://fab.cba.mit.edu/about/fab/hello/echo/hello.echo.44.asm hello.echo.44.asm] - smalamálskóði, ATTiny44


=== Takki ===
=== Takki ===
* [http://fab.cba.mit.edu/about/fab/hello/button/hello.button.45.cad hello.button.45.cad]
Einföld rás með takka. Þegar ýtt er á takkann sendir rásin skilaboð í gegnum RS-232.
* [http://fab.cba.mit.edu/about/fab/hello/button/hello.button.45.asm hello.button.45.asm]
 
* [http://fab.cba.mit.edu/about/fab/hello/button/hello.button.45.cad hello.button.45.cad] - rafrás, teikning
* [http://fab.cba.mit.edu/about/fab/hello/button/hello.button.45.asm hello.button.45.asm] - smalamálskóði


=== Ljósnemi ===
=== Ljósnemi ===
* [http://fab.cba.mit.edu/about/fab/hello/light/hello.light.45.cad hello.light.45.cad]
Einfaldur ljósnemi
* [http://fab.cba.mit.edu/about/fab/hello/light/hello.light.45.asm hello.light.45.asm]
 
* [http://fab.cba.mit.edu/about/fab/hello/light/hello.light.45.cad hello.light.45.cad] - rafrás, teikning
* [http://fab.cba.mit.edu/about/fab/hello/light/hello.light.45.asm hello.light.45.asm] - smalamálskóði


* [http://fab.cba.mit.edu/about/fab/hello/light/hello.light.45.py hello.light.45.py]
* [http://fab.cba.mit.edu/about/fab/hello/light/hello.light.45.py hello.light.45.py] - [[Python]] forrit sem hlustar eftir úttaki og birtir niðurstöður


=== Hitanemi ===
=== Hitanemi ===
* [http://fab.cba.mit.edu/about/fab/hello/temp/hello.temp.45.cad hello.temp.45.cad]
Einfaldur hitanemi
* [http://fab.cba.mit.edu/about/fab/hello/temp/hello.temp.45.asm hello.temp.45.asm]
 
* [http://fab.cba.mit.edu/about/fab/hello/temp/hello.temp.45.py hello.temp.45.py]
* [http://fab.cba.mit.edu/about/fab/hello/temp/hello.temp.45.cad hello.temp.45.cad] - rafrás, teikning
* [http://fab.cba.mit.edu/about/fab/hello/temp/hello.temp.45.asm hello.temp.45.asm] - smalamálskóði
* [http://fab.cba.mit.edu/about/fab/hello/temp/hello.temp.45.py hello.temp.45.py] - Python forrit sem hlustar eftir úttaki og birtir niðurstöður


=== Skrefasvörun (viðnám, þéttni, span, staðsetning, fjarlægð, halli) ===
=== Skrefasvörun (viðnám, þéttni, span, staðsetning, fjarlægð, halli) ===
* [http://fab.cba.mit.edu/about/fab/hello/step/hello.step.45.cad hello.step.45.cad]
Rás sem nemur hverslags skrefasvörun, svo sem viðnám, þéttni, span, staðsetningu, fjarlægð eða halla. Hægt að tengja mismunandi nema við rásina til að framkvæma mismunandi mælingar.
* [http://fab.cba.mit.edu/about/fab/hello/step/hello.step.45.asm hello.step.45.asm]
 
* [http://fab.cba.mit.edu/about/fab/hello/step/hello.step.45.cad hello.step.45.cad] - rafrás, teikning
* [http://fab.cba.mit.edu/about/fab/hello/step/hello.step.45.asm hello.step.45.asm] - smalamálskóði


* [http://fab.cba.mit.edu/about/fab/hello/step/hello.step.45.py hello.step.45.py]
* [http://fab.cba.mit.edu/about/fab/hello/step/hello.step.45.py hello.step.45.py] - Python forrit sem hlustar eftir úttaki og birtir niðurstöður


=== Hljóðnemi ===
=== Hljóðnemi ===
* [http://fab.cba.mit.edu/about/fab/hello/mic/hello.mic.45.cad hello.mic.45.cad]
Rás með hljóðnema. Sendir mælingar til baka í gegnum RS-232.
* [http://fab.cba.mit.edu/about/fab/hello/mic/hello.mic.45.asm hello.mic.45.asm]
 
* [http://fab.cba.mit.edu/about/fab/hello/mic/hello.mic.45.py hello.mic.45.py]
* [http://fab.cba.mit.edu/about/fab/hello/mic/hello.mic.45.cad hello.mic.45.cad] - rafrás, teikning
* [http://fab.cba.mit.edu/about/fab/hello/mic/hello.mic.44.cad hello.mic.44.cad]
* [http://fab.cba.mit.edu/about/fab/hello/mic/hello.mic.45.asm hello.mic.45.asm] - smalamálskóði
* [http://fab.cba.mit.edu/about/fab/hello/mic/hello.mic.45.py hello.mic.45.py] - Python forrit sem birtir hljóðsveiflurnar í rauntíma (frekar kúl!)
* [http://fab.cba.mit.edu/about/fab/hello/mic/hello.mic.44.cad hello.mic.44.cad] - ATTiny44 útgáfa af sömu rás


=== RGB LED ===
=== RGB LED ===
* [http://fab.cba.mit.edu/about/fab/hello/RGB/hello.RGB.45.cad hello.RGB.45.cad]
Rás með RGB LED ljósi.
 
* [http://fab.cba.mit.edu/about/fab/hello/RGB/hello.RGB.45.cad hello.RGB.45.cad] - rafrás, teikning


* [http://fab.cba.mit.edu/about/fab/hello/RGB/hello.RGB.45.asm hello.RGB.45.asm]
* [http://fab.cba.mit.edu/about/fab/hello/RGB/hello.RGB.45.asm hello.RGB.45.asm] - smalamálskóði - forrit sem rúllar í gegnum litrófið


=== LED array ===
=== LED array ===
* [http://fab.cba.mit.edu/about/fab/hello/array/hello.array.44.cad hello.array.44.cad]  
Rás með [[Charlieplexing]] LED-fylki.
* [http://fab.cba.mit.edu/about/fab/hello/array/hello.array.44.asm hello.array.44.asm]  
 
* [http://fab.cba.mit.edu/about/fab/hello/array/hello.array.44.2.cad hello.array.44.2.cad] (2 layer)
* [http://fab.cba.mit.edu/about/fab/hello/array/hello.array.44.cad hello.array.44.cad] - rafrás, teikning
* [http://fab.cba.mit.edu/about/fab/hello/array/hello.array.44.asm hello.array.44.asm] - smalamálskóði
* [http://fab.cba.mit.edu/about/fab/hello/array/hello.array.44.2.cad hello.array.44.2.cad] - rafrás með tveimur layerum (erfiðara að smíða, en þarf ekki 0 Ohma viðnám)


=== LCD skjár ===
=== LCD skjár ===
* [http://fab.cba.mit.edu/about/fab/hello/LCD/hello.LCD.44.cad hello.LCD.44.cad]  
Rás sem stýrir LCD skjá
* [http://fab.cba.mit.edu/about/fab/hello/LCD/hello.LCD.44.asm hello.LCD.44.asm]  
 
* [http://fab.cba.mit.edu/about/fab/hello/LCD/hello.LCD.44.cad hello.LCD.44.cad] - rafrás, teikning
* [http://fab.cba.mit.edu/about/fab/hello/LCD/hello.LCD.44.asm hello.LCD.44.asm] - smalamálskóði


=== Vídeóstýring ===
=== Vídeóstýring ===
* [http://fab.cba.mit.edu/about/fab/hello/video/hello.video.44.cad hello.video.44.cad]  
Rás sem birtir mynd á sjónvarpsskjá.
* [http://fab.cba.mit.edu/about/fab/hello/video/hello.video.44.asm hello.video.44.asm]  
 
* [http://fab.cba.mit.edu/about/fab/hello/video/hello.video.44.cad hello.video.44.cad] - rafrás, teikning
* [http://fab.cba.mit.edu/about/fab/hello/video/hello.video.44.asm hello.video.44.asm] - smalamálskóði


=== Hátalari ===
=== Hátalari ===
* [http://fab.cba.mit.edu/about/fab/hello/speaker/hello.speaker.45.cad hello.speaker.45.cad]  
Rás sem stýrir hátalara.
* [http://fab.cba.mit.edu/about/fab/hello/speaker/hello.speaker.45.pwm.asm hello.speaker.45.pwm.asm]  
 
* [http://fab.cba.mit.edu/about/fab/hello/speaker/hello.speaker.45.wave.asm hello.speaker.45.wave.asm]  
* [http://fab.cba.mit.edu/about/fab/hello/speaker/hello.speaker.45.cad hello.speaker.45.cad] - rafrás, teikning
* [http://fab.cba.mit.edu/about/fab/hello/speaker/hello.speaker.45.pwm.asm hello.speaker.45.pwm.asm] - smalamálskóði sem notar [[PWM]]
* [http://fab.cba.mit.edu/about/fab/hello/speaker/hello.speaker.45.wave.asm hello.speaker.45.wave.asm] - smalamálskóði sem notar bylgjuform


=== DC mótor ===
=== DC mótor ===
* [http://fab.cba.mit.edu/about/fab/hello/H-bridge/hello.H-bridge.44.cad hello.H-bridge.44.cad]  
Rás sem stýrir DC mótor
* [http://fab.cba.mit.edu/about/fab/hello/H-bridge/hello.H-bridge.44.asm hello.H-bridge.44.asm]  
 
* [http://fab.cba.mit.edu/about/fab/hello/H-bridge/hello.H-bridge.44.cad hello.H-bridge.44.cad] - rafrás, teikning
* [http://fab.cba.mit.edu/about/fab/hello/H-bridge/hello.H-bridge.44.asm hello.H-bridge.44.asm] - smalamálskóði


=== skrefamótor ===
=== skrefamótor ===
* [http://fab.cba.mit.edu/about/fab/hello/stepper/hello.stepper.44.cad hello.stepper.44.cad]  
Rás sem stýrir skrefamótor
* [http://fab.cba.mit.edu/about/fab/hello/stepper/hello.stepper.44.full.asm hello.stepper.44.full.asm]  
 
* [http://fab.cba.mit.edu/about/fab/hello/stepper/hello.stepper.44.wave.asm hello.stepper.44.wave.asm]  
* [http://fab.cba.mit.edu/about/fab/hello/stepper/hello.stepper.44.cad hello.stepper.44.cad] - rafrás, teikning
* [http://fab.cba.mit.edu/about/fab/hello/stepper/hello.stepper.44.half.asm hello.stepper.44.half.asm]  
* [http://fab.cba.mit.edu/about/fab/hello/stepper/hello.stepper.44.full.asm hello.stepper.44.full.asm] - full stýring
* [http://fab.cba.mit.edu/about/fab/hello/stepper/hello.stepper.44.wave.asm hello.stepper.44.wave.asm] - bylgjustýring
* [http://fab.cba.mit.edu/about/fab/hello/stepper/hello.stepper.44.half.asm hello.stepper.44.half.asm] - hálfhringsstýring


=== Gömul hello-world verkefni ===
=== Gömul hello-world verkefni ===


==== serial output, programming clip (hello) ===
==== serial output, programming clip (hello) ====
* schematic: [http://fab.cba.mit.edu/about/fab/hello/old/hello/hello.sch hello.sch]
* schematic: [http://fab.cba.mit.edu/about/fab/hello/old/hello/hello.sch hello.sch]
* PCB: [http://fab.cba.mit.edu/about/fab/hello/old/hello/hello.brd hello.brd]
* PCB: [http://fab.cba.mit.edu/about/fab/hello/old/hello/hello.brd hello.brd]

Revision as of 10:06, 25 May 2009

Þetta er íslensk útgáfa á CBA Hello World síðunni fyrir Fab Lab smiðjurnar.


CAD/CAM

Sýnidæmi

2D vector teikning

2D raster teikning

3D

Forritun

Nytsamlegir Python pakkar

Útgáfustýring / dreifð þróunarvinna

  • git
    • msysgit - Git fyrir Windows
    • gitk - Grafískt notandaviðmót fyrir Git
    • git-gui - Annað grafískt notandaviðmót fyrir Git
  • [dist/siteserver.py siteserver] - Python skrifta fyrir vefþjóna sem gerir möppu að Git safni

Rafrásir / PCB

Hermun rafrása

* Ngspice

Örstýringar

* Atmel AVR data sheets

Fræsivél / Modela

  • Modela
    • stty 9600 raw -echo crtscts </dev/ttyS0
  • move x y
    • cat out.rml > /dev/ttyS0

Vínilskeri

  • CAMM-1
    • cat out.camm > /dev/parport0

Laserskeri

  • Epilog
    • cat out.epi > /dev/parport0

AVR forritun

  tiny45 load hex file, bsd cable: avrdude -p t45 -c bsd -U flash:w:file.hex
  tiny45 load hex file, dasa cable: avrdude -p t45 -P /dev/ttyUSB0 -c dasa -U flash:w:file.hex
  tiny44 load hex file: avrdude -p t44 -c bsd -U flash:w:file.hex
  tiny44 use 20 MHz xtal: avrdude -p t44 -c bsd -U lfuse:w:0x7E:m
  mega88 load hex file: avrdude -p m88 -c bsd -U flash:w:file.hex
  mega88 use 20 MHz xtal: avrdude -p m88 -c bsd -U lfuse:w:0x76:m
  mega644 load hex file: avrdude -p m644 -c bsd -U flash:w:file.hex
  mega644 use 20 MHz xtal: avrdude -p m644 -c bsd -U lfuse:w:0x76:m

Til að forritun virki gæti verið nauðsynlegt að keyra: (Sjá Linux skipanalínan)

 su
 modprobe parport
 modprobe ppdev
 chmod 777 /dev/parport0

ATtiny45 programming cable:

          7 - reset - 1 8 -
                    - 2 7 - SCK - 8
                    - 3 6 - MISO - 10
           18 - GND - 4 5 - MOSI - 9
                4   1  7  5   6          clip
  1  2  3  4  5  6  7  8  9  10 11 12 13 DB25
   14 15 16 17 18 19 20 21 22 23 24 25   DB25

in-circuit programming AMP MTA plug <- DB25M parallel (bsd) cable (wire side view):

        9        18        10
  | MOSI (3)  GND (2)  MISO (1) |
     -RESET (4)  SCK (5)
           7        8
                 | cable direction
                 v
  plug               1   3   5   4     2
  DB25  13  12  11  10   9   8   7   6   5   4   3   2   1
  DB25    25  24  23  22  21  20  19  18  17  16  15  14

in-circuit programming AMP MTA plug <- DB9F serial (dasa) cable (wire side view):

                 ^
                 | cable direction
        3        5         8
  | MOSI (3)  GND (2)  MISO (1) |
     -RESET (4)  SCK (5)
           7        4
  plug         4 3 1 5   2        
        DCD  Rx  Tx DTR GND
          DSR RTS CTS  RI
  DB9    1   2   3   4   5
  DB9      6   7   8   9
  serial programming voltage limiter: <A href=dist/dasa.cad dasa.cad]

serial AMP MTA plug <- DB9F cable (wire side view):

     Tx GND
  |  2   1 |
   3   4
   Rx DTR
      | cable direction
      v
  plug      3   2   4   1
       DCD  Rx  Tx DTR GND
         DSR RTS CTS  RI
  DB9   1   2   3   4   5
  DB9     6   7   8   9

Molex serial PCB connector:

  1   2   3   4
  Rx  Tx  DTR Gnd

Molex serial cable:

  4   3   2   1
  Gnd DTR Tx  Rx DCD
   RI  CTS RTS DSR
  5   4   3   2  1
   9   8   7   6
  PIN   PURPOSE              SIGNAL NAME  HEADER
  Pin 1 Data Carrier Detect  DCD
  Pin 2 Received Data        RxData       1
  Pin 3 Transmitted Data     TxData       2
  Pin 4 Data Terminal Ready  DTR          3
  Pin 5 Signal Ground        Gnd          4
  Pin 6 Data Set Ready       DSR
  Pin 7 Request To Send      RTS
  Pin 8 Clear To Send        CTS
  Pin 9 Ring Indicator%09      RI

Hello-world rafrásir

serial output

Einföld rafrás sem notar RS-232 (serial) staðalinn til að senda 8 bita ASCII textastrenginn "Hello World!" aftur og aftur á 9600 bit per sekúndu.

Tvær útgáfur af forritskóðanum eru hér - annars vegar skrifað í smalamáli, og hinsvegar í C.

serial echo

Ögn flóknari rafrás sem notar RS-232 (serial) staðalinn til að hlusta eftir textastrengjum og skrifa þá um leið til baka á 9600 bit per sekúndu. Svona rásir eru kallaðar "echo" rásir - gera ekkert nema endurvarpa gögnum.

Aftur, bæði smalamáls- og C forrit, en nú er líka útgáfa fyrir ATTiny44.

Takki

Einföld rás með takka. Þegar ýtt er á takkann sendir rásin skilaboð í gegnum RS-232.

Ljósnemi

Einfaldur ljósnemi

Hitanemi

Einfaldur hitanemi

Skrefasvörun (viðnám, þéttni, span, staðsetning, fjarlægð, halli)

Rás sem nemur hverslags skrefasvörun, svo sem viðnám, þéttni, span, staðsetningu, fjarlægð eða halla. Hægt að tengja mismunandi nema við rásina til að framkvæma mismunandi mælingar.

  • hello.step.45.py - Python forrit sem hlustar eftir úttaki og birtir niðurstöður

Hljóðnemi

Rás með hljóðnema. Sendir mælingar til baka í gegnum RS-232.

RGB LED

Rás með RGB LED ljósi.

LED array

Rás með Charlieplexing LED-fylki.

LCD skjár

Rás sem stýrir LCD skjá

Vídeóstýring

Rás sem birtir mynd á sjónvarpsskjá.

Hátalari

Rás sem stýrir hátalara.

DC mótor

Rás sem stýrir DC mótor

skrefamótor

Rás sem stýrir skrefamótor

Gömul hello-world verkefni

serial output, programming clip (hello)

serial output, programming header (hello0)

serial I/O, programming clip (hello1)

output: LED (hello2)

input: step-response (hello3)

Efe: button+LED

A/D: light/sound/temperature (hello4)

D/A: speaker (hello5)

display: LCD (hello7)

  display hello world: master slave processor

video: RS170 (hello8)

motion: stepper (hello9)

multiplexing: LED array (hello10)