1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-29 02:13:45 +02:00

Compare commits

...

48 Commits

Author SHA1 Message Date
Harald Barth
3f57c1210d turn off signal pin during cutout as that might switch some H-bridges between high and low side 2022-05-17 08:06:10 +02:00
Harald Barth
c9195f8035 invert Railcom pulse if brake is inverted 2022-05-15 01:44:37 +02:00
Harald Barth
7fc5c48efa remove not needed goto and volatile 2022-05-15 01:38:28 +02:00
Harald Barth
c245c27f5d Repair railcom prototype to get signal on main and prog 2022-05-14 00:49:39 +02:00
Asbelos
67adf1e6c6 Merge branch 'master' into RailCon 2021-05-20 12:02:02 +01:00
Asbelos
8e71dd8926 Teensy double speed interrupt 2021-05-16 21:00:34 +01:00
Fred
ac37228942 Committing a SHA 2021-05-16 02:13:48 +00:00
Fred
90487d2d83 Update release_notes_v3.1.0.md 2021-05-15 22:13:33 -04:00
Fred
1807fe5c5f Committing a SHA 2021-05-16 02:12:24 +00:00
Fred
6abb65c1f4 Update release_notes.md
Sync release_notes.md with release notes on release page
2021-05-15 22:12:09 -04:00
Fred
971732fce8 Committing a SHA 2021-05-16 01:51:24 +00:00
Fred
8a03b889a3 Update release_notes.md 2021-05-15 21:51:10 -04:00
Fred
e12c3fc295 Committing a SHA 2021-05-16 01:45:54 +00:00
Fred
de8f9396f7 Update release_notes.md 2021-05-15 21:45:39 -04:00
Fred
f75a6b47f9 Committing a SHA 2021-05-16 01:37:47 +00:00
Fred
bc1398d3c4 Update README.md 2021-05-15 21:37:33 -04:00
Fred
0988340ff8 Committing a SHA 2021-05-16 01:36:41 +00:00
Fred
c7af43c70b Update README.md
Add 3.1 features
2021-05-15 21:36:21 -04:00
Dex's Lab
79a76e95b6 Committing a SHA 2021-05-15 04:20:02 +00:00
Dex's Lab
6766d95344 mend 2021-05-15 00:19:41 -04:00
Fred
fb3265a413 Committing a SHA 2021-05-15 04:04:22 +00:00
Fred
93fc674e74 Update release_notes.md 2021-05-15 00:04:07 -04:00
Fred
ebfde7cc81 Committing a SHA 2021-05-15 03:49:17 +00:00
Fred
4a2513d576 Update version.h 2021-05-14 23:49:04 -04:00
Fred
a01d36c8e5 Committing a SHA 2021-05-15 03:43:28 +00:00
Fred
4583761d03 Update version.h 2021-05-14 23:43:11 -04:00
Fred
45a7efc935 Committing a SHA 2021-05-14 22:44:05 +00:00
Fred
d924916381 Update release_notes_v3.1.0.md 2021-05-14 18:43:48 -04:00
Fred
9ec4f2d62a Committing a SHA 2021-05-14 22:19:25 +00:00
Fred
58d4618868 Update release_notes.md 2021-05-14 18:19:07 -04:00
Fred
9fdd251a7b Committing a SHA 2021-05-14 17:34:12 +00:00
Fred
5984abe133 Update release_notes.md 2021-05-14 13:33:56 -04:00
Fred
87cc8afdf9 Committing a SHA 2021-05-14 17:30:01 +00:00
Fred
7cef3dad2e Update release_notes.md 2021-05-14 13:29:45 -04:00
Asbelos
955362a033 Merge branch 'master' into RailCon 2021-05-14 13:32:57 +01:00
Asbelos
4391b049d8 tidying, join and cmd 2021-05-14 13:32:20 +01:00
Fred
7a68b0106d Committing a SHA 2021-05-14 00:29:09 +00:00
Fred
ea85a33e03 Update release_notes.md 2021-05-13 20:28:54 -04:00
Fred
05da109144 Committing a SHA 2021-05-13 23:56:48 +00:00
Fred
38b5c0cae2 Update version.h 2021-05-13 19:56:32 -04:00
Asbelos
7e58165db9 First working 2021-05-11 16:33:12 +01:00
Asbelos
945af43500 Not working 2021-05-11 15:09:44 +01:00
Asbelos
1b1d8fceb4 Committing a SHA 2021-05-11 12:35:11 +00:00
Asbelos
bb63a559ad Merge branch 'master' of https://github.com/DCC-EX/CommandStation-EX 2021-05-11 13:33:57 +01:00
Asbelos
fafaa7a1e1 Remove cv1 bit 7 test in <R> cmd 2021-05-11 13:32:13 +01:00
Harald Barth
bce5acc8d0 Committing a SHA 2021-05-09 18:04:56 +00:00
Harald Barth
b3d02350f2 only send function commands once, not 4 times 2021-05-09 20:04:16 +02:00
Asbelos
7b2647ad81 Committing a SHA 2021-05-07 17:24:58 +00:00
15 changed files with 442 additions and 133 deletions

1
.gitignore vendored
View File

