RTC and prototyping area

Combining the power of the ATmega2560 MCU with onboard Ethernet, a microSD card slot, an efficient switchmode power supply, and a small prototyping area. [Product page]
Post Reply
Stephen
Posts: 4
Joined: Thu May 17, 2012 12:25 pm

RTC and prototyping area

Post by Stephen » Wed Aug 20, 2014 3:29 am

I am attempting to fit your RTC to the prototyping area on an EtherMega. I have an RTC working happily on an EtherTen, so know they work :D . Despite careful soldering (and resoldering) and continuity testing, the RTC on the Mega resets when powering up (battery ok and onboard). I have only connected the GND, VCC, SDA, and SDL on the RTC to the matching pads right next to the prototyping area. It sits there very nicely - but it just resets after each power down/up. No other modules attached, only running the bog standard TestRTC sketch, which clean compiles and uploads. I can then set TIME and DATE (although TEMP says "temp not available"). TIME and DATE continue to tick over and are accessible and update properly, until I power off the board. Restart a minute later and the time and date are back to 09:00:00.

Am I missing something like a jumper to use the prototyping area, or something? Any suggestions appreciated. Next step is to desolder and remove the RTC and try again from scratch, but that isn't the preferred option :)

thanks
Stephen

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: RTC and prototyping area

Post by angusgr » Thu Aug 21, 2014 11:14 pm

Hi Stephen,

Your configuration sounds OK as described.

Is there any chance the battery may be faulty or not quite properly installed, or perhaps the battery body or another part of the RTC is shorting out on some part of the EtherMega?

Regards,


Angus

Stephen
Posts: 4
Joined: Thu May 17, 2012 12:25 pm

Re: RTC and prototyping area

Post by Stephen » Fri Aug 22, 2014 11:20 am

Thanks Angus, at least I was on the right track! I have removed the RTC from the prototyping area and wired it conventionally with a breadboard to A5 A4 and 5V GND. It works. Bugger :)

I tried moving the A4/A5 wires to the SCL SDA pins nearest the microUSb connector, but similar behaviour to the proto area. Back to A4/A5 and it is happy. Pins 20/21 are also labelled SDA/SCL so I tried those... same outcome. Back to A4/A5 and all works again. There is something weird about the SCL/SDA labelled pins and A4/A5... I haven't changed the code - should the reference to A4/A5 be something else?

thanks for your patience

Stephen

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: RTC and prototyping area

Post by angusgr » Wed Aug 27, 2014 4:11 am

Hi Stephen,

Sorry, I should have noticed this before - the penny only just dropped.

rweathers' RTC library (which you're using) defaults to using a library feature (also from rweathers) called SoftI2C that simulates the I2C connection.

This means you can use any pins you like for the I2C connection to the RTC, but you need to update the sketch. Look for the lines in the example which say:
SoftI2C i2c(A4, A5);
And change them to:
SoftI2C i2c(SDA, SCL);
(Or any other pins for that matter.)

The rweathers library used to support hardware i2c as well (less resource intensive, uses the built-in i2c hardware support instead of simulating it in software). However it looks like that support was recently temporarily removed so this library currently only works with SoftI2C. There are other DS3232 RTC libraries that use hardware i2c.

(If you're confused why A4/A5 and SDA/SCL are not the same pins, they are only the same on Arduino Uno & compatibles with atmega328 or atmega168. Different pins on the Mega!)

Sorry for the confusion.


- Angus

sky
Posts: 18
Joined: Wed May 27, 2015 3:20 am

Re: RTC and prototyping area

Post by sky » Wed May 27, 2015 4:27 am

I will be attempting to configure something like this in a few days when the parts get here. I have a DS3231 Chronodot RTC that I was using on my Arduino Mega project, and has since ran flawlessly on the EtherMega. The programmed time will reset due to serial connection issues, but is easily resolved by cutting the RESET-EN trace between the pads. However, doing that blocks the com so a wire and switch need to be soldered to the pads to re-enable when needed. I am yet to also perform this operation on my EtherMega, but it has worked great on my Mega with a micro switch and some salvaged cat5.

To nail the RTC to the prototyping area, I ordered some break away pin strip right-angle male headers and will configure a manageable position for my project, but I want to clean up the breadboard for later addons to the project. I'll let yas know how it goes.

Image

sky
Posts: 18
Joined: Wed May 27, 2015 3:20 am

Re: RTC and prototyping area

Post by sky » Thu May 28, 2015 12:36 pm

The mod went well. I had some trouble removing the original pins from my RTC, but once they were out everything else went smooth. I figured it would be best to put right angle header pins on the side of the RTC that is not regularly used, and just use that side to anchor the RTC to the proto area of the EtherMega. I then soldered some jumper wires to 5V, GND, SCL and SDA. The other ends I soldered right into the open sockets next to the proto area and now the RTC is happily ticking away in it's permanent position with it's own pins. My code still runs smoothly, but the mere fact that I was even able to upload the sketch tells me I still need to spend some time cutting the RST-EN trace between the soldered on Cat5 wires. If I had successfully made the cut, uploading the sketch would not be possible, or at least that's my experience with an Arduino Mega and I just assume that is the case with EtherMega as well.

Image
Image
Image
Image

Edit - Some observations reveal the total height from the top of the EM board is now 35mm. Also, I wish I would have soldered stacking headers to the board instead of the hardware. This would have further increased height, but would have gained for easy removal and/or repositioning.

choknanee
Posts: 2
Joined: Mon Mar 13, 2017 11:21 pm

Re: RTC and prototyping area

Post by choknanee » Mon Mar 13, 2017 11:22 pm

I'll let yas know how it goes.
gclub โปรโมชั่น

cadmodeling777
Posts: 10
Joined: Fri Apr 21, 2017 8:42 am
Location: MONA TILES COMPOUND, NR. CHHANI CIRCLE, CHHANI ROAD, VADODARA - 390002. GUJARAT, INDIA.
Contact:

Re: RTC and prototyping area

Post by cadmodeling777 » Fri Apr 21, 2017 8:45 am

The programmed time will reset due to serial connection issues, but is easily resolved by cutting the RESET-EN trace between the pads. However, doing that blocks the com so a wire and switch need to be soldered to the pads to re-enable when needed. I am yet to also perform this operation on my EtherMega, but it has worked great on my Mega with a micro switch and some salvaged cat5.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest