Results 1 to 7 of 7
  1. #1
    New Member
    Join Date
    Jun 2008
    Location
    France
    Posts
    3
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Bug in Opencockpit IOCARD

    Hello,

    I have located a bug in the IOCARD USB expansion card, and posted it on the Opencockpit forum. However, I have never been really successful on that forum which is not really reactive. So I repost my message here, so maybe the bug may come to the ear of the designer in the end (I don't have his email).
    Just trying to help ...

    Here is my post :

    Hello All

    I have had a problem that inputs are not properly detected at startup. As far as I can analyze, it comes from the code inside the PIC 16C745 on the USB card.

    As an example, I have two master cards and the following inputs ON at startup :

    05-17-23-32-42-53-69-78-86-107-113-132-143.

    here is what SIOC or Controlador see at startup :
    05-17-23-32-42-44-69-78-86-113-132

    NOW, this is info for the card designers :

    I analyzed the packets sent by the USB expansion card to the PC at startup to describe the inputs activated :

    03 BF DB 20 00 20 20 40
    80 00 40 40 20 00 20 40
    80 00 12 00 .......

    As you can see, all is correct except the 12 00 sequence which corresponds to the 9th inputs of all groups on the 2 cards, and is not correct ! The correct values should be 44 11
    The PIC chip incorrectly read the 9th inputs of each group (inputs 08 - 17 - 26 - 35 - 44 - 53 - 62 - 71 - 80 - 89 - 98 - 107 - 116 - 125 - 134 - 143 - ... etc ...)

    at startup.


    Controlador correctly displays what is reported by the PIC chip, so there's no problem with him.

    Please use this info for debugging the PIC 16C745 program

    Best regards

    Oliver

  2. Thanks MortenHa thanked for this post
  3. #2
    500+ This must be a daytime job



    Join Date
    Jan 2007
    Location
    NEW ZEALAND
    Posts
    899
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    hello Oliver,
    Suggest you goto O/C site.home page and hit Contact US.Report a technical problem here.I too have tried the main Forums and generally had no luck.However using this option ive had VERY good and quick response.
    Good luck and thanks for reporting.
    Les

  4. #3
    150+ Forum Groupie pdpo's Avatar
    Join Date
    Nov 2005
    Location
    belgium
    Posts
    260
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Hi there,

    this problem is known to OC people.
    Beware that the behavior changes when connecting the third/fourth mastercard to the
    usb expansion card.
    There was some other post but cant remember if it was on this forum. Someone actually
    cut the power to the mastercard via a relay when SIOC started up and then the initial
    values are Ok.

    greetings Peter

  5. #4
    New Member
    Join Date
    Jun 2008
    Location
    France
    Posts
    3
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Hi les,

    Thanks for the tip. I did that, and I'm waiting to see if I get an answer.

    Hi Peter,

    I have read the thread you mention before actually researching the nature of the problem. It was not clear then, in this post that the bug came from the USB card microcode. It is not related to connecting the 4th card. You get it when you have more than one card.
    The trick with the relay is that you get a wrong report from the USB card at the startup, then you reset all entries on the MC cards, and then the USB will notice the change after the reset of the inputs and report their correct state.
    This is a way around the bug, but not solving it.

    cheers

    Oliver

  6. #5
    150+ Forum Groupie pdpo's Avatar
    Join Date
    Nov 2005
    Location
    belgium
    Posts
    260
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    HI Oliver,

    You are right, its a workaround for the case you really need to get it solved for your application.
    If not there are many ways to deal with this problem. Until it gets solved by OC people following actions can be taken.
    -> define a var at the beginning of SIOC script and set it to one. let the last var in your
    script reset this first var (some kind of var keeping the initialising state). suppress any
    action from those wrong inputs during init of the script.

    -> dont use those 9th inputs for switches but only for momentary buttons. Those are 0 anyway during init

    what I meant with the dependency of the third card : when you use 3 mastercards or 4 then the initial state of those 9th inputs upon start would be 1 iso 0.

    Greetz Peter

  7. #6
    75+ Posting Member MortenHa's Avatar
    Join Date
    Apr 2007
    Location
    Norway, Vard
    Posts
    77
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Quote Originally Posted by oliver_mpt View Post
    Hello,
    I analyzed the packets sent by the USB expansion card to the PC at startup to describe the inputs activated :

    03 BF DB 20 00 20 20 40
    80 00 40 40 20 00 20 40
    80 00 12 00 .......

    As you can see, all is correct except the 12 00 sequence which corresponds to the 9th inputs of all groups on the 2 cards, and is not correct ! The correct values should be 44 11
    The PIC chip incorrectly read the 9th inputs of each group (inputs 08 - 17 - 26 - 35 - 44 - 53 - 62 - 71 - 80 - 89 - 98 - 107 - 116 - 125 - 134 - 143 - ... etc ...)

    at startup.
    Best regards

    Oliver
    Hi Oliver!

    What utilities did you use to extract USB data ? And where can I find reference on the USB data structures?

    It seem that we have a problem with some USB ports shutting down when too many are connected. I want to learn how to debug problems like this.

    Thanx

  8. #7
    New Member
    Join Date
    Jun 2008
    Location
    France
    Posts
    3
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Hi Morten,

    I use HHD Device Montoring Studio, the lite edition.

    It's handy

    Oliver

Similar Threads

  1. OC IOCard, what's the secret ?
    By Wendy in forum I/O Interfacing and Hardware
    Replies: 52
    Last Post: 12-04-2010, 10:49 AM
  2. USBout card and iocard.exe
    By mmakela in forum OpenCockpits General Discussion
    Replies: 2
    Last Post: 07-05-2008, 01:56 PM
  3. Overhead Sync & IOCARD
    By excalibur67 in forum PMSystems
    Replies: 10
    Last Post: 03-12-2007, 12:26 PM
  4. Rotary switches to Iocard Master Card
    By Jouni in forum I/O Interfacing Hardware and Software
    Replies: 3
    Last Post: 10-15-2006, 08:10 AM