@@ -9,3 +9,4 @@ Release/*
config.h
.vscode/extensions.json
mySetup.h
myFilter.cpp

View File

@@ -126,7 +126,7 @@ void DCC::setFunctionInternal(int cab, byte byte1, byte byte2) {
if (byte1!=0) b[nB++] = byte1;
b[nB++] = byte2;
DCCWaveform::mainTrack.schedulePacket(b, nB, 3); // send packet 3 times
DCCWaveform::mainTrack.schedulePacket(b, nB, 0);
}
uint8_t DCC::getThrottleSpeed(int cab) {
@@ -398,10 +398,6 @@ const ackOp FLASH READ_CV_PROG[] = {
const ackOp FLASH LOCO_ID_PROG[] = {
BASELINE,
SETCV, (ackOp)1,
SETBIT, (ackOp)7,
V0,WACK,NAKFAIL, // test CV 1 bit 7 is a zero... NAK means no loco found
SETCV, (ackOp)19, // CV 19 is consist setting
SETBYTE, (ackOp)0,
VB, WACK, ITSKIP, // ignore consist if cv19 is zero (no consist)

View File

@@ -32,7 +32,7 @@
#include "DIAG.h"
#include <avr/wdt.h>
// These keywords are used in the <1> command. The number is what you get if you use the keyword as a parameter.
// These keywords are used in various commands. The number is what you get if you use the keyword as a parameter.
// To discover new keyword numbers , use the <$ YOURKEYWORD> command
const int16_t HASH_KEYWORD_PROG = -29718;
const int16_t HASH_KEYWORD_MAIN = 11339;
@@ -56,6 +56,7 @@ const int16_t HASH_KEYWORD_LCN = 15137;
const int16_t HASH_KEYWORD_RESET = 26133;
const int16_t HASH_KEYWORD_SPEED28 = -17064;
const int16_t HASH_KEYWORD_SPEED128 = 25816;
const int16_t HASH_KEYWORD_RAILCOM = -29097;
int16_t DCCEXParser::stashP[MAX_COMMAND_PARAMS];
bool DCCEXParser::stashBusy;
@@ -776,6 +777,9 @@ bool DCCEXParser::parseD(Print *stream, int16_t params, int16_t p[])
Diag::LCN = onOff;
return true;
case HASH_KEYWORD_RAILCOM: // <D RAILCOM ON/OFF>
return DCCWaveform::setUseRailcom(onOff);
case HASH_KEYWORD_PROGBOOST:
DCC::setProgTrackBoost(true);
return true;

View File

@@ -75,6 +75,11 @@ INTERRUPT_CALLBACK interruptHandler=0;
(void) pin;
return false; // TODO what are the relevant pins?
}
bool DCCTimer::isPWMPin(byte pin) {
(void) pin;
return false; // TODO what are the relevant pins?
}
void DCCTimer::setPWM(byte pin, bool high) {
(void) pin;
@@ -90,24 +95,65 @@ INTERRUPT_CALLBACK interruptHandler=0;
#elif defined(TEENSYDUINO)
IntervalTimer myDCCTimer;
bool interruptFlipflop=false;
byte railcomPin[2]={0,0];
enum RAILCOM_NEXT:byte {SKIP,CUT_OUT,CUT_IN);
RAILCOM_NEXT railcom1Next[]={SKIP,SKIP};
void DCCTimer::begin(INTERRUPT_CALLBACK callback) {
interruptHandler=callback;
myDCCTimer.begin(interruptHandler, DCC_SIGNAL_TIME);
myDCCTimer.begin(interruptFast, DCC_SIGNAL_TIME/2);
}
// This interrupt happens every 29uS, and alternately calls the DCC waveform
// or handles any pending Railcom cutout pins.
void interruptFast() {
nterruptFlipflop=!interruptFlipflop;
if (interruptFiliflop) {
interruptHandler();
return;
}
// Railcom interrupt, half way between DCC interruots
for (byte channel=0;channel<2;channel++) {
byte pin=railcomPin[channel;
if (pin) {
switch (railcomNext[channel]) {
case CUT_OUT:
digitalWrite(pin,HIGH);
break;
case CUT_IN:
digitalWrite(pin,HIGH);
break;
case IGNORE: break;
}
railcomNext[channel]=IGNORE;
}
}
}
bool DCCTimer::isPWMPin(byte pin) {
//Teensy: digitalPinHasPWM, todo
(void) pin;
return false; // TODO what are the relevant pins?
return true; // We are so fast we can pretend we do support this
}
bool DCCTimer::isRailcomPin(byte pin) {
(void) pin;
if (railcomPin[0]==0) railcomPin[0]=pin;
else if (railcomPin[1]==0) railcomPin[1]=pin;
else return false;
return true; // We are so fast we can pretend we do support this
}
void DCCTimer::setPWM(byte pin, bool high) {
// TODO what are the relevant pins?
(void) pin;
(void) high;
// setting pwm on a railcom pin is deferred to the next railcom interruyupt.
for (byte channel=0;channel<2;channel++) {
if (pin==railcomPin[channel]) {
railcomNext[channel]=high?CUT_OUT:CUT_IN;
return;
}
}
digitalWrite(pin,high?HIGH:LOW);
}
void DCCTimer::getSimulatedMacAddress(byte mac[6]) {
@@ -152,7 +198,11 @@ void DCCTimer::read(uint8_t word, uint8_t *mac, uint8_t offset) {
#define TIMER1_A_PIN 11
#define TIMER1_B_PIN 12
#define TIMER1_C_PIN 13
#else
//railcom timer facility
#define TIMER4_A_PIN 6
#define TIMER4_B_PIN 7
#define TIMER4_C_PIN 8
#else
#define TIMER1_A_PIN 9
#define TIMER1_B_PIN 10
#endif
@@ -163,9 +213,28 @@ void DCCTimer::read(uint8_t word, uint8_t *mac, uint8_t offset) {
ADCSRA = (ADCSRA & 0b11111000) | 0b00000100; // speed up analogRead sample time
TCCR1A = 0;
ICR1 = CLOCK_CYCLES;
TCNT1 = 0;
TCCR1B = _BV(WGM13) | _BV(CS10); // Mode 8, clock select 1
TIMSK1 = _BV(TOIE1); // Enable Software interrupt
TCNT1 = 0;
#if defined(TIMER4_A_PIN)
//railcom timer facility
TCCR4A = 0;
ICR4 = CLOCK_CYCLES;
TCCR4B = _BV(WGM43) | _BV(CS40); // Mode 8, clock select 1
TIMSK4 = 0; // Disable Software interrupt
delayMicroseconds(DCC_SIGNAL_TIME/2);
TCNT4 = 0; // this timer fires half cycle after Timer 1 (no idea why /4 !)
#endif
// turn on PWM for the pins here (instead of in setPWM())
// only needed if RailCom is inactive as otherwise RailCom
// takes care of that. Does not hurt tough
onoffPWM(TIMER1_A_PIN, true);
onoffPWM(TIMER1_B_PIN, true);
#ifdef TIMER1_C_PIN
onoffPWM(TIMER1_C_PIN, true);
#endif
interrupts();
}
@@ -181,20 +250,64 @@ void DCCTimer::read(uint8_t word, uint8_t *mac, uint8_t offset) {
#endif
;
}
// Alternative pin manipulation via PWM control.
bool DCCTimer::isRailcomPin(byte pin) {
return
#ifdef TIMER4_A_PIN
pin==TIMER4_A_PIN ||
pin==TIMER4_B_PIN ||
pin==TIMER4_C_PIN ||
#endif
false;
}
void DCCTimer::setPWM(byte pin, bool high) {
if (pin==TIMER1_A_PIN) {
void DCCTimer::onoffPWM(byte pin, bool on) {
if (pin==TIMER1_A_PIN) {
if (on)
TCCR1A |= _BV(COM1A1);
OCR1A= high?1024:0;
else
TCCR1A &= ~(_BV(COM1A1));
}
else if (pin==TIMER1_B_PIN) {
if (on)
TCCR1A |= _BV(COM1B1);
else
TCCR1A &= ~(_BV(COM1B1));
}
#ifdef TIMER1_C_PIN
else if (pin==TIMER1_C_PIN) {
if (on)
TCCR1A |= _BV(COM1C1);
else
TCCR1A &= ~(_BV(COM1C1));
}
#endif
}
void DCCTimer::setPWM(byte pin, bool high) {
uint16_t val=high?1024:0;
if (pin==TIMER1_A_PIN) {
OCR1A= val;
}
else if (pin==TIMER1_B_PIN) {
TCCR1A |= _BV(COM1B1);
OCR1B= high?1024:0;
OCR1B= val;
}
#ifdef TIMER1_C_PIN
else if (pin==TIMER1_C_PIN) {
TCCR1A |= _BV(COM1C1);
OCR1C= high?1024:0;
OCR1C= val;
}
#endif
#ifdef TIMER4_A_PIN
else if (pin==TIMER4_A_PIN) {
TCCR4A |= _BV(COM4A1);
OCR4A= val;
}
else if (pin==TIMER4_B_PIN) {
TCCR4A |= _BV(COM4B1);
OCR4B= val;
}
else if (pin==TIMER4_C_PIN) {
TCCR4A |= _BV(COM4C1);
OCR4C= val;
}
#endif
}

View File

@@ -9,7 +9,9 @@ class DCCTimer {
static void begin(INTERRUPT_CALLBACK interrupt);
static void getSimulatedMacAddress(byte mac[6]);
static bool isPWMPin(byte pin);
static bool isRailcomPin(byte pin);
static void setPWM(byte pin, bool high);
static void onoffPWM(byte pin, bool on);
#if (defined(TEENSYDUINO) && !defined(__IMXRT1062__))
static void read_mac(byte mac[6]);
static void read(uint8_t word, uint8_t *mac, uint8_t offset);

View File

@@ -28,6 +28,8 @@
DCCWaveform DCCWaveform::mainTrack(PREAMBLE_BITS_MAIN, true);
DCCWaveform DCCWaveform::progTrack(PREAMBLE_BITS_PROG, false);
bool DCCWaveform::useRailcom=false;
bool DCCWaveform::supportsRailcom=false;
bool DCCWaveform::progTrackSyncMain=false;
bool DCCWaveform::progTrackBoosted=false;
int DCCWaveform::progTripValue=0;
@@ -46,8 +48,16 @@ void DCCWaveform::begin(MotorDriver * mainDriver, MotorDriver * progDriver) {
&& (mainDriver->getFaultPin() != UNUSED_PIN));
// Only use PWM if both pins are PWM capable. Otherwise JOIN does not work
MotorDriver::usePWM= mainDriver->isPWMCapable() && progDriver->isPWMCapable();
if (MotorDriver::usePWM)
supportsRailcom= MotorDriver::usePWM && mainDriver->isRailcomCapable() && progDriver->isRailcomCapable();
// supportsRailcom depends on hardware caopability
// useRailcom is user switchable at run time.
useRailcom=supportsRailcom;
if (MotorDriver::usePWM){
DIAG(F("Signal pin config: high accuracy waveform"));
if (supportsRailcom) DIAG(F("Railcom cutout enabled"));
}
else
DIAG(F("Signal pin config: normal accuracy waveform"));
DCCTimer::begin(DCCWaveform::interruptHandler);
@@ -73,8 +83,16 @@ void DCCWaveform::interruptHandler() {
progTrack.state=stateTransform[progTrack.state];
// WAVE_START is at start of bit where we need to find
// out if this is an railcom start or stop time
if (useRailcom) {
if (mainTrack.state==WAVE_START) mainTrack.railcom2();
if (progTrack.state==WAVE_START) progTrack.railcom2();
}
// WAVE_PENDING means we dont yet know what the next bit is
if (mainTrack.state==WAVE_PENDING) mainTrack.interrupt2();
// so call interrupt2 to set it
if (mainTrack.state==WAVE_PENDING) mainTrack.interrupt2();
if (progTrack.state==WAVE_PENDING) progTrack.interrupt2();
else if (progTrack.ackPending) progTrack.checkAck();
@@ -116,6 +134,16 @@ void DCCWaveform::setPowerMode(POWERMODE mode) {
motorDriver->setPower( ison);
}
bool DCCWaveform::setUseRailcom(bool on) {
if (!supportsRailcom) return false;
useRailcom=on;
if (!on) {
// turn off any existing cutout
mainTrack.motorDriver->setRailcomCutout(false);
progTrack.motorDriver->setRailcomCutout(false);
}
return true;
}
void DCCWaveform::checkPowerOverload(bool ackManagerActive) {
if (millis() - lastSampleTaken < sampleDelay) return;
@@ -196,7 +224,27 @@ const bool DCCWaveform::signalTransform[]={
/* WAVE_MID_0 -> */ LOW,
/* WAVE_LOW_0 -> */ LOW,
/* WAVE_PENDING (should not happen) -> */ LOW};
void DCCWaveform::railcom2() {
bool cutout;
if (remainingPreambles==(requiredPreambles-2)) {
cutout=true;
} else if (remainingPreambles==(requiredPreambles-6)) {
cutout=false;
} else {
return; // neiter start or end of cutout, do nothing
}
if (isMainTrack) {
if (progTrackSyncMain) // we are main track and synced so we take care of prog track as well
progTrack.motorDriver->setRailcomCutout(cutout);
mainTrack.motorDriver->setRailcomCutout(cutout);
} else {
if (!progTrackSyncMain) // we are prog track and not synced so we take care of ourselves
progTrack.motorDriver->setRailcomCutout(cutout);
}
}
void DCCWaveform::interrupt2() {
// calculate the next bit to be sent:
// set state WAVE_MID_1 for a 1=bit
@@ -205,9 +253,12 @@ void DCCWaveform::interrupt2() {
if (remainingPreambles > 0 ) {
state=WAVE_MID_1; // switch state to trigger LOW on next interrupt
remainingPreambles--;
// Update free memory diagnostic as we don't have anything else to do this time.
// Allow for checkAck and its called functions using 22 bytes more.
updateMinimumFreeMemory(22);
// Don't need to do that more than once per packet
if (remainingPreambles == 3)
updateMinimumFreeMemory(22);
return;
}

View File

@@ -53,10 +53,14 @@ class DCCWaveform {
static void loop(bool ackManagerActive);
static DCCWaveform mainTrack;
static DCCWaveform progTrack;
static bool supportsRailcom;
static bool useRailcom;
void beginTrack();
void setPowerMode(POWERMODE);
POWERMODE getPowerMode();
static bool setUseRailcom(bool on);
void checkPowerOverload(bool ackManagerActive);
inline int get1024Current() {
if (powerMode == POWERMODE::ON)
@@ -118,6 +122,7 @@ class DCCWaveform {
static void interruptHandler();
void interrupt2();
void railcom2();
void checkAck();
bool isMainTrack;

View File

@@ -1 +1 @@
#define GITHUB_SHA "107e9d1"
#define GITHUB_SHA "90487d2"

View File

@@ -84,6 +84,10 @@ bool MotorDriver::isPWMCapable() {
return (!dualSignal) && DCCTimer::isPWMPin(signalPin);
}
bool MotorDriver::isRailcomCapable() {
return (!dualSignal) && DCCTimer::isRailcomPin(brakePin);
}
void MotorDriver::setPower(bool on) {
if (on) {
@@ -110,6 +114,11 @@ void MotorDriver::setBrake(bool on) {
else setLOW(fastBrakePin);
}
void MotorDriver::setRailcomCutout(bool on) {
DCCTimer::onoffPWM(signalPin,!on);
DCCTimer::setPWM(brakePin,on ^ invertBrake);
}
void MotorDriver::setSignal( bool high) {
if (usePWM) {
DCCTimer::setPWM(signalPin,high);

View File

@@ -54,7 +54,9 @@ class MotorDriver {
return rawCurrentTripValue;
}
bool isPWMCapable();
bool isRailcomCapable();
bool canMeasureCurrent();
void setRailcomCutout(bool on);
static bool usePWM;
static bool commonFaultPin; // This is a stupid motor shield which has only a common fault pin for both outputs
inline byte getFaultPin() {

View File

@@ -27,6 +27,11 @@
new MotorDriver(3, 12, UNUSED_PIN, UNUSED_PIN, A0, 2.99, 2000, UNUSED_PIN), \
new MotorDriver(11, 13, UNUSED_PIN, UNUSED_PIN, A1, 2.99, 2000, UNUSED_PIN)
// Arduino standard Motor Shield with railcom (mega brakes on 6,7 require jumpers )
#define STANDARD_WITH_RAILCOM F("STANDARD_WITH_RAILCOM"), \
new MotorDriver(3, 12, UNUSED_PIN, 6, A0, 2.99, 2000, UNUSED_PIN), \
new MotorDriver(11, 13, UNUSED_PIN, 7, A1, 2.99, 2000, UNUSED_PIN)
// Pololu Motor Shield
#define POLOLU_MOTOR_SHIELD F("POLOLU_MOTOR_SHIELD"), \
new MotorDriver( 9, 7, UNUSED_PIN, -4, A0, 18, 3000, 12), \

View File

@@ -12,11 +12,13 @@ Both CommandStation-EX and BaseStation-Classic support much of the NMRA Digital
* simultaneous control of multiple locomotives
* 2-byte and 4-byte locomotive addressing
* 128-step speed throttling
* 28 or 128-step speed throttling
* Activate/de-activate all accessory function addresses 0-2048
* Control of all cab functions F0-F28
* Control of all cab functions F0-F28 and F29-F68
* Main Track: Write configuration variable bytes and set/clear specific configuration variable (CV) bits (aka Programming on Main or POM)
* Programming Track: Same as the main track with the addition of reading configuration variable bytes
* And manu more custom features. see [What's new in CommandStation-EX?](#whats-new-in-commandstation-ex)
# Whats in this Repository?
@@ -38,11 +40,11 @@ in config.h.
## What's new in CommandStation-EX?
* WiThrottle server built in. Connect Engine Driver or WiThrottle clients directly to your Command Station
* WiThrottle server built in. Connect Engine Driver or WiThrottle clients directly to your Command Station (or through JMRI as before)
* WiFi and Ethernet shield support
* No more jumpers or soldering!
* Direct support for all the most popular motor control boards
* I2C Display support
* Direct support for all the most popular motor control boards including single pin (Arduino) or dual pin (IBT_2) type PWM inputs without the need for an adapter circuit
* I2C Display support (LCD and OLED)
* Improved short circuit detection and automatic reset from an overload
* Current reading, sensing and ACK detection settings in milliAmps instead of just pin readings
* Improved adherence to the NMRA DCC specification
@@ -50,6 +52,21 @@ in config.h.
* Railcom cutout (beta)
* Simpler, modular, faster code with an API Library for developers for easy expansion
* New features and functions in JMRI
* Ability to join MAIN and PROG tracks into one MAIN track to run your locos
* "Drive-Away" feature - Throttles with support, like Engine Driver, can allow a loco to be programmed on a usable, electrically isolated programming track and then drive off onto the main track
* Diagnostic commands to test decoders that aren't reading or writing correctly
* Support for Uno, Nano, Mega, Nano Every and Teensy microcontrollers
* User Functions: Filter regular commands (like a turnout or output command) and pass it to your own function or accessory
* Support for LCN (layout control nodes)
* mySetup.h file that acts like an Autoexec.Bat command to send startup commands to the CS
* High Accuracty Waveform option for rock steady DCC signals
* New current response outputs current in mA, overlimit current, and maximum board capable current. Support for new current meter in JMRI
* USB Browser based EX-WebThrottle
* New, simpler, function control command
* Number of locos discovery command `<#>`
* Emergency stop command <!>
* Release cabs from memory command <-> all cabs, <- CAB> for just one loco address
* Automatic slot (register) management
* Automation (coming soon)
NOTE: DCC-EX is a major rewrite to the code. We started over and rebuilt it from the ground up! For what that means to you, click [HERE](notes/rewrite.md).

View File

@@ -1,10 +1,34 @@
DCC-EX Team is pleased to release CommandStation-EX-v3.1.0 as a Production Release. Release v3.1.0 is a minor release that adds additional features and fixes a number of bugs. The team is continually improving the architecture of DCC++EX to make it more flexible and optimizing the code so as to get more perfromance from the Arduino microprocessors. This release includes all of the Point Releases from v3.0.1 to v3.0.12.
The DCC-EX Team is pleased to release CommandStation-EX-v3.1.0 as a Production Release. Release v3.1.0 is a minor release that adds additional features and fixes a number of bugs. With the number of new features, this could have easily been a major release. The team is continually improving the architecture of DCC++EX to make it more flexible and optimizing the code so as to get more performance from the Arduino (and other) microprocessors. This release includes all of the Point Releases from v3.0.1 to v3.0.16.
- **Wi-Fi** - works, but can be challenging to use if you want to switch between AP mode and STA station mode.
- **Pololu Motor Shield** - is supported with this release, but the user may have to play around with some timings to enable programming mode due to limitation in its current sensing circuitry
**Downloads (zip and tar.gz) below. These are named without version number in the folder name to make the Arduino IDE happy.**
[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v3.1.0-Prod/CommandStation-EX.zip)
[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v3.1.0-Prod/CommandStation-EX.tar.gz)
**Known Issues**
- **Wi-Fi** - works, but requires sending <AT> commands from a serial monitor if you want to switch between AP mode and STA station mode after initial setup
- **Pololu Motor Shield** - is supported with this release, but the user may have to adjust timings to enable programming mode due to limitation in its current sensing circuitry
#### Summary of key features and/or bug fixes by Point Release
**Summary of the key new features added to CommandStation-EX V3.0.16**
- Ignore CV1 bit 7 read if rejected by a non NMRA compliant decoder when identifying loco id
**Summary of the key new features added to CommandStation-EX V3.0.15**
- Send function commands just once instead of repeating them 4 times
**Summary of the key new features added to CommandStation-EX V3.0.14**
- Add feature to tolerate decoders that incorrectly have gaps in their ACK pulse
- Provide proper track power management when joining and unjoining tracks with <1 JOIN>
**Summary of the key new features added to CommandStation-EX V3.0.13**
- Fix for CAB Functions greater than 127
**Summary of the key new features added to CommandStation-EX V3.0.12**
- Fixed clear screen issue for nanoEvery and nanoWifi
@@ -15,12 +39,14 @@ DCC-EX Team is pleased to release CommandStation-EX-v3.1.0 as a Production Relea
**Summary of the key new features added to CommandStation-EX V3.0.10**
- Includes support for the Arduino Teensy
- Added Support for the Teensy 3.2, 3.5, 3.6, 4.0 and 4.1 MCUs
- No functional change just changes to avoid complier warnings for Teensy/nanoEvery
**Summary of the key new features added to CommandStation-EX V3.0.9**
- Rearranges serial newlines for the benefit of JMRI
- Major update for efficiencies in displays (LCD, OLED)
- Add I2C Support functions
**Summary of the key new features added to CommandStation-EX V3.0.8**
@@ -52,7 +78,7 @@ DCC-EX Team is pleased to release CommandStation-EX-v3.1.0 as a Production Relea
- Auto load config.example.h with warning
- Dropped example .ino files
- Corrected .ino comments
- Pololu fault pin handling
- Add Pololu fault pin handling
- Waveform speed/simplicity improvements
- Improved pin speed in waveform
- Portability to nanoEvery and UnoWifiRev2 CPUs
@@ -62,7 +88,7 @@ DCC-EX Team is pleased to release CommandStation-EX-v3.1.0 as a Production Relea
- Linear command
- Removed need for ArduinoTimers files
- Removed option to choose different timer
- Added EX-RAIL hooks for later
- Added EX-RAIL hooks for automation in future version
- Fixed Turnout list
- Allow command keywords in mixed case
- Dropped unused memstream
@@ -113,7 +139,7 @@ DCC-EX Team is pleased to release CommandStation-EX-v3.1.0 as a Production Relea
- **Fix EEPROM bugs**
- **Number of locos discovery command** - `<#>` command
- **Support for more locomotives** - 20 locomotives on an UNO and 50 an a Mega.
- **Automatic slot managment** - slot variable in throttle/function commands are ignored and slot management is taken care of automatically. `<!>` command added to release locos from memory.
- **Automatic slot management** - slot variable in throttle/function commands are ignored and slot management is taken care of automatically. `<->` and `<- CAB>` commands added to release locos from memory and stop packets to the track.
**Key Contributors**
@@ -128,10 +154,14 @@ DCC-EX Team is pleased to release CommandStation-EX-v3.1.0 as a Production Relea
- Neil McKechnie - Worcestershire, UK (NeilMck)
- Fred Decker - Holly Springs, North Carolina, USA (FlightRisk)
- Dave Cutting - Logan, Utah, USA (Dave Cutting/ David Cutting)
- M Steve Todd - - Engine Driver and JMRI Interface
- Scott Catalanno - Pennsylvania
- M Steve Todd -
- Scott Catalano - Pennsylvania
- Gregor Baues - Île-de-France, France (grbba)
**Engine Driver and JMRI Interface**
- M Steve Todd
**exInstaller Software**
- Anthony W - Dayton, Ohio, USA (Dex, Dex++)
@@ -143,7 +173,7 @@ DCC-EX Team is pleased to release CommandStation-EX-v3.1.0 as a Production Relea
- Dave Cutting - Logan, Utah, USA (Dave Cutting/ David Cutting)
- Roger Beschizza - Dorset, UK (Roger Beschizza)
- Keith Ledbetter - Chicago, Illinois, USA (Keith Ledbetter)
- Kevin Smith - (KCSmith)
- Kevin Smith - Rochester Hills, Michigan USA (KC Smith)
**WebThrotle-EX**
@@ -154,6 +184,7 @@ DCC-EX Team is pleased to release CommandStation-EX-v3.1.0 as a Production Relea
**Beta Testing / Release Management / Support**
- Larry Dribin - Release Management
- Kevin Smith - Rochester Hills, Michigan USA (KC Smith)
- Keith Ledbetter
- BradVan der Elst
- Andrew Pye
@@ -168,3 +199,8 @@ DCC-EX Team is pleased to release CommandStation-EX-v3.1.0 as a Production Relea
- Gajanatha Kobbekaduwe
- Sumner Patterson
- Paul - Virginia, USA
**Downloads (zip and tar.gz) below. These are named without version number in the folder name to make the Arduino IDE happy.**
[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v3.1.0-Prod/CommandStation-EX.zip)
[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v3.1.0-Prod/CommandStation-EX.tar.gz)

View File

@@ -1,139 +1,206 @@
The DCC-EX Team is pleased to release CommandStation-EX-v3.0.0 as a Production Release. This release is a major re-write of earlier versions. We've re-architected the code-base so that it can better handle new features going forward.
The DCC-EX Team is pleased to release CommandStation-EX-v3.1.0 as a Production Release. Release v3.1.0 is a minor release that adds additional features and fixes a number of bugs. With the number of new features, this could have easily been a major release. The team is continually improving the architecture of DCC++EX to make it more flexible and optimizing the code so as to get more performance from the Arduino (and other) microprocessors. This release includes all of the Point Releases from v3.0.1 to v3.0.16.
**Known Bugs:**
- **Consisting through JMRI** - currently does not work in this release. You may use the <M> command to do this manually.
- **Wi-Fi** - works, but can be challenging to use if you want to switch between AP mode and STA station mode.
- **Pololu Motor Shield** - is supported with this release, but the user may have to play around with some timings to enable programming mode due to limitation in its current sensing circuitry
**Downloads (zip and tar.gz) below. These are named without version number in the folder name to make the Arduino IDE happy.**
[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v3.1.0-Prod/CommandStation-EX.zip)
[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v3.1.0-Prod/CommandStation-EX.tar.gz)
**Known Issues**
- **Wi-Fi** - works, but requires sending <AT> commands from a serial monitor if you want to switch between AP mode and STA station mode after initial setup
- **Pololu Motor Shield** - is supported with this release, but the user may have to adjust timings to enable programming mode due to limitation in its current sensing circuitry
#### Summary of key features and/or bug fixes by Point Release
**Summary of the key new features added to CommandStation-EX V3.0.16**
- Ignore CV1 bit 7 read if rejected by a non NMRA compliant decoder when identifying loco id
**Summary of the key new features added to CommandStation-EX V3.0.15**
- Send function commands just once instead of repeating them 4 times
**Summary of the key new features added to CommandStation-EX V3.0.14**
- Add feature to tolerate decoders that incorrectly have gaps in their ACK pulse
- Provide proper track power management when joining and unjoining tracks with <1 JOIN>
**Summary of the key new features added to CommandStation-EX V3.0.13**
- Fix for CAB Functions greater than 127
**Summary of the key new features added to CommandStation-EX V3.0.12**
- Fixed clear screen issue for nanoEvery and nanoWifi
**Summary of the key new features added to CommandStation-EX V3.0.11**
- Reorganized files for support of 128 speed steps
**Summary of the key new features added to CommandStation-EX V3.0.10**
- Added Support for the Teensy 3.2, 3.5, 3.6, 4.0 and 4.1 MCUs
- No functional change just changes to avoid complier warnings for Teensy/nanoEvery
**Summary of the key new features added to CommandStation-EX V3.0.9**
- Rearranges serial newlines for the benefit of JMRI
- Major update for efficiencies in displays (LCD, OLED)
- Add I2C Support functions
**Summary of the key new features added to CommandStation-EX V3.0.8**
- Wraps <* *> around DIAGS for the benefit of JMRI
**Summary of the key new features added to CommandStation-EX V3.0.7**
- **Support for 28 Speed steps** - Option to turn on 28 step speed decoders in addition to 128. If set, all locos will use 28 steps.
- **Improved overload messages with raw values (relative to offset)**
- Implemented support for older 28 apeed step decoders - Option to turn on 28 step speed decoders in addition to 128. If set, all locos will use 28 steps.
- Improved overload messages with raw values (relative to offset)
**Summary of the key new features added to CommandStation-EX V3.0.6**
- **Prevent compiler warning about deprecated B constants**
- **Fix Bug that did not let us transmit 5 byte sized packets** - 5 Byte commands like PoM (programming on main) were not being sent correctly
- **Huge function numbers (DCC BinaryStateControl)** - Support Functions beyond F28
- **<!> ESTOP all** - New command to emergency stop all locos on the main track
- **<- [cab]> estop and forget cab/all cabs** - Stop and remove loco from the CS. Stops the repeating throttle messages
- **``<D RESET>`` command to reboot arduino**
- **Automatic sensor offset detect** -
- **Improved startup msgs from Motor Drivers (accuracy and auto sense factors)** -
- **Drop post-write verify** - No need to double check CV writes. Writes are now even faster.
- **Allow current sene pin set to UNUSED_PIN** - No need to ground an unused analog current pin. Produce startup warning and callback -2 for prog track cmds.
- Prevent compiler warning about deprecated B constants
- Fix Bug that did not let us transmit 5 byte sized packets - 5 Byte commands like PoM (programming on main) were not being sent correctly
- Support for Huge function numbers (DCC BinaryStateControl) - Support Functions beyond F28
- <!> ESTOP all - New command to emergency stop all locos on the main track
- <- [cab]> estop and forget cab/all cabs - Stop and remove loco from the CS. Stops the repeating throttle messages
- `<D RESET>` command to reboot Arduino
- Automatic sensor offset detect
- Improved startup msgs from Motor Drivers (accuracy and auto sense factors)
- Drop post-write verify - No need to double check CV writes. Writes are now even faster.
- Allow current sense pin set to UNUSED_PIN - No need to ground an unused analog current pin. Produce startup warning and callback -2 for prog track cmds.
**Summary of the key new features added to CommandStation-EX V3.0.5**
- **Fix Fn Key startup with loco ID and fix state change for F16-28**
- removed ethernet mac config and made it automatic
- show wifi ip and port on lcd
- auto load config.example.h with warningh
- dropped example .ino files
- corrected .ino comments
- pololu fault pin handling
- waveform speed/simplicity improvements
- improved pin speed in waveform
- portability to nanoEvery and UnoWifiRev2 CPUs
- analog read speed improvements
- drop need for DIO2 library
- improved current check code
- linear <a> command
- removed need for ArduinoTimers files
- removed <D DCC SLOW>
- Removed option to choose different timer
- Added EX-RAIL hooks for later
- fixed Turnout list
- allow command keywords in mixed case
- dropped unused memstream
- PWM pin accuracy if requirements met.
- Fix Fn Key startup with loco ID and fix state change for F16-28
- Removed ethernet mac config and made it automatic
- Show wifi ip and port on lcd
- Auto load config.example.h with warning
- Dropped example .ino files
- Corrected .ino comments
- Add Pololu fault pin handling
- Waveform speed/simplicity improvements
- Improved pin speed in waveform
- Portability to nanoEvery and UnoWifiRev2 CPUs
- Analog read speed improvements
- Drop need for DIO2 library
- Improved current check code
- Linear command
- Removed need for ArduinoTimers files
- Removed option to choose different timer
- Added EX-RAIL hooks for automation in future version
- Fixed Turnout list
- Allow command keywords in mixed case
- Dropped unused memstream
- PWM pin accuracy if requirements met
**Summary of the key new features added to CommandStation-EX V3.0.4**
- **"Drive-Away" Feature added so that throttles like Engine Driver can allow a loco to be programmed on a usable, electrically isolated programming track and then drive off onto the main track.
- **WiFi Startup Fixes**
- "Drive-Away" Feature - added so that throttles like Engine Driver can allow a loco to be programmed on a usable, electrically isolated programming track and then drive off onto the main track
- WiFi Startup Fixes
**Summary of the key new features added to CommandStation-EX V3.0.3**
- **<W addr> command to write loco address and clear consist**
- **<R> command will allow for consist address**
- **Startup commands implemented**
- Command to write loco address and clear consist
- Command will allow for consist address
- Startup commands implemented
**Summary of the key new features added to CommandStation-EX V3.0.2:**
- **Create new output for current in mA for ``<c>`` command** - New current response outputs current in mA, overlimit current, and maximum board capable current
- **Simultaneously update JMRI to handle new current meter**
- Create new output for current in mA for `<c>` command - New current response outputs current in mA, overlimit current, and maximum board capable current
- Simultaneously update JMRI to handle new current meter
**Summary of the key new features added to CommandStation-EX V3.0.1:**
- **Add back fix for jitter**
- **Add Turnouts, Outputs and Sensors to ```<s>``` command output**
**Summary of the key new features added to CommandStation-EX V3.0.0:**
- Add back fix for jitter
- Add Turnouts, Outputs and Sensors to `<s>` command output
- **New USB Browser Based Throttle** - WebThrottle-EX is a full front-end to controller to control the CS to run trains.
- **WiFi Support** - AP and station modes supported. Auto-detection of an ESP8266 WiFi module with AT firmware on a Mega's serial port. Connection to JMRI and WiThrottle clients.
- **Withrottle Integrations** - Act as a host for up to four WiThrottle clients concurrently.
- **Add LCD/OLED support** - OLED supported on Mega only
- **Improved CV programming routines** - checks for length of CV pulse, and breaks out of the wait state once it has received an ACK, now reading one CV per second.
- **Improved current sensing** - rewrote current sensing routines for safer operation. Current thresholds based on milliamps, not magic numbers
- **Individual track power control** - Ability to toggle power on either or both tracks, and to "JOIN" the tracks and make them output the same waveform for multiple power districts.
- **Single or Dual-Pin PWM output** - Allows control of H-bridges with PH/EN or dual PWM inputs
- **New, simpler function command** - ```<F>``` command allows setting functions based on their number, not based on a code as in ```<f>```
- **Function reminders** - Function reminders are sent in addition to speed reminders
- **Functions to F28** - All NMRA functions are now supported
- **Filters and user functions** - Ability to filter commands in the parser and execute custom code based on them. (ex: Redirect Turnout commands via NRF24)
- **Diagnostic ```<D>``` commands** - See documentation for a full list of new diagnostic commands
- **Rewrote DCC++ Parser** - more efficient operation, accepts multi-char input and uses less RAM
- **Rewritten waveform generator** - capable of using any pin for DCC waveform out, eliminating the need for jumpers
- **Rewritten packet generator** - Simplify and make smaller, remove idea of "registers" from original code
- **Add free RAM messages** - Free RAM messages are now printed whenever there is a decerase in available RAM
- **Fix EEPROM bugs**
- **Number of locos discovery command** - ```<#>``` command
- **Support for more locomotives** - 20 locomotives on an UNO and 50 an a Mega.
- **Automatic slot managment** - slot variable in throttle/function commands are ignored and slot management is taken care of automatically. ```<!>``` command added to release locos from memory.
**CommandStation-EX V3.0.0:**
**Release v3.0.0 was a major rewrite if earlier versions of DCC++. The code base was re-architeced and core changes were made to the Waveform generator to reduce overhead and make better use of Arduino.** **Summary of the key new features added in Release v3.0.0 include:**
- **New USB Browser Based Throttle** - WebThrottle-EX is a full front-end to controller to control the CS to run trains.
- **WiFi Support** - AP and station modes supported. Auto-detection of an ESP8266 WiFi module with AT firmware on a Mega's serial port. Connection to JMRI and WiThrottle clients.
- **Withrottle Integrations** - Act as a host for up to four WiThrottle clients concurrently.
- **Add LCD/OLED support** - OLED supported on Mega only
- **Improved CV programming routines** - checks for length of CV pulse, and breaks out of the wait state once it has received an ACK, now reading one CV per second.
- **Improved current sensing** - rewrote current sensing routines for safer operation. Current thresholds based on milliamps, not magic numbers
- **Individual track power control** - Ability to toggle power on either or both tracks, and to "JOIN" the tracks and make them output the same waveform for multiple power districts.
- **Single or Dual-Pin PWM output** - Allows control of H-bridges with PH/EN or dual PWM inputs
- **New, simpler function command** - `<F>` command allows setting functions based on their number, not based on a code as in `<f>`
- **Function reminders** - Function reminders are sent in addition to speed reminders
- **Functions to F28** - All NMRA functions are now supported
- **Filters and user functions** - Ability to filter commands in the parser and execute custom code based on them. (ex: Redirect Turnout commands via NRF24)
- **Diagnostic `<D>` commands** - See documentation for a full list of new diagnostic commands
- **Rewrote DCC++ Parser** - more efficient operation, accepts multi-char input and uses less RAM
- **Rewritten waveform generator** - capable of using any pin for DCC waveform out, eliminating the need for jumpers
- **Rewritten packet generator** - Simplify and make smaller, remove idea of "registers" from original code
- **Add free RAM messages** - Free RAM messages are now printed whenever there is a decerase in available RAM
- **Fix EEPROM bugs**
- **Number of locos discovery command** - `<#>` command
- **Support for more locomotives** - 20 locomotives on an UNO and 50 an a Mega.
- **Automatic slot management** - slot variable in throttle/function commands are ignored and slot management is taken care of automatically. `<->` and `<- CAB>` commands added to release locos from memory and stop packets to the track.
**Key Contributors**
**Project Lead**
- Fred Decker - Holly Springs, North Carolina, USA (FlightRisk)
**CommandStation-EX Developers**
- Chris Harlow - Bournemouth, UK (UKBloke)
- Harald Barth - Stockholm, Sweden (Haba)
- Neil McKechnie - Worcestershire, UK (NeilMck)
- Fred Decker - Holly Springs, North Carolina, USA (FlightRisk)
- Dave Cutting - Logan, Utah, USA (Dave Cutting/ David Cutting)
- M Steve Todd - - Engine Driver and JMRI Interface
- Scott Catalanno - Pennsylvania
- M Steve Todd -
- Scott Catalano - Pennsylvania
- Gregor Baues - Île-de-France, France (grbba)
**Engine Driver and JMRI Interface**
- M Steve Todd
**exInstaller Software**
- Anthony W - Dayton, Ohio, USA (Dex, Dex++)
**Website and Documentation**
- Mani Kumar - Bangalor, India (Mani / Mani Kumar)
- Fred Decker - Holly Springs, North Carolina, USA (FlightRisk)
- Dave Cutting - Logan, Utah, USA (Dave Cutting/ David Cutting)
- Roger Beschizza - Dorset, UK (Roger Beschizza)
- Keith Ledbetter - Chicago, Illinois, USA (Keith Ledbetter)
- Kevin Smith - (KCSmith)
- Kevin Smith - Rochester Hills, Michigan USA (KC Smith)
**WebThrotle-EX**
- Fred Decker - Holly Springs, NC (FlightRisk/FrightRisk)
- Mani Kumar - Bangalor, India (Mani /Mani Kumar)
- Matt H - Somewhere in Europe
**Beta Testing / Release Management / Support**
- Larry Dribin - Release Management
- Keith Ledbetter
- BradVan der Elst
- Andrew Pye
- Mike Bowers
- Larry Dribin - Release Management
- Kevin Smith - Rochester Hills, Michigan USA (KC Smith)
- Keith Ledbetter
- BradVan der Elst
- Andrew Pye
- Mike Bowers
- Randy McKenzie
- Roberto Bravin
- Sim Brigden
- Alan Lautenslager
- Martin Bafver
- Mário André Silva
- Anthony Kochevar
- Gajanatha Kobbekaduwe
- Sumner Patterson
- Martin Bafver
- Mário André Silva
- Anthony Kochevar
- Gajanatha Kobbekaduwe
- Sumner Patterson
- Paul - Virginia, USA
**Downloads (zip and tar.gz) below. These are named without version number in the folder name to make the Arduino IDE happy.**
[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v3.1.0-Prod/CommandStation-EX.zip)
[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v3.1.0-Prod/CommandStation-EX.tar.gz)

View File

@@ -3,11 +3,12 @@
#include "StringFormatter.h"
#define VERSION "3.0.14"
#define VERSION "3.1.0"
// 3.0.16 Ignore CV1 bit 7 read rejected by decoder when identifying loco id.
// 3.0.15 only send function commands once, not 4 times
// 3.0.14 gap in ack tolerant fix, prog track power management over join fix.
// 3.0.13 Functions>127 fix
// 3.0.12 Fix HOSTNAME function for STA mode for WiFi
// 3.0.11 ?
// 3.0.11 28 speedstep support
// 3.0.10 Teensy Support
// 3.0.9 rearranges serial newlines for the benefit of JMRI.