Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 20:40 17 Sep 2025 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 : RTC GetTime/ RTC SetTime

Author Message
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 03:45pm 25 Dec 2015
Copy link to clipboard 
Print this post

Hi All

So I noticed that when using I2C and you use the built in RTC commands
after the command ie RTC GetTime or RTC SetTime
the I2C is ALLWAYS closed and a new Open command is required.
So is this known / Bug or by design


I2C Open 100,100
RTC GetTime
I2C Write &H44, 0, 2, &H01 ,&H00
End


The code above Produces

[14] I2C Write &H44, 0, 2, &H01 ,&H00
Error: Not enabled

While the following works as expected

RTC GetTime
I2C Open 100,100
I2C Write &H44, 0, 2, &H01 ,&H00
End


This is also applies to the RTC SetTime command

Regards
Jman

 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9643
Posted: 04:03pm 25 Dec 2015
Copy link to clipboard 
Print this post

Interesting.

I get the same problem with your test code, so it might be an elusive bug perhaps?

Manual says(page 63):
  MMBASIC Manual said  If the I2C bus is already open the RTC command will use the current settings, otherwise it will temporarily open the connection with a speed of 100KHz.


This suggests that the command will use the current I2C settings, but it would indeed seem that the I2C port is being closed by the GetTime command - odd.

Watching this thread with interest....
Smoke makes things work. When the smoke gets out, it stops!
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3303
Posted: 06:12pm 25 Dec 2015
Copy link to clipboard 
Print this post

It is a bug and now that it has been pointed it out I can see it in the source - as obvious as the nose on my face!

I will fix it in the next release. Thanks Jman and Grogs.

Geoff
Geoff Graham - http://geoffg.net
 
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025