Results 1 to 6 of 6
  1. #1
    500+ This must be a daytime job Jim NZ's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    763
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Arduino 1+ and the SERIAL PORT.

    You will notice that most of my Arduino stuff has been updated to work on the new Arduino IDE v1 and 1.1
    All the updated PDE’s will work on IDE’s 0022, 0023, 1 and 1.1 with no modification.

    All went well until I tried to convert my own (rather long) PDE’s that read a huge number of extractions from FSX.
    It worked fine on any “changing” item (tuning a radio etc) but when the REFRESH burst came thru it really messed things up.
    It only got the first 12 or so items and then it all went to garbage.
    This didn’t happen with version 0022.
    On fiddling with this for a while to try to find the problem ,,, I decided the serial receive buffer wasn’t big enough.
    Searched the net ,, problem confirmed ,, various fix’s out there.

    What the Arduino boys had done was cut the serial buffer down in size with the “upgrade” to version 1 ,, that may suit guys that wanted extra memory in the Arduino for complex programs but it didn’t suit us that are basically using the Arduino as a simple serial interface with a lot of serial data flowing.

    THE FIX ,,,,
    It’s an easy fix ,, This is what to do to fix it in Version 1 or version 1.1 ,,,,,

    There are declarations for the serial buffer size in a file called “HardwareSerial.cpp”.
    You will find it here ,,,
    Main Arduino dir/Hardware/Arduino/Cores/Arduino and find the file “HardwareSerial.cpp”.

    image003.jpg


    Open “HardwareSerial.cpp” with WORDPAD. (Not notepad)
    Just after the “includes”, you will see ,,,,

    #if (RAMEND < 1000)
    #define SERIAL_BUFFER_SIZE 16
    #else
    #define SERIAL_BUFFER_SIZE 64
    #endif

    Change the 16 to 32 and the 64 to 128 to look like this ,,,

    #if (RAMEND < 1000)
    #define SERIAL_BUFFER_SIZE 32
    #else
    #define SERIAL_BUFFER_SIZE 128
    #endif

    Then hit save. Your done ,,, problem fixed. (Well it did on mine at any rate)

    If you have huge extractions going on and an involved PDE, you can up it even further to 64 and 256 if you still have problems.
    I tested mine at this and it worked fine.
    The original IDE version 0022 used 32 and 128 for those settings.

    With stuff like this ,, it makes one wonder as to the benefits?? of “up-grading” !!!!!

    Cheers ,,,, Jim
    Last edited by Jim NZ; 08-25-2012 at 03:48 AM.
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

  2. Thanks Nelson Icibaci Filho, skino, WJH308 thanked for this post
    Likes hms2178 liked this post
  3. #2
    150+ Forum Groupie WJH308's Avatar
    Join Date
    Aug 2008
    Location
    San Francisco, CA
    Posts
    159
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino 1+ and the SERIAL PORT.

    Thanks for the fix!
    Haven't had an issue with this, for what we use the Arduino and the serial buffer for is a bit extreme compared to the mainstream users who don't use such a large serial stream.

  4. #3
    10+ Posting Member
    Join Date
    Mar 2014
    Location
    Israel
    Posts
    14
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Mycockpit.org Re: Arduino moving seat

    Hi Jim.
    I am a newcomer to FSX and I built a 2 DOF moving seat platform with 2 wiper motors, Monster driver , Arduino Uno and your Link2FS program together with the SparkFun sketch.
    The data from FSX to Link2FS and to Arduino goes smooth.(via port 1 and 14).
    The monster LEDS are on, however motors are not moving.
    Just FYI, I checked several programs and yourswas the only one without bugs, and very user friendly. Well done!!!
    could you Pls. give me a few tips how to proceed.
    Regards
    Dovale









    Quote Originally Posted by Jim NZ View Post
    You will notice that most of my Arduino stuff has been updated to work on the new Arduino IDE v1 and 1.1
    All the updated PDE’s will work on IDE’s 0022, 0023, 1 and 1.1 with no modification.

    All went well until I tried to convert my own (rather long) PDE’s that read a huge number of extractions from FSX.
    It worked fine on any “changing” item (tuning a radio etc) but when the REFRESH burst came thru it really messed things up.
    It only got the first 12 or so items and then it all went to garbage.
    This didn’t happen with version 0022.
    On fiddling with this for a while to try to find the problem ,,, I decided the serial receive buffer wasn’t big enough.
    Searched the net ,, problem confirmed ,, various fix’s out there.

    What the Arduino boys had done was cut the serial buffer down in size with the “upgrade” to version 1 ,, that may suit guys that wanted extra memory in the Arduino for complex programs but it didn’t suit us that are basically using the Arduino as a simple serial interface with a lot of serial data flowing.

    THE FIX ,,,,
    It’s an easy fix ,, This is what to do to fix it in Version 1 or version 1.1 ,,,,,

    There are declarations for the serial buffer size in a file called “HardwareSerial.cpp”.
    You will find it here ,,,
    Main Arduino dir/Hardware/Arduino/Cores/Arduino and find the file “HardwareSerial.cpp”.

    image003.jpg


    Open “HardwareSerial.cpp” with WORDPAD. (Not notepad)
    Just after the “includes”, you will see ,,,,

    #if (RAMEND < 1000)
    #define SERIAL_BUFFER_SIZE 16
    #else
    #define SERIAL_BUFFER_SIZE 64
    #endif

    Change the 16 to 32 and the 64 to 128 to look like this ,,,

    #if (RAMEND < 1000)
    #define SERIAL_BUFFER_SIZE 32
    #else
    #define SERIAL_BUFFER_SIZE 128
    #endif

    Then hit save. Your done ,,, problem fixed. (Well it did on mine at any rate)

    If you have huge extractions going on and an involved PDE, you can up it even further to 64 and 256 if you still have problems.
    I tested mine at this and it worked fine.
    The original IDE version 0022 used 32 and 128 for those settings.

    With stuff like this ,, it makes one wonder as to the benefits?? of “up-grading” !!!!!

    Cheers ,,,, Jim

  5. #4
    10+ Posting Member
    Join Date
    Mar 2014
    Location
    Israel
    Posts
    14
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino moving seat

    Jim,

    I wrote to you a couple of weeks ago but no reply. I hope you are well.
    Are you familiar with the SparkFun MonsterMoto driver and Arduino.
    If yes, does the sketch identifies the serial data of SFX sent via Link2FS?

    Regards
    Dovale

  6. #5
    Our new friend needs to reach 10 posts to get to the next flight level



    Join Date
    Dec 2015
    Location
    UK
    Posts
    7
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino 1+ and the SERIAL PORT.

    Dear Jim,


    The reasons for writing to you with this message are, firstly to congratulate and thank you on behalf of all of us simmers for having bridged the gap between hardware and our simulator with your software/s.

    Second, a puzzling task of mine might attract your attention for a few minutes and perhaps reward me with your comment about it.

    A) Touch-screen
    B) Migration from FSX to P3D

    These are the key factors that created the need for an external software to resolve the problem (I think).

    In fact while in FSX I could use my conveniently overhead mounted touch-screen with the default Win “touch gestures” in order to operate the PMDG Overhead Panel functions, this is no longer the case since P3D is my new Sim and only the left touch-screen click works now, having lost the use of all clockwise rotary elements.

    Having had no useful response from either PMDG nor L. Martin, I seem to be left alone to resolve this problem.
    Since I am beginning to put together a new cockpit based around Arduino and your software, here is the question:

    What can be done to bypass the obvious changes made by P3D which are preventing any touch screen from behaving normally within the sim?

    Does your software have the tools needed for such a task ?


    Once again thanks for sharing all your work with us and please accept our small but continuing donations that hopefully will help to support your page for future developments.


    Kind Regards


    Mauro Andreini


    PS) Happy New Year

  7. #6
    New Member
    Join Date
    Dec 2016
    Location
    Americana São Paulo
    Posts
    4
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino 1+ and the SERIAL PORT.

    Boa Noite!

    Caro Jim

    Estou com dificuldades para acender leds externos quando ativo piloto automatico, Hdg, Nav, Alt, gostaria de saber se pode me dar uma dica ou um programa , para que eu possa acender alguns Leds no painel do meu fsx que montei assim saberei se o AP esta ativo, assim como o HDG, NAV, APP.
    Ficaria muito grato, estou usando seu programa multi radios.

    Parabéns pelo seu trabalho.
    Ah Caro Jim, gostaria de fazer doações para seu site mas não consigo, e meu cartão não é aceito , teria como saber uma forma mais fácil para esta questão.

    Abraços Jim.