![]() ![]() You can clear it by setting register 0x8E to 0 in code, or by simply removing the battery and re-inserting it (The default value for the register is off) We have had a few of these modules where this write protect has been turned on. Note: If you find you cannot set the date and time, there is a write protect register value which needs to be cleared (register 0x8E). Luckily for us, an article in the Sept 2012 issue of Everyday Practical Electronics (EPE) discusses using this chip with the Raspberry Pi and provides a nice program (written in C) which can be used to set the RTC date and time on the module and also to read the date and time and set the Raspberry Pi's date and time. The DS1302 chip uses a slightly quirky serial interface which we won't go into here, but it is all detailed in the datasheet. The module uses the DS1302 Real Time Clock IC and you can read the DS1302 Datasheet here We have a great module ( DS1302 Real Time Clock Module with Battery Backup) which is perfect for the Raspberry Pi as it runs at 3V so no logic level conversion is required and has a built in battery backup. If you are not connected to the internet, then you may want to connect your Raspberry Pi to a Real Time Clock chip which has a battery backup so that the date and time are kept accurate. This stands for Network Time Protocol and means that if your Raspberry Pi is connected to the internet it should periodically update its internal clock to that of one of the many clock servers out on the internet. ![]() The Raspian "wheezy" installation that we have been using has NTP installed. ![]() ![]() When you boot up your Raspberry Pi it will have forgotten what the current date and time was and will default (on mine at least) to 30 November 1999. To keep costs down, one of the bits of hardware omitted from the Raspberry Pi is a Real Time Clock (RTC). Raspberry Pi Real Time Clock Module DS1302 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |