Jump to content

Arjan van Vught

  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. https://www.adafruit.com/product/3295 -> The PCF8523 is simple and inexpensive but not a high precision device. It may lose or gain up to 2 seconds a day.
  2. This topic is about the missing RTC crystal on the OPi board. And therefore we cannot use the RTC in the SoC. When you would like to build an expansion board then for examples; check the dataset for: DS3231 or Google for: rtc i2c board
  3. When there is a crystal placed on the OPi board itself, then there is no need for a hat. Of course, we also need a proper battery connector -> removing the WiFi chip for making some space.
  4. That's a shame as I am using the Orange Pi Zero LTS 256MB and the Orange Pi One boards only. I will try to contact Steven and ask if it is doable getting the external 32768 crystal on the(se) H2+/H3 boards.
  5. See the remarkable output below. Many observations and some questions: The internal RTC seems to be useless with the internal OSC. The internal RTC gets updated; once every ? seconds. From which source? What is the source for the date command? Specific which ARM Counter or with SoC Timer? This test is with an Internet connection; hence the system clock gets updated with the NTP Client. Interesting to know what happens with no Internet connection. pi@orangepizero:~$ cat ./rtc_test.sh while true do ./devmem2 0x01f00014 | tail -n 1 |rev|cut -f1 -d' '|rev | ./convert echo `date +"%H:%M:%S"` echo ============== sleep 120 done /* * convert.c */ #include <stdio.h> #include <stdlib.h> #define TIME_GET_SEC_VALUE(x) ((x) & 0x0000003f) #define TIME_GET_MIN_VALUE(x) (((x) & 0x00003f00) >> 8 ) #define TIME_GET_HOUR_VALUE(x) (((x) & 0x001f0000) >> 16) int main(void) { unsigned num; fscanf(stdin, "%x", &num); printf("%.2d:%.2d:%.2d\n", TIME_GET_HOUR_VALUE(num), TIME_GET_MIN_VALUE(num), TIME_GET_SEC_VALUE(num)); return EXIT_SUCCESS; }
  6. Therefore I am also showing the seconds from the date command. I will do another test. However, the apt update/upgrade I just did, it broke the startup.
  7. Simple test pi@orangepizero:~$ cat ./rtc_test.sh while true do ./dev2mem 0x01f00014 | tail -n 1 echo `date +"%S"` sleep 1 done pi@orangepizero:~$ sudo ./rtc_test.sh Value at address 0x1F00014 (0xb6ff7014): 0xF162D 22 Value at address 0x1F00014 (0xb6f63014): 0xF162E 23 Value at address 0x1F00014 (0xb6f09014): 0xF162F 24 Value at address 0x1F00014 (0xb6f4a014): 0xF1630 25 Value at address 0x1F00014 (0xb6f9f014): 0xF1632 26 Value at address 0x1F00014 (0xb6f0a014): 0xF1633 27 Value at address 0x1F00014 (0xb6ffb014): 0xF1634 28 Value at address 0x1F00014 (0xb6f8b014): 0xF1635 29 ^C Skipping a second here.
  8. So the check here https://github.com/armbian/linux/blob/sun8i/drivers/rtc/rtc-sunxi.c#L512 is basically wrong. The CTRL tells what has been set, and then AUTO_STA really tells the status. And the RTC goes into default internal with prescaler 0xF -> 16 MHz / 32 / 15 that is about 33KHz. Which is slightly faster than the desired 32768 Hz.
  9. This https://github.com/armbian/linux/blob/sun8i/drivers/rtc/rtc-sunxi.c#L499 is referencing to an external OSC.
  10. The internal clock (which is about 16MHz) does not give an accurate reference. So I did not try to use that option. I will check your source code for the configuration. Just reading the register directly and printing the value when the seconds have changed.
  11. Dear forum, When looking at the Orange Pi Zero schematic V1.1, the OSC-RTC box is empty. Does this mean that there is no crystal for the internal RTC? The internal RTC cannot be used at all? When just checking the time register, the RTC is running too fast. Thanks, Arjan
  12. Hi Rafa, I have low-level (no Linux) sample code here -> https://github.com/vanvught/rpidmx512/blob/master/lib-dmx/src/h3/dmx.c - Arjan
  13. See -> http://u-boot.10912.n7.nabble.com/SUNXI-CONFIG-VIDEO-SUNXI-is-never-set-td360711.html and -> http://u-boot.10912.n7.nabble.com/SUNXI-DE2-H3-Add-support-for-setenv-video-mode-td395068.html
  • Create New...