[EN] machine.RTC

This article takes a detailed look at the Micropython machine.RTC class. The main function of this class is designed to be an RTC (Real-Time Clock) inside the microcontroller for storing date and time. It is more convenient when used with ESP8266 or ESP32 chip because NTP can be accessed to read the date and time from the internet and then store the value into the RTC to enable the accuracy and do not require frequent internet access to read the values ​​again. This saves the use of external RTC circuits as well.

[EN] Arduino : RTC DS1302

From the article programming Python on Micropython to use RTC number DS1302, this time, we change the programming language to C++ for Arduino by using STM32F030F4P6 Cortex-M0, esp8266 and Arduino Mega as a worker instead of ESP32 as shown in Figures 1, 2 and 6 by show the report on the RS232 port to display the date and time as shown in Figure 4.

(Figure. 1 DS1302 experiment with STM32F30F4_6.)

[TH] machine.RTC

บทความนี้นำรายละเอียดของคลาส machine.RTC ของ Micropython มาเรียนรู้กัน โดยหน้าที่หลักของคลาสนี้คือ ออกแบบมาเพื่อเป็น RTC (Real-Time Clock) หรือนาฬิกาฐานเวลาจริง ภายในไมโครคอนโทรลเลอร์สำหรับเก็บวันที่และเวลาจึงทำให้สะดวกมากขึ้นเมื่อใช้งานร่วมกับชิพ ESP8266 หรือ ESP32 เนื่องจากสามารถเข้าถึง NTP เพื่ออ่านวันที่และเวลาจากอินเทอร์เน็ตหลังจากนั้นนำค่ามาเก็บลง RTC ทำให้มีวันที่และเวลาที่ถูกต้องพร้อมทั้งไม่ต้องเข้าถึงอินเทอร์เน็ตบ่อย ๆ เพื่ออ่านค่าดังกล่าวอีกครั้ง ซึ่งประหยัดการใช้วงจร RTC ภายนอกอีกด้วย

[TH] Arduino : RTC DS1302

จากบทความการเขียนโปรแกรมภาษาไพธอนบน Micropython เพื่อใช้งาน RTC เบอร์ DS1302 ในคราวนี้เปลี่ยนภาษาการเขียนโปรแกรมเป็น C++ สำหรับ Arduino โดยใช้ไมโครคอนโทรลเลอร์ Cortex-M0 เบอร์ STM32F030F4P6 / esp8266 และ Arduino Mega เป็นตัวทำงานแทน ESP32 ดังภาพที่ 1, 2 และ 6 โดยรายงานการทำงานออกทางพอร์ต RS232 เพื่อแสดงวันและเวลาตามตัวอย่างผลลัพธ์ในภาพที่ 4

ภาพที่ 1 การทดลอง DS1302 กับ STM32F30F4_6

[TH] RTC DS1302 and Micropython

บทความนี้อธิบายการเขียนโปรแกรมเพื่อใช้งาน DS1302 (ภาพที่ 1) ซึ่งเป็นไอซีที่ทำหน้าที่เป็น RTC (Real-Time Clock) อีกตัวหนึ่ง (ก่อนหน้านี้ได้เขียนถึง PCF8583 ด้วยภาษาไพธอนและ Arduino C++) และเป็นโมดูลที่นิยมใช้ในการเริ่มต้นศึกษาเนื่องจากเป็นโมดูลในชุดเรียนรู้ทั้งของ Arduino, IoT, 37-Sensors หรือ 45 Sensors เป็นต้น

ภาพที่ 1 ตัวอย่างการต่อใช้โมดูล ds1302

[TH] RTC PCF8583

จากบทความภาษาไพธอนสำหรับใช้งานบอร์ด pcf8583 ที่ทำหน้าที่เป็น RTC (Real-time clock) ทางทีมเราเลยนำโค้ดมาเขียนใหม่เพื่อใช้กับภาษา C++ ของ Arduino โดยทดสอบกับ esp8266, esp32 และ stm32

[TH] ESP8266+PCF8583

บทความนี้เป็นการเขียนโปรแกรมภาษา Python ของ MicroPython เพื่อตั้งค่า/อ่านค่าวันที่และเวลาของ pcf8583 ซึ่งเป็น RTC ที่พวกเราชอบใช้ ซึ่งพวกเราพบว่ามีตัวอย่างที่เป็นภาษาไพธอนค่อนข้างน้อยจึงนำโค้ดตัวอย่างที่ทำไว้ออกมาให้ได้ลองศึกษากัน

ภาพที่ 1 บอร์ด ET-mini PCF8583