Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Franzi hh fast clock #348

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

FranziHH
Copy link

Hi,

FastClock implementation is faulty.
Here is my suggestion.
The instructions for integrating FastClock into DCC-EX are also incorrect.

For the serial connection, it is sufficient in the config.h Comment out one of the serial ports e.g.
#define SERIAL1_COMMANDS

The integration of I2C did not work at all this is my suggestion that works for me.

It just needs to be in the config.h
#define FAST_CLOCK_I2C 0x55
can be defined and, if necessary, the address can be adjusted

Many greetings, Franziska

Here are the two debug outputs before and after my change:

The order of initialization did not work for I2C

original edition

<* License GPLv3 fsf.org (c) dcc-ex.com *>
<* Checking for Clock *>
<* Clock check result - 3 *>
<* LCD6:CLOCK NOT FOUND *>
<* I2C Device found at 0x3C, OLED Display? *>
<* I2C Device found at 0x55, EEPROM? *>
<* MCP23017 I2C:0x20 Device not detected *>
<* MCP23017 I2C:0x21 Device not detected *>
<* Found PORTB pin 13 *>
<* Pin 55 Max 1497mA (501) *>
<* Found PORTB pin 12 *>
<* Pin 54 Max 1497mA (501) *>

after my change

<* License GPLv3 fsf.org (c) dcc-ex.com *>
<* I2C Device found at 0x3C, OLED Display? *>
<* I2C Device found at 0x55, Fast Clock? *>
<* Checking for Clock *>
<* Clock check result - 0 *>
<* I2C Fast Clock found at 0x55 *>
<* EXFastClock::create *>
<* MCP23017 I2C:0x20 Device not detected *>
<* MCP23017 I2C:0x21 Device not detected *>
<* Found PORTB pin 13 *>
<* Pin 55 Max 1497mA (501) *>
<* Found PORTB pin 12 *>
<* Pin 54 Max 1497mA (501) *>
<= A MAIN>
<= B PROG>
<* 128x64 OLED display configured on I2C:0x3c *>
<* LCD0:DCC-EX v5.0.2 *>
<* LCD1:Lic GPLv3 *>
<* ++ Wifi Setup Try 1 ++ *>
(...)
<* Wifi Check: [\r\nOK\r\n\0] *>
ATE0\r\n\r\nOK\r\n<* Found in 4ms *>
<* WiFi CONNECTED *>
<iDCC-EX V-5.0.2 / MEGA / STANDARD_MOTOR_SHIELD G-3bddf4d>
<* LCD3:Ready *>
<p0>
<* LCD2:Power Off *>
<* LCD3:Free RAM= 2262b *>
<* LCD6:Clk Time:562 Sp 4 *>
<jC 562 4>
<* LCD3:Free RAM= 2248b *>
<* LCD6:Clk Time:563 Sp 4 *>
<jC 563 4>
<* LCD6:Clk Time:564 Sp4 *>
<jC 564 4>
<* LCD3:Free RAM= 2239b *>

serial is working
I2C is wrong
First, the initialization was incorrect. The FastClock was initialized before the I2C Manager was initialized
Second: FastClock Functions are missing
Fast Clock can be easily activated without complicated adjustments in config.h:

Serial:
simply comment out the required port: e.g. #define SERIAL1_COMMANDS

OR

for I2C
//#define FAST_CLOCK_I2C 0x55
and define the address
Debug Output adjusted
For Display

Shows IP and Port in same Line: PRINT_IP_PORT_SINGLE_LINE

Shows FastClock readable: FASTCLOCK_READABLE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant