Arduino Mega 2560 R3 And RTC MCP794N

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Arduino Mega 2560 R3 And RTC MCP794N

Post by Monie Jacobsen »

HI everyone
Can Arduino Mega 2560 R3 use Clock RTC MCP794N ?
Original: Clock RTC MCP794N with dsPIC:
MIAC_dsPIC_ClockDemo.fcfx
(34.2 KiB) Downloaded 241 times
Want to use Clock RTC MCP794N with Arduino Mega 2560 R3, can this work?
Attached work file:
SolarTrackerMega2560-R3 Test UR og Clock.fcfx
(45.78 KiB) Downloaded 243 times
Do you have a suggestion for codes?
Or would you like to help correct Clock RTC MCP794N for use with the Arduino Mega 2560 R3?

For example, how to direct the codes to use for Mega 2560 Macro DrawCursor.
DrawCursor.JPG
DrawCursor.JPG (39.85 KiB) Viewed 7048 times
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Arduino Mega 2560 R3 And RTC MCP794N

Post by LeighM »

Hi Monie
There might be some issues running these two devices on the same I2C pins.
Could you try moving one of the devices to some different pins and use the Software channel?

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: Arduino Mega 2560 R3 And RTC MCP794N

Post by Monie Jacobsen »

Hi LeighM
I really tried the whole weekend but without luck;-)
Really tried a lot and got stuck....
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Arduino Mega 2560 R3 And RTC MCP794N

Post by LeighM »

Did you include pull-up resistors on the I2C pins?

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: Arduino Mega 2560 R3 And RTC MCP794N

Post by Monie Jacobsen »

HI LeighM

I use your user Blocks EB-002-00-1. Screw Terminal on all Arduino Mega 2560 R3
Using all ports is this a problem?
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Arduino Mega 2560 R3 And RTC MCP794N

Post by LeighM »

Yes, the EB002 series resistors might cause an issue with the RTC chip too, try shorting them out as you did for the display.
What is your circuit to the RTC MCP7940N chip device?
Do you have the pull-up resistors required for I2C?

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: Arduino Mega 2560 R3 And RTC MCP794N

Post by Monie Jacobsen »

HI LeighM

I have pull-up resistors required for I2C?
I use LCD I2C units below!
LCD I2C units.JPG
LCD I2C units.JPG (13.1 KiB) Viewed 7022 times
Yes, EB002 resistors may cause a problem with the RTC chip, so try shorting them as you did on the screen. Have done what you describe.

What is your circuit to the RTC MCP7940N chip device? Believe that pull-up resistors are built-in.
rts_mcp7940n1.JPG
rts_mcp7940n1.JPG (10 KiB) Viewed 7022 times
RTC MCP7940N is component in Flocode 8

Attached file:
SolarTrackerMega2560-R3 Test UR og Clock.fcfx
(47.87 KiB) Downloaded 236 times
Best Regard
Monie

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times

Re: Arduino Mega 2560 R3 And RTC MCP794N

Post by jgu1 »

Hi Monie!

The picture you attach, is for the display, serial to parallel, as far I know your display work?. I think that Leigh, mean if you use the same adapter as you used for the displaydriver to your RTC, you have to short the resistors on this board also. I think :D

Concerning the RTC, why don´t you use DS3231 like this https://www.ebay.com/itm/Arduino-DS3231 ... SwuMZZL4eH. Ready to use. Here is lot of examble here in fora, Medelec, Martin made one here: viewtopic.php?f=26&t=16392 and John Crow has also made one you can use.

If I have misunderstood, please forget this,,,,, :wink:

Br Jorgen

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Arduino Mega 2560 R3 And RTC MCP794N

Post by LeighM »

Believe that pull-up resistors are built-in.
Are you using a module, or the chip device?
Here's the circuit needed from the datasheet...
MCP7940N.png
(16.16 KiB) Downloaded 1952 times

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: Arduino Mega 2560 R3 And RTC MCP794N

Post by Monie Jacobsen »

HI LeighM

The Schematic diagram shows pull-up resistors.
But as I understand it, the component is built into Flowcode;-)
RTC MCP7940N.JPG
RTC MCP7940N.JPG (36.18 KiB) Viewed 6973 times
As for Windspeed, I find it very difficult to find a Port that can be used!
And here I know with the outside unit that there must be pull-up resistors.
Attach file:
SolarTrackerMega2560-R3 Windspeed.fcfx
(25.63 KiB) Downloaded 235 times
Uses Arduino Mega 2560 R3 with EB092
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: Arduino Mega 2560 R3 And RTC MCP794N

Post by Monie Jacobsen »

HI everyone

It will be helpful to show a connection between PWM and DC motor (Full Bridge).
Like an example in flow code!
Motor Reversible and PWM.JPG
Motor Reversible and PWM.JPG (98.25 KiB) Viewed 6896 times
See attached files:
SolarTrackerMega2560-R3 004.fcfx
(31.03 KiB) Downloaded 256 times
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: Arduino Mega 2560 R3 And RTC MCP794N

Post by Monie Jacobsen »

HI LeighM

'How do I get PWM and motor reversible to work together?
With a PWM signal for a motor ..
PWM Pin E3
Motor output Port E.3
Did not check on how to pair the devices!
Hope very much you will come up with a suggestion ;-)

Attached files:
SolarTrackerMega2560-R3 006.fcfx
(31.54 KiB) Downloaded 253 times
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Arduino Mega 2560 R3 And RTC MCP794N

Post by LeighM »

Hi Monie,
I don't think you can use the components together like that.
Depends what your driver circuit looks like,
but you could drive one pin/side with the PWM and the other with high/low for forward/reverse.
Or, use the PWM as a driver enable, and then use the motor reversible component to drive the two sides of the bridge.
Leigh

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: Arduino Mega 2560 R3 And RTC MCP794N

Post by Monie Jacobsen »

Hi LeighM

I will now use PWM to send signal to an H-bridge controller;-)
But thank you very much for your suggestion.
I've made this PCB layout below..
H-Bridge_optimized.jpg
H-Bridge_optimized.jpg (110.79 KiB) Viewed 6783 times
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: Arduino Mega 2560 R3 And RTC MCP794N

Post by Monie Jacobsen »

HI LeighM
Can Opto isolator board EB035 E-blocks be connected with Inductive PNP sensor (24V) and with input for the Arduino Mega 2560?
Can you give a sketch / diagram of a coupling example between EB035 E-blocks and Inductive sensor?
I do not want to destroy EB035 E-blocks!
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Arduino Mega 2560 R3 And RTC MCP794N

Post by LeighM »

PNP_Sensor.jpg
PNP_Sensor.jpg (59.41 KiB) Viewed 6751 times

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: Arduino Mega 2560 R3 And RTC MCP794N

Post by Monie Jacobsen »

Hi LeighM

Thank you very much. It was just what I could use;-)

Good weekend
Best Regard
Monie

Post Reply