i2c

I2C not detecting ? issues in hardware or any other?

こ雲淡風輕ζ 提交于 2019-12-06 08:13:48
问题 I have been working through some i2c examples. Plugging it all together and I find that I need to install the i2c-tools package, then use raspi-config to enable the I2C system. The wiringPi gpio command has a shortcut to the i2cdetect command and running it gives Before 3 weeks everything working properly, detected 68. I didn't understand what is the problem !!! Can anyone one help me to solve this issue. 回答1: The I2C bus allows multiple devices to be connected to your Raspberry Pi, each with

MCP23017 I2C Device driver probe function is not called

ぃ、小莉子 提交于 2019-12-06 07:57:56
I am using the following I2C/GPIO Device driver to access the MCP23017 GPIOs. With the insmod command I am able to load the driver and its listed in /proc/modules. I have two MCP23017 chips connected to my Raspberry Pi. Both are detected at addresses 0x20 and 0x21 . The initcall to the driver registers the driver. I checked this by printing out a message. But the driver probe function is not called. The devices are not opened/ cannot be located elsewhere. How is the probe function called? Should the probe be done manually to locate the devices? Is the probe call similar to the open call? I

Reading multiple bytes using I2C in U-Boot

泪湿孤枕 提交于 2019-12-06 03:27:11
I am having a problem with the I2C driver for a Freescale p1022tw board. There is a command on U-Boot's console to read from an I2C device: i2c md chip address[.0, .1, .2] [# of objects] When I read 4 bytes from a device with id 0x60, at address 0x0, I get: tw=>i2c md 60 0 4 0000: 45 45 45 45 EEEE These values that it returned are wrong. I can get the right values if I read one byte at the time: tw=>i2c md 60 0 1 0000: 45 E tw=>i2c md 60 1 1 0001: 45 E tw=>i2c md 60 2 1 0002: 46 F tw=>i2c md 60 3 1 0003: 00 . I should have gotten 45 45 46 00 or EEF0 in the first command. In multiple readings

STM32F207 I2C test failing

流过昼夜 提交于 2019-12-06 01:25:00
I am learning embedded development on the STM3220G-EVAL board with the STM32F207 microcontroller. I have tried to test the I2C interface by interfacing the two I2C2 and I2C3 modules on the same chip and sending/receiving a character. Here is the code I have currently written (using mdk-arm 5): #include <stm32f2xx.h> volatile uint8_t data = 'a', recv = 'x'; void i2c_init(void); void I2C2_EV_IRQHandler(void) { volatile uint16_t stat, dummy; stat = I2C2->SR1; switch(stat) { // SB set; read SR1 and write slave address in DR to clear case 0x01: dummy = I2C2->SR1; // Send address of slave I2C2->DR =

Windows IoT and DS3231 RTC clock

99封情书 提交于 2019-12-05 18:34:27
For my project I need the current time & date. Unfortunately the RP2 loses everything when it's turned off. The next thing is, that I won't have an internet connection to use NTP. For this reasing I need to implement a DS3231 RTC module. The communication of all devices runs over I2C (Raspberry <-> Arduino <-> DS3231). At the moment my Arduino communicates with the module and stores the date and time in char-arrays. The RP2 communicates with the Arduino to get the date/time. That actually works pretty good. But I'd like to communicate directly with the module to save ressources on the Arduino

What makes SPI faster than I2C protocol [closed]

不打扰是莪最后的温柔 提交于 2019-12-05 17:14:41
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I know the basic of I2C and SPI communication. As both are synchronous protocol. I wanted to know that what makes SPI faster than I2C. If I am not wrong using I2C we can go used 400kbps while in SPI we can achieve 10mbps also. Does it because of hardware change? This question was asked to me in one of the

Why are i2c_smbus function not available? (I2C – Embedded Linux)

折月煮酒 提交于 2019-12-05 03:27:23
There are many references to using i2c_smbus_ functions when developing embedded Linux software to communicate on the I2C bus. When i2c_smbus functions such as i2c_smbus_read_word_data are referenced in software project for ARM8 processor errors such as ‘ i2c_smbus_read_word_data’ was not declared in this scope are generated at compile. Investigation of the following header files indicate the absence of most i2c_smbus function definition. /usr/arm-linux-gnueabi/include/linux/i2c.h /usr/arm-linux-gnueabi/include/linux/i2c-dev.h Also in that following reference i2c.h file has all the i2c_smbus

How to write multiple slave i2c client device driver?

此生再无相见时 提交于 2019-12-05 01:27:45
I am trying to develop a driver for an embedded board. The driver is supposed to open up an interface for v4l2 and communicate with 2 devices using i2c . the driver will act as a master. I can't seem to understand how i2c_device_id array and i2c_add_driver functions work. I read documentation in kernel source but it won't help me on multiple slave clients. Do I have to have two seperate probe functions? Do i have to call i2c_add_driver two times? If not how am I going to be able to save two different clients to be able to send different bytes to different addresses. I am pasting my code here.

Implementing CRC8 on Arduino to write to MLX90614

ε祈祈猫儿з 提交于 2019-12-04 22:55:11
UPDATE: I can't even get this calculator to reproduce the SMBus PECs illustrated in figures 8 and 9 of this datasheet ! So I'm interfacing an arduino with a Melexis temperature sensor, and it's going okay--aside from the fact that I can't seem to get the CRC check to work. I've gotten read operations to complete successfully (although my software ignores the packet error code) but I have tried a lot of implementations of CRC8 to check the PEC byte to no avail. The code block I am using now came from OneWire: uint8_t OneWire::crc8(const uint8_t *addr, uint8_t len) { uint8_t crc = 0; while (len-

I2C not detecting ? issues in hardware or any other?

时间秒杀一切 提交于 2019-12-04 14:05:32
I have been working through some i2c examples. Plugging it all together and I find that I need to install the i2c-tools package, then use raspi-config to enable the I2C system. The wiringPi gpio command has a shortcut to the i2cdetect command and running it gives Before 3 weeks everything working properly, detected 68. I didn't understand what is the problem !!! Can anyone one help me to solve this issue. The I2C bus allows multiple devices to be connected to your Raspberry Pi, each with a unique address, that can often be set by changing jumper settings on the module. It is very useful to be