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 : "BBVs"
Author | Message | ||||
Zonker Guru Joined: 18/08/2012 Location: United StatesPosts: 761 |
I was wanting to store data in the onboard RTC's 32 bytes of RAM for varibles that would be changing to much to keep saving to the MM's flash memory. (a:) Is it "OK" to access the RTC chip while running programs. I assume the MM firmware reads RTC data during INIT and keeps time internally. Not sure though... I should be able to write a function to get and store to the RTC RAM areas. So, I thought it might be wise to ask if anyone has done this before..? Just downloaded the 1307 PDF... will try to get something going... Thanks in advance for any advise on this..!! BBV's (BatteryBackedVariables) nice.. |
||||
ajkw Senior Member Joined: 29/06/2011 Location: AustraliaPosts: 290 |
I can read and write, both time/date and GP Ram, to my DS1302 on my MM at all times but I am informed you cannot access the DS1307 RTC GP Ram on the CMM from basic. If of course you connect the DS1307 to the regular I/O pins (instead of the hardwired pins on the CMM) you will be able to access the RAM. Search the forum, you may even find the basic code to do so. Anthony. |
||||
CircuitGizmos Guru Joined: 08/09/2011 Location: United StatesPosts: 1425 |
Yes the CMM RTC is only accessed by the firmware. It is not accessible through MMBasic. Micromites and Maximites! - Beginning Maximite |
||||
ajkw Senior Member Joined: 29/06/2011 Location: AustraliaPosts: 290 |
I would like to suggest an extra parameter be added to the I2CEN command that allows subsequent I2C communication be directed to the CMM RTC on RA2 & 3 instead of other I2C devices on I/O lines 12 and 13. I2CEN speed, timeout [,int][,RTC] |
||||
CircuitGizmos Guru Joined: 08/09/2011 Location: United StatesPosts: 1425 |
If this is going to be done, then it makes sense to call it something like channel 2, rather than RTC, as that set of I2C pins could connect to more than just the RTC. Micromites and Maximites! - Beginning Maximite |
||||
ajkw Senior Member Joined: 29/06/2011 Location: AustraliaPosts: 290 |
Yes I considered that and yes it would a second channel that could be used for other I2C devices but I figured that it is the hardwired RTC 'channel' and that RTC was short, sweet and described the destination of the comms. Do the CMM and CG boards allow the easy hardware connection of other devices to the tracks? I am not particularly fussed really what the parameter is potentially called, maybe a [,2] would do. |
||||
CircuitGizmos Guru Joined: 08/09/2011 Location: United StatesPosts: 1425 |
Access to the I2C channel that the RTC uses is a feature of the next spin of CG hardware. I had thought about the suggestion of making the 'system' I2C bus accessible via BASIC as you have. Perhaps putting some specific peripherals on it. I have not gotten over the hurdle of suggesting what such peripherals might be. A large EEPROM? I guess I can't come up with anything exciting enough to justify it yet. Micromites and Maximites! - Beginning Maximite |
||||
BobD Guru Joined: 07/12/2011 Location: AustraliaPosts: 935 |
Making the DS1307 accessible to MMBasic would allow storing information in the chips 56 byte NV storage. Sort of semi long term storage unaffected by firmware reloads etc. For example, it could have an owner ID string in there or ..... |
||||
ajkw Senior Member Joined: 29/06/2011 Location: AustraliaPosts: 290 |
Definitely Bob, just what Zonker who started this topic and I are after. This chip from Siemens SDE 2526 or something similar could also be useful to safety accumulate data before a bulk write to a SD card. (refer topic 5Hz GPS Logging*). I think such a thing would be better on a 'internal' I2C bus than the external I/O lines. *I think the amount data on this project could exceed the capabilities of the chip but it is an example. |
||||
CircuitGizmos Guru Joined: 08/09/2011 Location: United StatesPosts: 1425 |
Then something like a non-volatile RAM chip would be a great 'system' device. Perhaps a selected FRAM chip could be supported by the firmware. Micromites and Maximites! - Beginning Maximite |
||||
ajkw Senior Member Joined: 29/06/2011 Location: AustraliaPosts: 290 |
Just searching, have found FM24VN10 - 1Mb Serial 3V F-RAM Memory From Fujitsu MB85RC128 MB85RC64 MB85RC64V MB85RC16 MB85RC16V MB85RC04V No doubt there is more. |
||||
CircuitGizmos Guru Joined: 08/09/2011 Location: United StatesPosts: 1425 |
MB85RC128 was my first choice... Micromites and Maximites! - Beginning Maximite |
||||
ajkw Senior Member Joined: 29/06/2011 Location: AustraliaPosts: 290 |
That is a lot of non-BB BBV's "Perhaps a selected FRAM chip could be supported by the firmware." - perhaps but is the firmware busy enough on a already very busy PIC32? Just getting to it with current I2C commands would do. |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
It would be a good idea but unfortunately the I2C code is rather complex and uses a variety of ways to access the I2C hardware that makes it hard to switch between I2C ports. I did not write this code and the chance of introducing a subtle bug is high, so it would be best not to fiddle with it. Geoff Geoff Graham - http://geoffg.net |
||||
ajkw Senior Member Joined: 29/06/2011 Location: AustraliaPosts: 290 |
Thanks for the explanation Geoff. A workaround, would hardwiring I/O 11&12 to RA2&3 be likely to cause any (known) problems? (In doing so I would consider 11&12 reserved from any other use.) |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
At a guess, that could work. It certainly would not cause any harm. Geoff Geoff Graham - http://geoffg.net |
||||
Zonker Guru Joined: 18/08/2012 Location: United StatesPosts: 761 |
Thanks for all the good feedback on this issue. I figure it's probably just as well not to be mucking around with the RTC code. I was just hoping to get a few bytes of storage for elapsed engine hours... I looked around and happend to stumble apon an IC from Maxum that does the trick for engine runtime. The DS1682 Keeps track of elapesed time and cycles, with settable alarm and has 10 bytes of storage to boot..! Just wanted to let everyone know... |
||||
Print this page |