2x1=10

because numbers are people, too
Persönliches
Fotografie
Programmierung
    • ZYBO board MIOs: Driving the LD4 LED using the BTN4 button

      Just a quick and dirty non-tuto­r­i­al solu­tion on how to use the mul­ti­plexed I/Os (MIO/GPIO) to wire the BTN4 but­ton on the ZYBO board (MIO50, the right one) to the LD4 LED (MIO7). Both are con­nect­ed direct­ly to the pro­cess­ing sys­tem and can­not be con­trolled from the fab­ric.

      #include "platform.h"
      
      #include "xparameters.h"
      #include "xgpiops.h"
      #include "xstatus.h"
      
      #define GPIO_DEVICE_ID  XPAR_XGPIOPS_0_DEVICE_ID
      #define OUTPUT_PIN		7	/* MIO7,  pin connected to LED */
      #define INPUT_PIN		50	/* MIO50, pin connected to button */
      
      int main()
      {
      	int Status;
      	XGpioPs Gpio;
      	XGpioPs_Config *ConfigPtr;
      
              // Initialize the system
      	init_platform();
      
      	// initialize the GPIO driver.
      	ConfigPtr = XGpioPs_LookupConfig(GPIO_DEVICE_ID);
      	Status = XGpioPs_CfgInitialize(&Gpio, ConfigPtr, ConfigPtr->BaseAddr);
      	if (Status != XST_SUCCESS) {
      		return XST_FAILURE;
      	}
      
      	// configure the LED pin as output
      	// status checks skipped for readability
      	XGpioPs_SetDirectionPin(&Gpio, OUTPUT_PIN, 1);
      	XGpioPs_SetOutputEnablePin(&Gpio, OUTPUT_PIN, 1);
      
      	// configure the button pin as input
      	XGpioPs_SetDirectionPin(&Gpio, INPUT_PIN, 0);
      
      	// wire the button to the LED (inverted)
      	while(1)
      	{
      		u32 data = XGpioPs_ReadPin(&Gpio, INPUT_PIN);
      		XGpioPs_WritePin(&Gpio, OUTPUT_PIN, !data);
      	}
      
          return 0;
      }
      

      Note that when you open the system.mss file in SDK, you’ll find the ps7_gpio_0 entry under the Periph­er­al Dri­vers sec­tion. Click “Exam­ple” there to find more infor­ma­tion.

      März 6th, 2014 GMT +1 von
      Markus
      2014-03-6T08:23:11+01:00 2014-03-6T16:28:25+01:00 · 0 Kommentare
      ZYBO Zynq
      FPGA Tutorial

      Hinterlasse einen Kommentar

      Hier klicken, um das Antworten abzubrechen.

    1. « newer
    2. 1
    3. …
    4. 19
    5. 20
    6. 21
    7. 22
    8. 23
    9. 24
    10. 25
    11. …
    12. 43
    13. older »
    • Kategorien

      • .NET
        • ASP.NET
        • Core
        • DNX
      • Allgemein
      • Android
      • Data Science
      • Embedded
      • FPGA
      • Humor
      • Image Processing
      • Kalman Filter
      • Machine Learning
        • Caffe
        • Hidden Markov Models
        • ML Summarized
        • Neural Networks
        • TensorFlow
      • Mapping
      • MATLAB
      • Robotik
      • Rust
      • Signal Processing
      • Tutorial
      • Version Control
    • Neueste Beiträge

      • Summarized: The E-Dimension — Why Machine Learning Doesn’t Work Well for Some Problems?
      • Use your conda environment in Jupyter Notebooks
      • Building OpenCV for Anaconda Python 3
      • Using TensorFlow’s Supervisor with TensorBoard summary groups
      • Getting an image into and out of TensorFlow
    • Kategorien

      .NET Allgemein Android ASP.NET Caffe Core Data Science DNX Embedded FPGA Hidden Markov Models Humor Image Processing Kalman Filter Machine Learning Mapping MATLAB ML Summarized Neural Networks Robotik Rust Signal Processing TensorFlow Tutorial Version Control
    • Tags

      .NET Accelerometer Anaconda Bitmap Bug Canvas CLR docker FPGA FRDM-KL25Z FRDM-KL26Z Freescale git Gyroscope Integration Drift Intent J-Link Linear Programming Linux Magnetometer Matlab Mono Naismith OpenCV Open Intents OpenSDA Optimization Pipistrello Player/Stage PWM Python Sensor Fusion Simulink Spartan 6 svn tensorflow Tilt Compensation TRIAD ubuntu Windows Xilinx Xilinx SDK ZedBoard ZYBO Zynq
    • Letzte Kommetare

      • Lecke Mio bei Frequency-variable PWM generator in Simulink
      • Vaibhav bei Use your conda environment in Jupyter Notebooks
      • newbee bei Frequency-variable PWM generator in Simulink
      • Markus bei Using TensorFlow’s Supervisor with TensorBoard summary groups
      • Toke bei Using TensorFlow’s Supervisor with TensorBoard summary groups
    • Blog durchsuchen

    • März 2014
      M D M D F S S
      « Feb   Apr »
       12
      3456789
      10111213141516
      17181920212223
      24252627282930
      31  
    • Self

      • Find me on GitHub
      • Google+
      • Me on Stack­Ex­change
      • Ye olde blog
    • Meta

      • Anmelden
      • Beitrags-Feed (RSS)
      • Kommentare als RSS
      • WordPress.org
    (Generiert in 0,268 Sekunden)

    Zurück nach oben.