Search found 15 matches
- Wed Feb 27, 2019 5:59 pm
- Forum: Interfacing (DSI, CSI, I2C, etc.)
- Topic: [SOLVED] I2C clock error when repeatedly using read_byte
- Replies: 1
- Views: 804
Re: I2C clock error when repeatedly using read_byte
If anyone cares, I've found what seems to be the answer to what's wrong: http://www.advamation.com/knowhow/raspberrypi/rpi-i2c-bug.html The Broadcomm processor has a glitchy I2C module that can't handle clock stretching apparently. I've implemented a workaround by splitting my data into nybbles and ...
- Fri Feb 22, 2019 1:40 pm
- Forum: Interfacing (DSI, CSI, I2C, etc.)
- Topic: [SOLVED] I2C clock error when repeatedly using read_byte
- Replies: 1
- Views: 804
[SOLVED] I2C clock error when repeatedly using read_byte
I made a python program that reads the I2C bus and I've encountered a problem that arises when using smbus.read_byte repeatedly. It uses the smbus library. I've found that the clock HIGH signal on the first data bit of the third byte (sensb_val_low) is too short, causing the bit to always be read as...
- Mon Aug 27, 2018 8:30 pm
- Forum: Interfacing (DSI, CSI, I2C, etc.)
- Topic: Troubleshooting quick2wire for i2c communication
- Replies: 11
- Views: 2344
- Mon Aug 27, 2018 4:37 pm
- Forum: Interfacing (DSI, CSI, I2C, etc.)
- Topic: Troubleshooting quick2wire for i2c communication
- Replies: 11
- Views: 2344
Re: Troubleshooting quick2wire for i2c communication
That works! I am now able to read from the chip. Thank you a lot. One small problem, though: the program is supposed to run at startup but without turning on the gpio demon first in the console, it won't run. Is there a way to do this from my program?
- Fri Aug 24, 2018 8:53 pm
- Forum: Interfacing (DSI, CSI, I2C, etc.)
- Topic: Troubleshooting quick2wire for i2c communication
- Replies: 11
- Views: 2344
Re: Troubleshooting quick2wire for i2c communication
Wow! Thanks for your dedication. That code only works after I start the pigpio daemon in the console but after that it prints 'bytearray(b'\x1d\xf4eL')' once followed by 'bytearray(b']\xf4eM')' once per second ad infinitum.
- Fri Aug 24, 2018 7:36 pm
- Forum: Interfacing (DSI, CSI, I2C, etc.)
- Topic: Troubleshooting quick2wire for i2c communication
- Replies: 11
- Views: 2344
Re: Troubleshooting quick2wire for i2c communication
That returned the following: 4 26 128 101 200 I'm curious to see if the last 4 bytes are good data. I assume the '4' is meaningless? How would I get quick2wire to default to the correct bus? EDIT: Running the last 4 bytes through a conversion program, it seems to be actual data, but slightly inaccur...
- Fri Aug 24, 2018 7:08 pm
- Forum: Interfacing (DSI, CSI, I2C, etc.)
- Topic: Troubleshooting quick2wire for i2c communication
- Replies: 11
- Views: 2344
Troubleshooting quick2wire for i2c communication
I'm using a raspberry pi zero to communicate with a Chipcap 2 temp/humidity sensor via i2c. I've followed users' advice to use quick2wire for i2c communication: https://github.com/quick2wire/quick2wire-python-api/blob/master/doc/getting-started-with-i2c.md I believe it installed properly. Just in ca...
- Fri Aug 24, 2018 5:47 pm
- Forum: Interfacing (DSI, CSI, I2C, etc.)
- Topic: 'bus.read_i2c_block_data' writes a 0 first then reads data
- Replies: 17
- Views: 5474
Re: 'bus.read_i2c_block_data' writes a 0 first then reads data
That's what I figured. Is there a way for me to edit the smbus code? I searched on my Pi but couldn't find anything.
EDIT: Thanks everyone, I'm going to take your advice and abandon smbus and use quick2wire. I'll start a new thread as well.
EDIT: Thanks everyone, I'm going to take your advice and abandon smbus and use quick2wire. I'll start a new thread as well.
- Thu Aug 23, 2018 6:08 pm
- Forum: Interfacing (DSI, CSI, I2C, etc.)
- Topic: 'bus.read_i2c_block_data' writes a 0 first then reads data
- Replies: 17
- Views: 5474
Re: 'bus.read_i2c_block_data' writes a 0 first then reads data
Thanks for finding that. It's very similar to my own code. Unfortunately I tried it and it spits out the same numbers as before. The code again reads 32 bytes from the device, all garbage.
- Thu Aug 23, 2018 5:26 pm
- Forum: Interfacing (DSI, CSI, I2C, etc.)
- Topic: 'bus.read_i2c_block_data' writes a 0 first then reads data
- Replies: 17
- Views: 5474
- Thu Aug 23, 2018 3:21 pm
- Forum: Interfacing (DSI, CSI, I2C, etc.)
- Topic: 'bus.read_i2c_block_data' writes a 0 first then reads data
- Replies: 17
- Views: 5474
Re: 'bus.read_i2c_block_data' writes a 0 first then reads data
I think this is a really simple problem: I just need to read four bytes using a repeated start condition. Can I do that with smbus or is there a python library that can do this? I'm sure I'm not the first person with this problem.
- Wed Aug 22, 2018 7:46 pm
- Forum: Interfacing (DSI, CSI, I2C, etc.)
- Topic: 'bus.read_i2c_block_data' writes a 0 first then reads data
- Replies: 17
- Views: 5474
Re: 'bus.read_i2c_block_data' writes a 0 first then reads data
This causes it to read 32 bytes now. I don't have it connected to the scope anymore but I'm getting the same nonsense numbers indicating it's writing a 0 first.stevend wrote: ↑Wed Aug 22, 2018 7:30 pmIf I've found the right reference, your line should be:
Code: Select all
block = bus.read_i2c_block_data(sens_addr, 4) #read 4 bytes
- Wed Aug 22, 2018 7:07 pm
- Forum: Interfacing (DSI, CSI, I2C, etc.)
- Topic: 'bus.read_i2c_block_data' writes a 0 first then reads data
- Replies: 17
- Views: 5474
Re: 'bus.read_i2c_block_data' writes a 0 first then reads data
Edited the top post. Is that enough?
- Wed Aug 22, 2018 6:49 pm
- Forum: Interfacing (DSI, CSI, I2C, etc.)
- Topic: 'bus.read_i2c_block_data' writes a 0 first then reads data
- Replies: 17
- Views: 5474
'bus.read_i2c_block_data' writes a 0 first then reads data
I've been frustrated with my efforts to read a temp/humidity sensor, so I connected my board to a scope and read the data being transferred. When I use the command read_i2c_block_data(addr, 0, 4), I noticed that the raspberry pi first writes a '0' to the device, then immediately reads 4 bytes in suc...
- Mon Aug 06, 2018 5:39 pm
- Forum: Python
- Topic: Opening the matchbox keyboard from tkinter GUI
- Replies: 0
- Views: 592
Opening the matchbox keyboard from tkinter GUI
I'm using a touch screen and I'd like to open the matchbox keyboard when an entry box is tapped in my GUI. Something like below: freq_entry = Entry(root, textvariable=entrytext) freq_entry.bind("<1>", numpad_open) where the function numpad_open opens the keyboard. So what would numpad_open...