spectraphilic / wsn_riot

RIOT OS for WSN application at UiO
0 stars 0 forks source link

RTC DS3231S(N) #4

Closed jdavid closed 3 years ago

jdavid commented 3 years ago

The Waspmote v12 has the DS3231SN RTC, and RIOT has support for the DS3234:

$ BOARD=waspmote-pro FFLAGS_EXTRA="-F" make -C tests/driver_ds3234 all flash
[...]
$ BOARD=waspmote-pro FFLAGS_EXTRA="-F" make -C tests/driver_ds3234  term
[...]
2020-10-05 16:58:21,493 # 

2020-10-05 16:58:21,557 # main(): This is RIOT! (Version: 2020.10-devel-1797-gbe935)
2020-10-05 16:58:21,589 # DS3234 RTC PPS test application
2020-10-05 16:58:21,589 # 
2020-10-05 16:58:21,605 # Init #0... [OK]
2020-10-05 16:58:21,621 # DS3234 init done.
2020-10-05 16:58:21,622 # 
2020-10-05 16:58:21,701 # Check SQW pin on all connected DS3234 for a 1 Hz square wave signal
2020-10-05 16:58:21,701 # 

There's no test target for this test program, so not sure whether this really works.

Note: We don't use v12 but the waspmote-pro board in RIOT was developed for v12, so to have periph_rtc support in waspmote-pro we will likely need to get DS3231SN working.

jdavid commented 3 years ago

The Feather M0 has the DS3231S RTC, see https://www.adafruit.com/product/3028 While the Waspmote v12 has the DS3231SN. From the datasheet the difference is the operating temperature range:

So for our purposes we should use the SN version.

More important right now, RIOT has a driver for the DS3234S(N) clock, the main differences with the DS3231 are:

So we cannot use the RIOT driver as it is, because of the different bus.

Links:

jdavid commented 3 years ago

Good news there's already a PR for the DS3231, see https://github.com/RIOT-OS/RIOT/pull/15245

jdavid commented 3 years ago

Closing since RIOT PR has been merged.

Also I found that the feather-m0 already has a RTC included, and that it works with RIOT. I think the RTC is in the MCU (samd21), and so it must work as well with other boards such as the Arduino zero.