@chriszang and another update.
So I am happily working on my CAN receiver sketch and just noticed that I forgot to press the button that grounds INT-output of the mc2515 but the upload still worked. Gave it another try (w/o pressing the button) and it's still working - weird.
Then I swapped this COMMU module for my 2nd COMMU Module and here the upload doesn't work.
My explanation is that the grounding of the mcp2515 INT-output basically created a short circuit in the transistor that controls this pin and eventually burned it out. Not a big problem for me as
a) I am not using interrupts in my sketch
b) I have a 2nd COMMU unit
I just wanted to warn you guys that grounding the INT output has unintended consequences.
Latest posts made by ChrisZang
-
RE: Core 2 and COMMU
-
RE: Core 2 and COMMU
@chriszang and one more thing that I just learned:
The GPIO for the CS Pin for the mcp2515 is 27 (not 12 as the documentation says).
If you want to initialize the mcp2515 in the COMMU do this:MCP2515 CAN0(27); // (mcp2515 library)
or
MCP_CAN CAN0(27); // (mcp_can library) -
RE: Core 2 and COMMU
@felmue Yes, thanks that was it :-)
So basically you compile & upload your sketch, you wait until the "...." appears, you press the button and then the upload works.
Thanks again. -
RE: Core 2 and COMMU
@felmue Thanks, gotcha (at least I think I gotacha ;-). So if i scroll down further on your link to "MBUS PinMap" it would be the pin labeled "IISOUT" ?
-
RE: Core 2 and COMMU
@chriszang quick update: I just gave it a try: I soldered a wire to the "EN" pin and grounded it for a moment as soon as the ....... started to show when upload starts.. Never got it to work, getting basically the same error message as before. Bummer.
-
RE: Core 2 and COMMU
@tls thank you for that! I had the same problem and had a ticket open with the very nice but otherwise clueless M5 support team, who ended up sending me a 2nd COMMU module, which - of course - also didn't work.
Just to be 100% sure that I understand what you write here:
When you write "Pin 2 of the ESP is a strapping pin", that would be the "EN" or "RESET" pin, which is Pin 2 on some ESP32 DEV boards and Pin 15 on some others - correct? On the Core2 M-BUS it would be the Pin labeled "RST" or "EN" (3rd from the top in the right row).
I'm assuming that the old trick with the 22 uF condensator between "EN" and GND wouldn't work here, because the MCP chip immediately pulls it high? -
RE: Core2 RTC adjusting for DST
@johno try this:
#include "time.h"
// Set offset time in seconds to adjust for your timezone, for example:
#define GMT+1 3600
#define GMT+8 28800
#define GMT-1 -3600
#define GMT0 0
#define PST -28800
#define DST 3600// this sets the timezone to PT with automatic switch for DST
const char* ntpServer = "pool.ntp.org";
const long gmtOffset_sec = PST;
const int daylightOffset_sec = DST;void (setup ()
{
configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
SetRTC() ;
}bool SetRTC()
{
struct tm timeinfo;
if(!getLocalTime(&timeinfo))
{
Serial.println("Failed to obtain time");
return (false);
}
RTCtime.Hours = timeinfo.tm_hour;
RTCtime.Minutes = timeinfo.tm_min;
RTCtime.Seconds = timeinfo.tm_sec;
RTCDate.Year = timeinfo.tm_year+1900;
RTCDate.Month = timeinfo.tm_mon;
RTCDate.Date = timeinfo.tm_mday;
return (true);
}