User Tools

Site Tools


rv3032c7_pi


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rv3032c7_pi [2025/02/01 05:16] – [Enable i2c] adminrv3032c7_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 ======
 +
 +{{ ::rv-3032-c7_app-manual.pdf}}
 +
 +{{ ::rv-3032-c7_datasheet.pdf}}
 ===== Enable i2c ===== ===== Enable i2c =====
-in /boot/config.txt (or use ''raspi-config'')+in ''/boot/config.txt'' (or use ''raspi-config'')
  
-<code> +''dtparam=i2c_arm=on''
-dtparam=i2c_arm=on +
-</code>+
  
 reboot reboot
  
 On a Pi5, also disable the onboard rtc: On a Pi5, also disable the onboard rtc:
-<code> 
-dtparam=rtc=off 
-</code> 
  
 +''dtparam=rtc=off''
 ===== Install Requirements ===== ===== Install Requirements =====
-<code> 
-sudo apt-get install python-smbus i2c-tools 
-</code> 
  
 +''sudo apt-get install python-smbus i2c-tools''
 ===== Confirm Presence ===== ===== Confirm Presence =====
 <code> <code>
Line 63: Line 61:
 </code> </code>
  
 +====== dmesg ======
 +<code>
 +$ 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:17:05 UTC (1738387025)
 +</code>
 ===== Disable Fake hwclock ===== ===== Disable Fake hwclock =====
  
Line 104: Line 108:
  
 <code> <code>
-ds3231-i2c-1-68 +rpi_volt-isa-0000 
-Adapter: bcm2835 (i2c@7e804000) +Adapter: ISA adapter 
-temp1       +30.8°C+in0             N/A
  
 cpu_thermal-virtual-0 cpu_thermal-virtual-0
 Adapter: Virtual device Adapter: Virtual device
-temp1:        +48.9°C +temp1:        +31.4°C
-</code>+
  
-===== Directly ===== +rv3032-i2c-1-51 
-<code>cat /sys/class/i2c-dev/i2c-1/device/1-0068/hwmon/hwmon2/temp1_input</code>+Adapter: Synopsys DesignWare I2C adapter 
 +temp1:        +21.3°C
  
-===== Python ===== +rp1_adc-isa-0000 
-<code> +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:        +36.9°C
- +
-os.system('sudo rmmod rtc_ds1307') +
-def getTemp(address): +
-   byte_tmsb = bus.read_byte_data(address,0x11) +
-   byte_tlsb = bin(bus.read_byte_data(address,0x12))[2:].zfill(8) +
-   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, "*C" +
-os.system('sudo modprobe rtc_ds1307')+
 </code> </code>
  
-Save as a .py file (e.g. ds3231_temp.py) and run with ''sudo python ds3231_temp.py''+===== Directly ===== 
 +<code>$cat /sys/class/i2c-dev/i2c-1/device/1-0051/hwmon/hwmon3/temp1_input 
 +21312</code>
  
-You may need to install ''python-smbus''. 
  
rv3032c7_pi.1738386962.txt.gz · Last modified: 2025/02/01 05:16 by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki