Difference between revisions of "Software"

From Wiki-DB
Jump to navigation Jump to search
Line 9: Line 9:
 
How to control a GPIO:
 
How to control a GPIO:
  
  cd /sys/class/gpio
+
:{| class="wikitable"
  echo 44 >export             // create new directory
+
|1. <code>''cd /sys/class/gpio''</code>
  cd gpio44                    // go into this directory
+
|-
  cat direction                // show if GPIO is used as an input or an output
+
|2. create new directory: <code>''echo 44 >export ''</code>
  out
+
|-
  echo 1 >value                // change output to '1'=high
+
|3. go into this directory: <code>''cd gpio44''</code>
  echo in >direction          // change GPIO to input
+
|-
  cat value                   // show input value
+
|4. show if GPIO is used as an input or an output: <code>''cat direction''</code>
  0                            // '0' = low
+
|-
 +
|5. <code>''out''</code>
 +
|-
 +
|6. change output to '1'=high: <code>''echo 1 >value''</code>
 +
|-
 +
|7. change GPIO to input: <code>''echo in >direction''</code>
 +
|-
 +
|8. show input value: <code>''cat value''</code>
 +
|-
 +
|9. '0' = low: <code>''0''</code>
 +
|} 
 +
 
 
==PLD==
 
==PLD==
  

Revision as of 09:26, 8 August 2012

GPIOs

Mapping

 In the following sheet you can find the GPIOs and their linux-number
Error creating thumbnail: Unable to save thumbnail to destination

Control

How to control a GPIO:

1. cd /sys/class/gpio
2. create new directory: echo 44 >export
3. go into this directory: cd gpio44
4. show if GPIO is used as an input or an output: cat direction
5. out
6. change output to '1'=high: echo 1 >value
7. change GPIO to input: echo in >direction
8. show input value: cat value
9. '0' = low: 0

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) to deploy the VHDL-Code on your PLD.

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:media:PLD-demo.zip

You have to download the *.jed-File with the programmer to your PLD.

 In the constraint editor of ispLEVER you can define, which input X_VAR1 is.
 In this example GPIO E is defined as X_VAR1. If you define GPIO E as an
 output and set GPIO E high, the PLD LED should flash red.
Error creating thumbnail: Unable to save thumbnail to destination