Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 16:00 29 Mar 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 : mono maximite RTC

Author Message
BobDevries

Senior Member

Joined: 08/06/2011
Location: Australia
Posts: 266
Posted: 12:25am 25 May 2020
Copy link to clipboard 
Print this post

Hi all.
I am trying to fit an RTC to a monochrome Maximite. However, I don't know where to connect to SDA and SCL signals.

I'm hoping to find them on the I/O socket, but which?

Regards,
Bob Devries
Dalby, QLD, Australia
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9030
Posted: 12:53am 25 May 2020
Copy link to clipboard 
Print this post

Hi.

I'm not sure if the original B/W Maximite supports I2C.
I know that the first one I came across did not support serial either.
I believe that Geoff added it(serial) later as a bit-banged option.
Can't remember if the likes of I2C and SPI were added later or not.
I have a feeling that the B/W Maximite IO pins were simply digital in, out, or some analog ones, but other then that....

Attached is the Maximite ZIP file including the manual and I/O pinout etc from Geoff's site(via the archive).


Maximite_MMBasic_V2.2.zip

EDIT: I am totally wrong.

This is V4.4 of the firmware, manuals etc, and I2C is indeed supported.  Open MMBasic manual PDF inside the zip, see Appendix B - I2C communications.....


Maximite_MMBasic_V4.4B.zip
Edited 2020-05-25 11:00 by Grogster
Smoke makes things work. When the smoke gets out, it stops!
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1584
Posted: 01:31am 25 May 2020
Copy link to clipboard 
Print this post

The latest manual for the Mono Maximite is available here. On page 14 of the manual it shows how to connect a I2C RTC.

Bill
Keep safe. Live long and prosper.
 
flasherror
Senior Member

Joined: 07/01/2019
Location: United States
Posts: 158
Posted: 02:37am 27 May 2020
Copy link to clipboard 
Print this post

As someone who is using Olimex's Duinomite Mega with v4.5 firmware (should be same as Maximite Mono) here are some notes on RTC:

1. RTC must be PCF8563 - search ebay for some cheap RTC modules. Connect using I2C pins and power using 3.3v. (I believe the I2C pins are only 3.3v tolerant, so you want to power from 3.3v and not 5v even though the RTC module can work on either voltage. If this is not correct someone please correct me)
Don't forget to install a battery! (Many RTC modules use CR1220)
Mono maximite can only use PCF8563, although I believe micromites can use other RTC chips.

2. On first power-on after you have connected the RTC
You need to set the RTC date/time using the RTC SETTIME command – this should be done once to set the RTC.

RTC SETTIME YY,MM,DD,HH,MM,SS
YY = last 2 year digits
MM = month number (prefix with 0 if less than 10)
DD = Day of Month (prefix with 0 if less than 10)
HH = Time Hour (24 hour format 00-23)
MM = Time Minute (00-59)
SS = Time Seconds (00-59)

3. An important thing to remember is that even though the RTC is connected, MMBasic does not automatically update the time and date variables on power-on - your program must do RTC GETTIME on program start to read RTC and set MMBasic time$ and date$ variables.

4. Similarity, Setting Date$ and Time$ alone will not set RTC time! (Use RTC SETTIME to set RTC clock)

5. If RTC is not connected, the use of RTC commands will abort to basic prompt with "Error: PCF8563 not responding" error. This is not trappable (as far as I know) and represents a potential point of failure for an unattended program if the RTC was not connected or malfunctioning (would be nice if it returned a error code instead of aborting!)

Hope this is helpful. Can someone please add this to fruitoftheshed, might be useful for others in the future.
Edited 2020-05-27 12:44 by flasherror
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5867
Posted: 03:42am 27 May 2020
Copy link to clipboard 
Print this post

  flasherror said  
5. If RTC is not connected, the use of RTC commands will abort to basic prompt with "Error: PCF8563 not responding" error. This is not trappable (as far as I know) and represents a potential point of failure for an unattended program if the RTC was not connected or malfunctioning (would be nice if it returned a error code instead of aborting!)


You can always query the RTC in Basic and check for errors before issuing the RTC commands.

i2caddr = &h51 ' PCF8563 I2C address
I2CEN 100,100 ' Enable I2C
I2CRCV i2caddr, 0, 7, RTCbuff(0),1,2
I2CDIS
print "0=ok 1=nack 2=timeout   "; MM.I2C


The code is 9 years old but worked well at the time.

Jim
VK7JH
MMedit   MMBasic Help
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024