Sunday, September 1, 2019

SVLocoIO firmware for Arduino updated

A new functionality has been released for SVLocoIO firmware. This is the Arduino program we use for all I/O Loconet modules. This means, it is the main Arduino software to manage sensors and outputs (street lights, layout illumination, ...).

It was missing a functionality that other boards do, which is to inform about the state of the inputs (sensors) at power on. When the command station is turned on, or the power on button of your software like Rocrail or iTrain is pressed, the module will send the current state of those ports configured as input.

With a bit more of technical detail, when a OPC_GPON command is sent throuth Loconet, the board responds a OPC_INPUT_REP message for each configured input.

If you want to deactivate this functionality, delete or comment the line in the top of the code:

#define INFORMATPOWERON

I also corrected some errors when calculating the input number of a pin. It was affecting to the debug mode making the input numbers to be printed wrong. With this correction the maximum input number has been increased to 2048.

You can download it from: https://github.com/ClubNCaldes/SVLocoIO

NOTE:
If you use this firmware with GCA185 Loconet shield board, remember you don't need the pulldown resistors of the board as the program uses the Arduino internal pullup resistors.


5 comments:

  1. Dear Dani,
    I am late to this project, and just have one question if you don't mind. Are the two pull up resistors the 4.7k ones R5 & 6.
    Rgds,
    Keith Kershaw
    Weatherboard Indoor Railway
    Queensland AU

    ReplyDelete
  2. Hi, which board are you refering to?

    ReplyDelete
    Replies
    1. GCA185, sorry Dani I thought I was leaving the message on a specific thread.

      Delete
  3. Hej Dani,

    thanks for the software, it works nicely. I am trying to learn how Loconet commands work. I wonder about one thing - to me it looks like you only generate OPC_INPUT_REP messages, no OPC_SW_REQ, which the original Jarbour LocoIO does (?) - so, are you controlling Switches/Turnouts with OPC_INPUT_REP or is there some fancy trick that I dont understand?

    ReplyDelete