element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Smartedge External GPIO and WiringPi
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 13 replies
  • Answers 5 answers
  • Subscribers 664 subscribers
  • Views 3088 views
  • Users 0 members are here
Related

Smartedge External GPIO and WiringPi

ergouser
ergouser over 4 years ago

There's a good discussion of the external IO on the SmartEdge by Jan Cumps here : AVNET SmartEdge IIOT Gateway: Use the Industrial I/O

 

Has anyone used these GPIO with wiringpi or have any ideas how that might be done?

 

Thanks.

  • Sign in to reply
  • Cancel
Parents
  • Jan Cumps
    0 Jan Cumps over 4 years ago

    You talk to the industrial I/O  pins via the Linux file system. They are mapped to character device drivers.

    It would be easy in plain python. No idea how to deal with that with the wiring bridge...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps over 4 years ago in reply to Jan Cumps

    ergouser  wrote:

     

    ....

    Has anyone used these GPIO with wiringpi or have any ideas how that might be done?

     

    ...

    As far as I can see, the I/Os are managed by an ON Semi i2c port expander: fxl6408fxl6408.

    I derive it from their github: https://github.com/Avnet/smartedge-iiot-gateway/blob/master/drivers/gpio/gpio-fxl6408.c .

    I am not sure, because the On Semi datasheet says the package should mention TX, but the IC on my device says UK RX.

     

    You could try and talk to it from wiringpi. The protocol is documented in the datasheet.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • ergouser
    0 ergouser over 4 years ago in reply to Jan Cumps

    Jan,

     

    Thanks for the input so far.

     

    As far as I can tell, there is already an FXL6408 on the Pi3 which controls some of the existing peripherals (eg hdmi hot-plug) and it has firmware support.  That expander is rumoured to be full, and so do we think that the additional GPIO adds another FXL6408  (which would make some sense)?  The manual also references some reserved I2C addresses:

     

    *NOTE: I2C1 Bus (GPIO2/GPIO3) is shared with onboard devices. I2C addresses: 0x33, 0x43, 0x44, 0x51 are reserved.

     

    Any thoughts on how to confirm these thoughts or how to determine the I2C address?   There's a huge performance advantage to using the firmware driver over using the character file interface from which I'd like to benefit.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps over 4 years ago in reply to ergouser

    I get this report. It matches with the note above.

    image

    I'm setting up probing with a protocol analyser

    image

    source: https://www.raspberrypi.org/documentation/usage/gpio/

     

    image

     

    Let's see if I can capture a conversation....

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps over 4 years ago in reply to Jan Cumps

    Here are the results of the i2c capture.

    I made my analyser trigger on a change of the output O1. and captured the traffic before that event.

    Two scenarios: First I sent a 0, then a 1.

    The IC's i2c address is 0b1000011 -> 0x43

     

    image

     

    sudo echo 0 > /sys/class/gpio/gpio201/value

     

    I2C Analysis results


    2 januari 2021
    Bus configuration
    SDAChannel 1
    SCLChannel 0
    Statistics
    Decoded bytes7
    Detected bus errors0
    IndexTimeHexBinDec
    0-2,30 msSTART
    1-2,29 ms0x860b10000110134
    2-2,00 msACK
    3-1,98 ms0x050b000001015
    4-1,71 msACK
    5-1,66 msSTART
    6-1,65 ms0x870b10000111135
    7-1,36 msACK
    8-1,34 ms0x020b000000102
    9-1,07 msNACK
    10-1,02 msSTOP
    11-971,50 μsSTART
    12-955,50 μs0x860b10000110134
    13-667,50 μsACK
    14-651,50 μs0x050b000001015
    15-379,50 μsACK
    16-363,50 μs0x000b000000000
    17-91,50 μsACK
    18-43,50 μsSTOP

     

    sudo echo 1 > /sys/class/gpio/gpio201/value

     

    I2C Analysis results


    2 januari 2021
    Bus configuration
    SDAChannel 1
    SCLChannel 0
    Statistics
    Decoded bytes7
    Detected bus errors0
    IndexTimeHexBinDec
    0-2,23 msSTART
    1-2,21 ms0x860b10000110134
    2-1,92 msACK
    3-1,91 ms0x050b000001015
    4-1,63 msACK
    5-1,59 msSTART
    6-1,57 ms0x870b10000111135
    7-1,28 msACK
    8-1,27 ms0x000b000000000
    9-993,20 μsNACK
    10-945,20 μsSTOP
    11-883,60 μsSTART
    12-867,60 μs0x860b10000110134
    13-579,60 μsACK
    14-563,70 μs0x050b000001015
    15-291,60 μsACK
    16-275,70 μs0x020b000000102
    17-3,60 μsACK
    1844,40 μsSTOP

     

     

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps over 4 years ago in reply to ergouser

    ergouser  wrote:

     

    ....

    Any thoughts on how to confirm these thoughts or how to determine the I2C address?   There's a huge performance advantage to using the firmware driver over using the character file interface from which I'd like to benefit.

    In the scheme of things, the majority of time is spent in i2c. Writing to the block device is going to be a snap, compared to the 2.x ms i2c conversation.

    If you want to have direct fast control over the pins, you'll need to bring out the hot air gun.

    You can move the control from the IO expander to a direct GPIO pin, by moving resistors:

     

    In this case I'm showing O1. By moving resistor R156 to position 157, it is now controlled by generic GPIO6.

    image

     

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • Jan Cumps
    0 Jan Cumps over 4 years ago in reply to ergouser

    ergouser  wrote:

     

    ....

    Any thoughts on how to confirm these thoughts or how to determine the I2C address?   There's a huge performance advantage to using the firmware driver over using the character file interface from which I'd like to benefit.

    In the scheme of things, the majority of time is spent in i2c. Writing to the block device is going to be a snap, compared to the 2.x ms i2c conversation.

    If you want to have direct fast control over the pins, you'll need to bring out the hot air gun.

    You can move the control from the IO expander to a direct GPIO pin, by moving resistors:

     

    In this case I'm showing O1. By moving resistor R156 to position 157, it is now controlled by generic GPIO6.

    image

     

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
  • ergouser
    0 ergouser over 4 years ago in reply to Jan Cumps

    This is an interesting option.  One issue with the industrial I/O being on the I2C bus is that you loose the ability to use either hardware or software PWM.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps over 4 years ago in reply to ergouser

    ergouser  wrote:

     

    This is an interesting option.  One issue with the industrial I/O being on the I2C bus is that you loose the ability to use either hardware or software PWM.

    I have some time today. I'm going to move the "DIGIO B" pins to direct ARM GPIO mode. This is a non-destructive exercise (if I am careful).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps over 4 years ago in reply to ergouser

    ergouser  wrote:

     

    This is an interesting option.  One issue with the industrial I/O being on the I2C bus is that you loose the ability to use either hardware or software PWM.

    It works: AVNET SmartEdge IIOT Gateway: Control Industrial I/O directly from GPIO Pins

    image

     

    You don't have permission to edit metadata of this video.
    Edit media
    x
    image
    Upload Preview
    image

    • 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