element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
MicroZed Hardware Design How to formulate MIO interrupt for PMOD (SPI) peripheral
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 5 replies
  • Subscribers 310 subscribers
  • Views 1167 views
  • Users 0 members are here
Related

How to formulate MIO interrupt for PMOD (SPI) peripheral

wolfzeh
wolfzeh over 6 years ago

Hello,

I want to get running an enc24j600 card (SPI to Ethernet Inteface from Microchip).

I am using Petalinux 2018.3, compiled in the relevant driver and appended the device tree in

project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dts, see below

 

/include/ "system-conf.dtsi"

/ {

};

 

&spi1{

    encx24j600: eth1@0 {

       compatible = "microchip,encx24j600";

       status = "okay";

       reg = <0>;

       spi-max-frequency = <25000000>;

       interrupt-parent = ?

       interrupts = ?

       };

    spidev: spidev@0 {

       compatible = "spidev";

       reg = <1>;

       spi-max-frequency = <25000000>;

       };

};

 

The module is recognized  when booting, upon dhclient eth1 an interrupt is signalized via MIO0 (Pin 7 PMOD connector), unfortunately i was not successful in getting the interrupt propery "wired", trying different variations. Reading through interrupt methodology did not give me more insight for the moment. Anybody able to provide the last meter?

 

P.S.:

Using petalinux2017.3, the modules was not probed by whatever reason.
The spidev, I added to get reaction on the SPI bus with 2017.3 instead.

 

 

 

  • Sign in to reply
  • Cancel
  • jafoste4
    0 jafoste4 over 6 years ago

    Hi Wolf,

     

    What Hardware are you using?

     

    -Josh

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • wolfzeh
    0 wolfzeh over 6 years ago in reply to jafoste4

    Hi Josh,

    I am using the Microzed AES-Z7MB-7Z010-SOM-I-G/REV-F together with Digilent Pmod NIC100

    Also I was trying

         interrupt-parent = <&gpio0>;

         interrupts = < 0 4 >;

    as noted in

    https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842482/Device+Tree+Tips#DeviceTreeTips-7InterruptInputsUsingGPIO.

     

    cat /proc/interrupts then showed a registered interrupt, however no occurrence despite a measured 0 to 1 transition of MIO0 did show up

     

    Wolfgang

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jafoste4
    0 jafoste4 over 6 years ago in reply to wolfzeh

    Hi Wolfgang,

     

    It looks like Digilent offers IP specific for their pmods, my suggestion would be to go download the IP library and see how they go about implementing their solution.

     

    https://reference.digilentinc.com/reference/pmod/pmodnic100/start

     

    -Josh

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • wolfzeh
    0 wolfzeh over 6 years ago in reply to jafoste4

    As I actually could not find anything helping with Zynq, i went ahead in doing tests with GPIOs and related interrupts. this

    https://gist.github.com/itrobotics/224a0c549ae073ce991c

    helped me significantly in getting progress.

     

    I reduced the module shown to do a gpio_request(gpio_id, "SPI_IRQ_ALIAS") with gpio_id taken from /sys/class/gpio and deriving the relevant irq id with gpio_to_irq.

    Placing the irq id("83" in my case ) into the the the line

         interrupts = <83 4 >;

     

    and letting

         insmod btn_led.ko

    (which does nothing more than gpio_request(..)) precede

         modprobe encx24j600

     

    made the module running with interrupts. I will go ahead in finding out, what action within the kernel is taken by gpio_request and how this could be obtained by means of the device_tree.

    Wolfgang

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • wolfzeh
    0 wolfzeh over 6 years ago in reply to wolfzeh

    There seems to be necessary some kind of preceding GPIO initialisation:

    Actually, the pure initialisation phase of the encx24j600 module does not pull any interrupt line.

    A simple

         echo 906 > /sys/class/gpio/export

    concerning the GPIO number (here 906) used for interrupt

    followed by

         ifconfig <interface-name> or  dhclient <interface-name>

    brings up correct functionality,

     

    From now, I will be looking how to achieve this by means of the device tree.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube