Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 20:18 15 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM - replacing 1307 with 3231 RTC

     Page 2 of 3    
Author Message
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 01:29am 08 Aug 2014
Copy link to clipboard 
Print this post

Ahh... I must be getting slow. Maybe he could threaten one with the pot!
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1421
Posted: 04:42am 08 Aug 2014
Copy link to clipboard 
Print this post

  paceman said   Ahh... I must be getting slow. Maybe he could threaten one with the pot!


If the Kiwi were on pot, it would be flying!


(I love that none of us speak the same common language.)
Micromites and Maximites! - Beginning Maximite
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 08:49am 08 Aug 2014
Copy link to clipboard 
Print this post

CG, except we all speak MMBasic 4.5...
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9077
Posted: 02:23pm 08 Aug 2014
Copy link to clipboard 
Print this post

Oh, listen to the lot of you!

Seriously though, you are OK if things are sent by courier - FedEx, DHL, UPS etc This is what I use to get things here, and they arrive very quickly - usually inside a week from anywhere in the world. Standard post is getting ridiculously expensive, and ridiculously slow too, as some of you have already found out.

Standard mail is only delivered three times a week(or is about to be), so you only get standard mail three days of the week instead of five - all cut-backs.

To send a standard-rate letter anywhere in NZ is 70c now, which up a bit on the 40c it used to be a few years ago....

NZ Post are blaming the Internet for this, and this is probably a half-truth.
All the banks here in NZ now send emailed statements, so can you imagine before, when all the banks were posting paper statements out to everyone with an account anywhere in the country - would have been millions of dollars for NZ Post, which they now don't get, cos emailed statements take away all that business they used to get from the banks posting out the monthly statements.

So, I can kinda see why they have to put prices up for everything else - it's a tricky situation.
Smoke makes things work. When the smoke gets out, it stops!
 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 06:28pm 08 Aug 2014
Copy link to clipboard 
Print this post

Here in OZ they are talking about cutting mail to 3 times a week. They must have got the idea from your guys.

Our standard letter price has just gone up to 70 cents unless you are a card carrying oldie like me then you get a stamp ration at 60 cents each. Actually I got a great load of them for free when I signed up for the oldies plan. I won't need to buy another stamp for all of this year and probably part of next. Where's the logic?

Banks with emailed statements, is that a forced situation? I won't have it and every time they go to try it on I quote their own disclaimer back at them. It says that email is not secure etc.. While they continue to say use it at your own risk I reckon I won't have to use it. At least the guvvamint will have a harder time reading my letters. They talking about forcing ISPs to retain browsing data etc. so they can read your email.


 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 09:56pm 08 Aug 2014
Copy link to clipboard 
Print this post

This may be a silly question (and sorry if I have missed a previous post regarding it ) but when you update a MaxiMite to the latest version of firmware, what RTC functions & options do you have?

Specifically:

1> Does the firmware talk to a DS1307 and/or a PCF8563?

2> If the answer is that it still talks to a DS1307 (as original MaxiMite firmware) then do the GET & SET RTCTIME commands work on the DS1307? OR are they not in the MaxiMite update?

3> If the answer to <1> above is the PCF8563, then why are people talking about the DS1307?

Appreciate people's actual experiences who have updated the MaxiMite to the latest firmware . . . .

WW

For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9077
Posted: 10:51pm 08 Aug 2014
Copy link to clipboard 
Print this post

The 1307 RTC is a drifty RTC. While that can be fixed easily via the TIME$ and DATE$, the 2323 or 3231 does not need a crystal(it's inside the chip itself), and is extremely accurate to the point that I think I remember reading that the drift is no more then one second per year once set.

I could use the 1307, sure.
But the 3232 is a better choice.

The trade-off is cost. The 1307 is cheap, the GENUINE 3232 is not(relatively speaking). I fully understand why the 1307 was used in the MM by Geoff - cost, and that is fine.
Smoke makes things work. When the smoke gets out, it stops!
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 11:11pm 08 Aug 2014
Copy link to clipboard 
Print this post

@grogs.

I'm OK with RTC advantages/disadvantages when selecting a part. However, I would appreciate any feedback from anyone in connection to the above questions as they concern what the upgraded MaxiMite firmware is designed to communicate with.

Has anyone used an RTC with an upgraded MaxiMite?






For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9077
Posted: 11:21pm 08 Aug 2014
Copy link to clipboard 
Print this post

Oh, I see - sorry.
I misunderstood.

Smoke makes things work. When the smoke gets out, it stops!
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 02:03am 09 Aug 2014
Copy link to clipboard 
Print this post

  WhiteWizzard said   This may be a silly question (and sorry if I have missed a previous post regarding it ) but when you update a MaxiMite to the latest version of firmware, what RTC functions & options do you have?

Good questions Phil, I'd like to know those answers too. I can't remember seeing any info on that from Geoff - but I could certainly be wrong. I've just read through the change-log again on the Maximite Basic V4.5 and there's no info regarding it.

Re your Q3 though - the 1307 can have its accuracy adjusted either with software or hardware. It's got 56 bytes of battery backed RAM that can be used to hold time correction info but you can also use a trimmer cap. The 8563 doesn't have RAM so you have to use a trimmer cap to adjust it for longer term accuracy.

Grogs (and others) favour the 3231 because of the inherent accuracy (different in different versions) and in-built oscillator, but they do they do cost more and I haven't seen a DIP version of them. Does a DIP version exist?

Greg

Edit: the 1307 is a 5v only chip too of course whereas the 8563 can be 5 or 3.3 - this may or may not matter depending on what you're doing. The Maximites normally do have 5v available but MicroMites might not.Edited by paceman 2014-08-10
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 02:39am 09 Aug 2014
Copy link to clipboard 
Print this post

According to the manufacturers data sheet, the DS3231 is only available as an SMD (16 SO package) - or as a 'BOB/module'.

As I mentioned before - I am happy about the pros & cons regarding device selection; Q3 is purely asking why people would use a DS1307 IF the firmware now only supports the PCF8563. This would mean bit-banging which is ok but why not use the PCF8563 if this is supported as there are no practical benefits (unless this is the only RTC in your possession at the time you need one).

Curiosity continues . . . .
WW
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 04:49am 09 Aug 2014
Copy link to clipboard 
Print this post

Hi White, here in U.S. I had trouble finding the PCF8563 as a module (bob with battery etc.). The only one I could find was from Olimex and Mouser had some inventory here. I did buy a couple of them and using the built in rtc function is very cool indeed. There are many 8563 modules on ebay, but not located in the US. The 3231 as a module is readily available here as is the 1307.
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 05:23am 09 Aug 2014
Copy link to clipboard 
Print this post

I will try and ask the same question again but this time in a slightly different way . . . .

Does a MaxiMite running firmware v4.5 expect to communicate with a 1307 RTC or a 8563 RTC (when using any inbuilt Time/Date features)?

The MaxiMite had hardware and software provisions for a DS1307.
However, v4.5 firmware for a MICROMite communicates specifically with a PCF8563.

So one last try: Which of these two RTCs is compatible (when using any in built commands) with a MaxiMite running firmware v4.5?

WW


For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 06:47am 09 Aug 2014
Copy link to clipboard 
Print this post

Geoff has kindly replied (while on holiday) to the above question.

For others interested, the Colour and TFT MaxiMites (with v4.5) still work with a DS1307 and their firmware file doesn't include the RTC GETTIME and RTC SETTIME commands.

The original monochrome Maximite and the DuinoMite do not have a built in real time clock and hence their firmware file includes support for a PCF8563 (and hence include the two RTC commands).

Cat deceased . . . .

WW
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 06:55am 09 Aug 2014
Copy link to clipboard 
Print this post

The original Maximite came without an RTC. There was a fair bit of activity with attaching an RTC early on. Usually it was a DS1307. Then the DS3231 was used when the Chronodot module appeared.

Then came the Colour Maximite with a built in RTC, the DS1307. This was only accessible with the commands Time$= and Date$= to set the DS1307. On power up, if the DS1307 was found then it was read and the MMBasic clock was set. The functions Time$ and Date$ were available to read the MMBasic clock. You couldn't directly I2C to the DS1307 even if you tried. It was on an I2C bus that was not directly addressable via MMBasic.

Along came V4.5 which gave compatibility with the MicroMite. This included RTC Settime and RTC Gettime for an I2C attached PCF8563.

The only Maximite I have is the original so I can't give you actual experiences. However, it is unlikely that the DS1307 in the Colour Maximite would be forgotten so I assume that the Time$= and Date$= commands still set the DS1307.

Unless someone with a Colour Maximite has taken the trouble to attach a PCF8563 (why would you) then you aren't going to get a definitive answer until GeoffG surfaces.

As for packaging, the DS3231M is available as 8 or 16 pin SO. The DS3231N is available as a 16 pin SO. These are all pin compatible if your board is built for 16 pins as the 16 pin versions only use pins 1 to 4 and 13 to 16. The DS3232 uses a 20 pin SO package. The DS3234 uses SPI instead of I2C in a 20 pin SO package.

The DS3231N has tighter drift specs than the DS3231M. I had a quick look around and every one of those cheap DS3231 eBay modules was using the 16 pin N version.
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 07:12am 09 Aug 2014
Copy link to clipboard 
Print this post

Geoff has sent another reply when I asked him for confirmation of my understanding to his original email.
[quote]Ah, I forgot about that.

All Maximites (Colour, TFT, Duinomite, Monochrome, etc) have the RTC commands. So you can use the PCF8563 with them.

Geoff[/quote]

So the answer to my question is that either RTC can be connected; but the RTC commands only talk to the PCF8563.




For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9077
Posted: 03:18pm 09 Aug 2014
Copy link to clipboard 
Print this post

@ BobD - Very nice summary. Well done.
Smoke makes things work. When the smoke gets out, it stops!
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 01:36pm 12 Aug 2014
Copy link to clipboard 
Print this post

Hi Jman,

I am messing with the RTC for a project. Quick question on your DS3231 code you posted in this thread. When you open the I2C and read the registers, it looks like you get the value for day of week when you read RTCBUFF(3).

When you do the following...

'Calculate Day Of Week TZAdvantage's DOW Calculation
Sub DayOfWeek
A = Int(14-Val(Mid$(Date$,4,2)))/12
M = Val(Mid$(Date$,4,2)) + 12*a - 2
Y = Val(Mid$(Date$,7,4)) -a
D = Val(Mid$(Date$,1,2))
Dow=(day+y+Int(y/4)-Int(y/400)+Int(31*m/12)) Mod 7
End Sub

...are you doing this to calculate the day of week for initially writing it to the DS3231? For the life of me, I cannot see where the variable Dow is being used. What am I not getting here?

Thanks for your help!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9077
Posted: 01:57pm 12 Aug 2014
Copy link to clipboard 
Print this post

DOW is not used in the sub, but is calculated within the sub.

Once the sub returns, DOW will contain the value of the day of the week from 0 to 7 representing the actual day that it is.

You need this code at the top of your code:


dim DOW$(6) length 9
DOW$(0)="Sunday":DOW$(1)="Monday":DOW$(2)="Tuesday":DOW$(3)= "Wednesday"
DOW$(4)="Thursday":DOW$(5)="Friday":DOW$(6)="Saturday"


This will setup the days as an array.

Then all you have to do ONCE THE DOW SUB RETURNS, is:

Print DOW$(DOW) - that will print the day with respect to the value of DOW as calculated by the sub.

EDIT: DOW is not used by default in the MM RTC, but I understand that the likes of the 3231/3232 do have a DOW register. However, it is just as easy to calculate the DOW from the current RTC setting, so that is how I do it - with the help of TZA's sub.Edited by Grogster 2014-08-14
Smoke makes things work. When the smoke gets out, it stops!
 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 03:57pm 12 Aug 2014
Copy link to clipboard 
Print this post

Grogs
refer the datasheet for DS3231.
Day of the week number is in the range of Sunday=1 to Saturday=7
Bob
 
     Page 2 of 3    
Print this page
© JAQ Software 2024