Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

How to use all GPIO pinns?

Volvo742
2016-06-29
2021-09-17
  • Volvo742 - 2016-06-29

    Hello.

    I want to use all my GPIO pinns. Is there a way to fix that? Is it easy? Why do i not have free access to all pinns? I hopp that net version of PI for Codesys will open all pinns.

    Else i Will use the 74HC595 shift register. I only need outputs.

     
  • Volvo742 - 2016-07-31

    plcmax hat geschrieben:
    hello,
    l viewtopic.php?f=21&t=5832&hilit=gpio02 l
    Best Regards
    plcmax

    Sorry. It was no clear answers in that topic.

     
  • eschwellinger

    eschwellinger - 2016-08-01

    Hi,
    hm for us it is clear:
    1. you could select which GPIO configuration you have PI A/B or PI B+PI2/PI3
    if you need more GPIO's:
    2. the Devicedescription for the GPIOs is here:
    "c:\Users\<yourwindowsusername>\CODESYS Control for Raspberry PI\3.5.9.10\Devices\GPIOs.devdesc.xml"
    the library is here:
    "c:\Users\<yourwindowsusername>\CODESYS Control for Raspberry PI\3.5.9.10\Libraries\IoDrvGPIO.library"
    feel free to customuze the GPIO's to your 3th version and to your demands.</yourwindowsusername></yourwindowsusername>

    BR
    Edwin

    IMG: selectGPIO.jpg

    IMG: GPIOTyp.jpg

     
  • Volvo742 - 2016-08-19

    But we don't know what we need to edit in GPIOs.devdesc.xml and oDrvGPIO.library?

    Why can't they allready been free at the first time?
    I hopp next update of Raspberry PI for Codesys will have all GPIO's free to use.

     
  • allen00se - 2016-09-21

    Edwin Schwellinger hat geschrieben:
    Hi,
    hm for us it is clear:
    1. you could select which GPIO configuration you have PI A/B or PI B+PI2/PI3
    if you need more GPIO's:
    2. the Devicedescription for the GPIOs is here:
    "c:\Users\<yourwindowsusername>\CODESYS Control for Raspberry PI\3.5.9.10\Devices\GPIOs.devdesc.xml"
    the library is here:
    "c:\Users\<yourwindowsusername>\CODESYS Control for Raspberry PI\3.5.9.10\Libraries\IoDrvGPIO.library"
    feel free to customuze the GPIO's to your 3th version and to your demands.
    BR
    Edwin</yourwindowsusername></yourwindowsusername>

    Edwin,
    I am trying to add a new device description for the Pi3. I just copied the one for the Pi2 and changed the name/description/id and put it in the same directory. However when I go to install the device into the device repository, my newly created devdesc.xml doesn't show up. Any idea what I am doing wrong?

    Thanks in Advance.

     
  • allen00se - 2016-09-21

    Actually, now I got the new devdesc.xml to show up, and I have added it to the device repository.

    Now my problem is that when I right click on the GPIO device in my project and choose "Update Device" I do not see my newly added Pi3 as an option

    IMG: Bild

    IMG: Bild

     
  • allen00se - 2016-09-21

    So I got tired of waiting and just decided to edit the devdes.xml for the B+. I have now managed to get all of the GPIO pins to show up in the GPIO Parameters Screen which is driven by the devdesc.xml file.

    However I cannot figure out how to get the extra pins to show up in the GPIO I/O Mapping screen. I assume this screen is driven by the IoDrvGPIO Library and I have tried to make the necessary changes to that library, but still cannot get the pins to show. (Basically I did a find/replace on 31 and changed to 39)

    It seems a bit strange that you guys haven't included this functionality by default, is there any updates coming that will add the extra Pins? I really need to know this functionality is available before I spend the money on the license.

    IMG: Bild

    IMG: Bild

     
  • eschwellinger

    eschwellinger - 2016-09-22

    Hi,
    maybe you explain me what you think the difference is between PI2 and PI3 GPIO's.
    How do you want to solve the Problem that -> SPI and I2C GPIO Pins are already busy for this functionality.
    This is the reason why we do it that way (we decided this at the beginning on PI A/B release, we thought SPI and I2C are used allways), guess we will not change it due compatibility issues.
    Users who need all GPIO's need to customize them by their own at the moment.
    If anyone is out there who could provide us with an extended GPIO devdesc and changed library - feel free to publish either in the forum or
    we could maybe add it to the delivery(this need to be clarified if possible and when this will be happen)
    A question do you not/never use SPI and I2C in your application?

    BR
    Edwin

     
  • allen00se - 2016-09-22

    Edwin Schwellinger hat geschrieben:
    Hi,
    maybe you explain me what you think the difference is between PI2 and PI3 GPIO's.
    How do you want to solve the Problem that -> SPI and I2C GPIO Pins are already busy for this functionality.
    This is the reason why we do it that way (we decided this at the beginning on PI A/B release, we thought SPI and I2C are used allways), guess we will not change it due compatibility issues.
    Users who need all GPIO's need to customize them by their own at the moment.
    If anyone is out there who could provide us with an extended GPIO devdesc and changed library - feel free to publish either in the forum or
    we could maybe add it to the delivery(this need to be clarified if possible and when this will be happen)
    A question do you not/never use SPI and I2C in your application?
    BR
    Edwin

    Maybe there has been some confusion. Let me clarify what I think we are all asking for.

    On the Pi2 and Pi3 there are 40 pins on the header. On the Pin Mapping page in CodeSys there are only options to map Pins 0-31. I would like to map some pins in the 32-39 range.

    Also, yes there are some projects where I would like to use the SPI and I2C pins as GPIO, so it would be nice if that was an option as well.

    IMG: Bild

     
  • allen00se - 2016-09-28

    Edwin Schwellinger hat geschrieben:
    Hi
    Edwin

    Any update, does my previous post explain the issue well?

     
  • eschwellinger

    eschwellinger - 2016-09-28

    hi,
    If anyone is out there who could provide us with an extended GPIO devdesc and changed library - feel free to publish either in the forum...
    BR
    Edwin

     
  • allen00se - 2016-09-29

    Edwin Schwellinger hat geschrieben:
    hi,
    If anyone is out there who could provide us with an extended GPIO devdesc and changed library - feel free to publish either in the forum...
    BR
    Edwin

    Is this something we can get help with from one of the codesys devs? I am trying to modify this library and it is complicated, probably out of reach for most of the people on this forum. My progress so far consists of changing all the loops from 0-31, to 0-39, but I still only get 0-31 on the gpio mapping screen. Best I can tell is that the library is filtering out some of the pins based on what type they are, but there are close to 30 files in this library and its just tough to tell where the problem is.

    I have attached my modified devdesc.xml if anyone wants it, but its really no good without the corresponding library.

    GPIOsBplus.devdesc.xml [15.41 KiB]

     
  • eschwellinger

    eschwellinger - 2016-10-05

    Hi,

    next step is to add these changes to
    "c:\Users\<yourwindowsusername>llinger\CODESYS Control for Raspberry PI\3.5.9.x\Libraries\IoDrvGPIO.library"
    for working with libraries and Testproject read this here:
    l viewtopic.php?f=22&t=5641&p=10677#p10677 l
    Work with two instances of CODESYS - one opens the library the other one your testproject to check the GPIOS.</yourwindowsusername>

    You could debug it by Setting brakepoint into the library and step in (sure in the testproject instance)
    As a first try just search for the for loops and increase them to your io size --
    Hope this helps.

    BR
    Edwin

    IMG: lib.jpg

     
  • allen00se - 2016-10-07

    Edwin Schwellinger hat geschrieben:
    Hi,
    next step is to add these changes to
    "c:\Users\<yourwindowsusername>llinger\CODESYS Control for Raspberry PI\3.5.9.x\Libraries\IoDrvGPIO.library"
    for working with libraries and Testproject read this here:
    l viewtopic.php?f=22&t=5641&p=10677#p10677 l
    Work with two instances of CODESYS - one opens the library the other one your testproject to check the GPIOS.
    You could debug it by Setting brakepoint into the library and step in (sure in the testproject instance)
    As a first try just search for the for loops and increase them to your io size --
    Hope this helps.
    BR
    Edwin</yourwindowsusername>

    Yes I did that already and never could get it to work. I changed every for loop from 31 to 39 in the whole library and never saw any additional pins show up in the GPIO mapping screen. There must be some other part that is I am missing.

     
  • JonathanG - 2017-10-27

    I am trying it myself and I modified a part of the .library file, but I cant read it properly, with what program do I open it?
    With wordpad most of the text is just gibberish, and the few things which are normal letters give not enough info to do something with it.

     
  • eschwellinger

    eschwellinger - 2017-10-27

    Hi,
    you open a library with CODESYS... one instance of CODESYS opens the projcet to test the library
    the other instance of CODESYS open/work on the library.

    See here the faq - how to work with library:
    l viewtopic.php?f=22&t=5641&p=10677#p10677 l

    BR
    Edwin

     
  • JonathanG - 2017-11-23

    I have all the GPIO now, but I get the error included.
    But in GPio mapping and gpio parameters i have all the gpio.

    IMG: SC6.png

    IMG: SC5.png

    IMG: SC4.png

     
  • SirT - 2019-02-05

    JonathanG hat geschrieben:
    I have all the GPIO now, but I get the error included.
    But in GPio mapping and gpio parameters i have all the gpio.

    Hello. Can you post the files?

     
  • sscreve - 2021-09-17

    Hello JonathanG

    have you find any solution?
    i need to use GPIO35-42 as output but I can't modify the library.
    Thanks!

     

Log in to post a comment.