Software: Difference between revisions

From Wiki-DB
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
   Im Folgenden werden die GPIOs aufgelistet, und deren Nummer, unter welcher Sie im Linux angeprochen werden können.
==GPIOs==
 
===Mapping===
   In the following sheet you can find the GPIOs and their linux-number
   [[File:GPIOs.jpg]]
   [[File:GPIOs.jpg]]


Folgendermaßen kann ein GPIO unter Linux angesteuert werden:
===Control===
 
How to control a GPIO:


   cd /sys/class/gpio
   cd /sys/class/gpio
   echo 44 >export              // lege GPIO A an, ein neues Verzeichnis wird erstellt
   echo 44 >export              // create new directory
   cd gpio44                    // wechsle in den neuen Ordner
   cd gpio44                    // go into this directory
   cat direction                // zeigt an ob GPIO als Input oder Output verwendet wird
   cat direction                // show if GPIO is used as an input or an output
   out
   out
   echo 1 >value                // setzt den Ausgang auf '1' = high
   echo 1 >value                // change output to '1'=high
   echo in >direction          // ändert den GPIO zum Input
   echo in >direction          // change GPIO to input
   cat value                    // zeigt den Wert an, der am GPIO anliegt
   cat value                    // show input value
   0                            // '0' = low
   0                            // '0' = low
==PLD==
===Development Software===
To write your own VDHL-code you can use the ispLEVER Classic Software from Lattice
([http://www.latticesemi.com/products/designsoftware/ispleverclassic/index.cfm?source=sidebar]
You also need a programmer (e.g. HW-USBN-2A from Lattice)
After installing the software and the drivers for your programmer you can start a new project.
===Programming example===
You can find a demo-project here:

Revision as of 10:03, 9 July 2012

GPIOs

Mapping

 In the following sheet you can find the GPIOs and their linux-number
 

Control

How to control a GPIO:

 cd /sys/class/gpio
 echo 44 >export              // create new directory
 cd gpio44                    // go into this directory
 cat direction                // show if GPIO is used as an input or an output
 out
 echo 1 >value                // change output to '1'=high
 echo in >direction           // change GPIO to input
 cat value                    // show input value
 0                            // '0' = low

PLD

Development Software

To write your own VDHL-code you can use the ispLEVER Classic Software from Lattice ([1]


You also need a programmer (e.g. HW-USBN-2A from Lattice)

After installing the software and the drivers for your programmer you can start a new project.

Programming example

You can find a demo-project here: