-
Notifications
You must be signed in to change notification settings - Fork 901
Description
Hello everyone,
I've implemented a Yocto image with support AD7195 on OrangePi. when I get grep from dmesg, it shows:
root@orange-pi-pc:/home# dmesg | grep spi [ 1.226245] ad7192 spi0.0: device ID query failed (0x7 != 0x6)
I don't know, why it turn back 7 instead of 6. In addition, I use the ac excitation that the ground section is connected to BPDSW in order to switch GND when we measuring, but it wasn't work. this pin stuck voltage on 3.8v, so when the Board is going to measure the input channel, which is connected to a load cell, BPDSW pin must switch to gnd but it had not happen. Let me to share the iio directory that might be helpful:
root@orange-pi-pc:/home# ls /sys/bus/iio/devices/iio\:device0
ac_excitation_en in_voltage1_offset in_voltage3_sys_calibration
bridge_switch_en in_voltage1_raw in_voltage3_sys_calibration_mode
buffer in_voltage1_sys_calibration in_voltage4_offset
buffer0 in_voltage1_sys_calibration_mode in_voltage4_raw
current_timestamp_clock in_voltage2-voltage2_offset in_voltage4_sys_calibration
dev in_voltage2-voltage2_raw in_voltage4_sys_calibration_mode
filter_low_pass_3db_frequency in_voltage2-voltage2_sys_calibration in_voltage_scale
filter_low_pass_3db_frequency_available in_voltage2-voltage2_sys_calibration_mode in_voltage_scale_available
in_temp0_offset in_voltage2_offset in_voltage_sys_calibration_mode_available
in_temp0_raw in_voltage2_raw name
in_temp_scale in_voltage2_sys_calibration of_node
in_voltage-voltage_scale in_voltage2_sys_calibration_mode power
in_voltage-voltage_scale_available in_voltage3-voltage4_offset sampling_frequency
in_voltage-voltage_sys_calibration_mode_available in_voltage3-voltage4_raw scan_elements
in_voltage1-voltage2_offset in_voltage3-voltage4_sys_calibration subsystem
in_voltage1-voltage2_raw in_voltage3-voltage4_sys_calibration_mode trigger
in_voltage1-voltage2_sys_calibration in_voltage3_offset uevent
in_voltage1-voltage2_sys_calibration_mode in_voltage3_raw waiting_for_supplier
root@orange-pi-pc:/home#
the load cell is connected to ain3,4. So I wrote a bash script to illustrate the the each pins, I mean ain3 , ain4 and ain3-ain4.
I upload into zip file.
and this is log of the sh file that I ran on the board:
root@orange-pi-pc:/home# ./ad7195-v34.sh
===AD7195 Load Cell Weight Monitor===
1. Normal Mode
2. Calibration Mode
Select mode (1 or 2): 1
scale Factor(0.000298020 0.000149010 0.000074500 0.000037250 0.000018620 0.000009310 0.000004650 0.000002320): 0.000018620
sampling Feq: 1000
scale-v: 0.000018620 , scale-vv: 0.000018620
sampling_frequency: 1200
Starting weight monitoring...
[19:49:49] #0001 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:49] #0002 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:49] #0003 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:49] #0004 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:50] #0005 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:50] #0006 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:50] #0007 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:50] #0008 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:50] #0009 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:50] #0010 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:51] #0011 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:51] #0012 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:51] #0013 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:51] #0014 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:51] #0015 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:51] #0016 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:51] #0017 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:52] #0018 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:52] #0019 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:52] #0020 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:52] #0021 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:52] #0022 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:52] #0023 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:52] #0024 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:53] #0025 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
[19:49:53] #0026 | Raw: 16777215 | Weight: 8388107.50 kg| R3: 16777215 | R4: 16777215
the "Raw" is actually the "in_voltage3-voltage4_raw". I thought, this parameter should be zero due to R3,R4's value. I don't know what is the major issue I have to struggle with.
I would be grateful if you could let me know exactly where the problem originates---whether it is due to hardware, software, or even a defective implementation of the Linux kernel.