CV1 = 3 returns 255

Peter Hagenaars Apr 3, 2017

  1. Peter Hagenaars

    Peter Hagenaars TrainBoard Member

    18
    19
    8
    Hello,

    My next step in getting to work with dcc++ is trying to find out how programming engine decoders works.

    I have an engine decoder which address is 3 (CV1).
    With the command: <t 1 3 10 1> the train moves on the main track.
    Command <t 1 3 0 1> and the train stops, <t 1 3 10 0> and it reverses.
    So far so good.

    But reading CV1 from the decoder on the programming track (<R 1 0 0>) returns: <r0 0 1 255> while CV 1 = 3.

    When I put the engine on the programming track I change CV1 from 3 to 4:
    <W 1 4 0 0>. The serial monitor returns: <r0 0 1 4>
    Then I can run the train on the main track with the command <t 1 4 10 1> etc.
    However reading CV1 on the programming track still returns <0 0 1 255>

    I don't understand this. Shouldn't it return <0 0 1 4> in stead of 255?

    This is just with a small address. Should the input for CV1 = 2445 be input for both CV 17 (201) and CV18 (141)?
     
    Scott Eric Catalano likes this.
  2. Atani

    Atani TrainBoard Member

    1,466
    1,736
    37
    It sounds like a failed CV read, which motor board are you using?
     
    Scott Eric Catalano likes this.
  3. Peter Hagenaars

    Peter Hagenaars TrainBoard Member

    18
    19
    8
    Hi,

    I have a L298N L298P 4A Dual Channel Motor Driver Module Motor Shield R3 For Arduino (clone).

    I have done some experimenting and (on my other layout) set CV 1 thru 6 with a specific number. CV7 and 8 are factory set (051 and 129).

    Reading CV 1 - 8 gives me not a single true value from its CV but mostly 255 and sometimes other random numbers. I have done several tries and documented the outcome if there should be a need for.

    With CV1 = 3 I can control the locomotive (<t 1 3 10 1>) and after having succesfully changed CV1 from 3 to 4 I can run the locomotive again (<t 1 4 10 1>). So this works, but not reading the cv's.
     
    Scott Eric Catalano likes this.
  4. Atani

    Atani TrainBoard Member

    1,466
    1,736
    37
    Ok, it sounds like the input sense lines might not be connected or there is a problem with them on that board. Normally these are on A0 (MAIN) and A1 (PROG).
     
    Scott Eric Catalano likes this.
  5. Peter Hagenaars

    Peter Hagenaars TrainBoard Member

    18
    19
    8
    Oké, forgive me my ignorence but how does that help me?
    I can succesfully change CV values, but reading them is the problem.
    So it means my Motor Shield is not good? And how can I check that?
     
    Scott Eric Catalano likes this.
  6. Juan_Nadie

    Juan_Nadie New Member

    1
    1
    1
    Hi. I have the same problem but in my case is that my shield is chinese cheap version of ardumoto that doesnt send current signal to arduino. Decoder sends information to base-station by consuming current. If your base-station doesnt detect consumed current cant read the decoder.
    When you turn on your controler current monitor shows realistic value?
    check if A0 and A1 pins tracks are cuted in the shield (see image).
     

    Attached Files:

    Scott Eric Catalano likes this.

Share This Page