rv3032c7_pi
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
rv3032c7_pi [2025/02/01 05:15] – created admin | rv3032c7_pi [2025/02/01 05:21] (current) – [Install Requirements] admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Micro Crystal RV-3032-C7 on Raspberry Pi ====== | ====== Micro Crystal RV-3032-C7 on Raspberry Pi ====== | ||
+ | |||
+ | {{ :: | ||
+ | |||
+ | {{ :: | ||
===== Enable i2c ===== | ===== Enable i2c ===== | ||
- | in / | + | in '' |
- | < | + | '' |
- | dtparam=i2c_arm=on | + | |
- | </ | + | |
reboot | reboot | ||
On a Pi5, also disable the onboard rtc: | On a Pi5, also disable the onboard rtc: | ||
- | < | ||
- | dtparam=rtc=off | ||
- | </ | ||
+ | '' | ||
===== Install Requirements ===== | ===== Install Requirements ===== | ||
- | < | ||
- | sudo apt-get install python-smbus i2c-tools | ||
- | </ | ||
+ | '' | ||
===== Confirm Presence ===== | ===== Confirm Presence ===== | ||
< | < | ||
Line 63: | Line 61: | ||
</ | </ | ||
+ | ====== dmesg ====== | ||
+ | < | ||
+ | $ sudo dmesg | grep rtc | ||
+ | [ 2.837650] rtc-rv3032 1-0051: registered as rtc0 | ||
+ | [ 2.839127] rtc-rv3032 1-0051: setting system clock to 2025-02-01T05: | ||
+ | </ | ||
===== Disable Fake hwclock ===== | ===== Disable Fake hwclock ===== | ||
Line 104: | Line 108: | ||
< | < | ||
- | ds3231-i2c-1-68 | + | rpi_volt-isa-0000 |
- | Adapter: | + | Adapter: |
- | temp1: | + | in0: N/A |
cpu_thermal-virtual-0 | cpu_thermal-virtual-0 | ||
Adapter: Virtual device | Adapter: Virtual device | ||
- | temp1: | + | temp1: |
- | </ | + | |
- | ===== Directly ===== | + | rv3032-i2c-1-51 |
- | < | + | Adapter: Synopsys DesignWare I2C adapter |
+ | temp1: | ||
- | ===== Python ===== | + | rp1_adc-isa-0000 |
- | < | + | Adapter: ISA adapter |
- | import smbus | + | in1: 950.00 mV |
- | import os | + | in2: 2.39 V |
- | + | in3: 1.40 V | |
- | bus = smbus.SMBus(1) | + | in4: 1.43 V |
- | address = 0x68 | + | temp1: |
- | + | ||
- | os.system(' | + | |
- | def getTemp(address): | + | |
- | | + | |
- | byte_tlsb = bin(bus.read_byte_data(address, | + | |
- | return byte_tmsb+int(byte_tlsb[0])*2**(-1)+int(byte_tlsb[1])*2**(-2) | + | |
- | + | ||
- | #print getTemp(address) | + | |
- | Celsius = getTemp(address) | + | |
- | Fahrenheit = 9.0/5.0 * Celsius + 32 | + | |
- | print Fahrenheit, "*F /", Celsius, " | + | |
- | os.system(' | + | |
</ | </ | ||
- | Save as a .py file (e.g. ds3231_temp.py) and run with '' | + | ===== Directly ===== |
+ | < | ||
+ | 21312</ | ||
- | You may need to install '' | ||
rv3032c7_pi.1738386946.txt.gz · Last modified: 2025/02/01 05:15 by admin