ARMstoneA9r2 GPIO on Port0 + WEC7

  • Hello,

    we are using WEC7 on ARMstoneA9r2 (A9r2) and trying to use GPIO port0 as we do before on NEtDCU14 without problems.

    we have some questions now, because seems its not working as expected on A9r2:


    1) Which exact pins are corresponding to GPIO port 0 on A9r2: pins from 3 to 10 of the 66 pins feature connector ?


    2) We try to configure 4 pins In and 4 pins Out altenatively, so on WCE register we set:

    reg open \Drivers\BuiltIn\DIGITALIO

    reg set value Port dword 0

    reg set value DataInit dword 0

    reg set value DataDir dword 170

    reg set value UseAsIO dword 255


    But we are only able to write on 3 of the 4 Outpins with a program we make long time ago for NetDCU14 ...

    This pins are: 3, 5, 7 works ok, but pin 9 is not working...

    And on the other hand, we dont read 3.3V (pullup) on any of the Input pins configured: pins 4, 6, 8 and 10 of feature connector ... to my undestanding...


    Is something wrong or missing ??

  • Hello,


    we changed notation for DIO, refer DeviceDriverDoc, because newer boards may have much more IOs than 32. You can still use "dword" notation but with suffix (UseAsIOA (port 0...3), UseAsIOB (port 4...7), ...)


    1) Which exact pins are corresponding to GPIO port 0 on A9r2: pins from 3 to 10 of the 66 pins feature connector ?

    Pin 3...7 belongs to port0

    Pin 8...10 belongs to port1


    2) We try to configure 4 pins In and 4 pins Out altenatively, so on WCE register we set

    reg open \drivers\builtin\digitalio

    reg set value UseAsIO hex 0xf8,0x07,<port2>,...,port<n>

    reg set value DataDir hex 0xA8,0x02,<port2>,...,port<n>

    reg save

    REM


    Hope this helps.


    PS: switch off unused SPIs because they may use the same pins:

    reg open \drivers\builtin\armStoneA9R2\spi2

    reg set value Flags dword 4

    reg open \drivers\builtin\armStoneA9R2\spi3

    reg set value Flags dword 4

    reg save

    REM

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hello, with your code I have one more doubt... using


    reg set value UseAsIO hex 0xf8,0x07,<port2>

    reg set value DataDir hex 0xA8,0x02,<port2>

    Which pins are you configuring ? from 16 to 23 ?? (port2 acording to DriverDoc).


    For using exactly same pins as we used before (3-7 from port 0 and 8-10 from port1) is this correct ??


    reg open \drivers\builtin\digitalio

    reg set value UseAsIO hex 0x18,0x07,<port0>

    reg set value DataDir hex 0x02,0x05,<port0>

    reg set value UseAsIO hex 0xE0,0x00,<port1>

    reg set value DataDir hex 0xA0,0x00,<port1>

    reg save


    Thanks.

  • Hello,


    please tell me what are your doubts? <port2> is just a placeholder if you would like to continue to configure futher ports. Else skip it. I better had wrote "reg set value UseAsIO hex 0xf8,0x07,<port2>, ..., <portN>". But I thought it was clear in context with Device Driver Doc. (one byte one port)! Sorry.


    Code
    1. Port 0
    2. Pin 0 1 2 3 4 5 6 7 on 66 pol. feature connector
    3. - 3.3V 5.0V GPIO GPIO GPIO GPIO GPIO -> you want to use pin 3-7 so bit 3-7 is to set -> 0xf8

    analog for port 1!

    So if you just use port 0 and 1 set "reg set value UseAsIO hex 0xf8,0x07"


    Did you test my settings above at all?

    Are you detect any issues with our SW?

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hello,

    thank you for clarification .. it seems simplier than I thought...

    But now on WinCE register in

    \drivers\builtin\ digitalio\

    we use key "Port" with value 0 .. so I can only read in my program 5 bits corresponding to this port 0.


    What we have to do on register for reading 3 aditional bits from Port1 now configured ??? (on older NetDCU14 all 8 bits we used belongs to Port0)


  • Hello,


    great if everything about configuration is clear now.


    You can use "SetFilePointer" to jump from port to port *or* you can use DeviceIoControl(..., IOCTL_DIO_GET/SET/CLR_PIN, ...) to address one single IO by one single call.


    You will find sample code here: DeviceDriverDoc.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

    Edited once, last by fs-support_ZU ().