No clock signal at the SCL pin of Sparkfun nRF52832 breakout board - i2c

I am trying to use the Sparkfun nRF52832 breakout board as a master in I2C communication. I am using Arduino IDE to program the module. I defined pins 24 and 25 as SCL and SDA, respectively, and used wire.begin() in the setup to configure it as a master. I expect to see the clock signal when I connect the board to the oscilloscope, but I just see 3.3v dc signals at both scl and sda pins. Would you please tell me what's wrong?
I used pull-up resistors.

Related

Problem using SPI2 on a Nucleo-H7 whereas SPI1 works fine

My setup is the following: a Nucleo board (Nucleo 144 embedding a STM32H743) is configured as SPI Master. Another identical board is configured as SPI Slave.
For the Master I setup the SPI1 (pins GND, D11, D12 and D13 - PA5,6,7- of the CN7 connector) with following config:
GPIO: very high speed, alternate function 5
SPI: prescaler DIV8, interrupts enabled, simplex communication, no Slave Select
all clocks set to maximum (CPU 400MHz, etc...)
For the Slave I setup the SPI1 too (same pins), it works fine.
Then I tried to switch to SPI2 peripheral for the Slave board and could not make it work (no change to master board).
I chose the pins D18 (PB13) for SCK, A7 (PC2) for MISO and A2 (PC3) for MOSI.
I've checked the following points:
SPI2 periph clock is enabled
GPIOB and C clocks are enabled and pins PB13, PC2 and PC3 are set up the same way as PA5,6,7 in previous setup.
for the GND I tried different GND pins on the board, I don't know if it makes a difference.
the GPIOs used for SPI2 are not used elsewhere in my code. I've got them from the datasheet of STM32H743ZI
What I see:
my slave is still receiving the SCK signal correctly: I get the correct number of RXP interrupts.
the data received by the slave is corrupted.
however the data send by the slave to the master is correct.
I think the MOSI signal is badly configured, either physically or logically. I tried the other GPIO pins whose alternate function can be SPI2_MOSI but same behaviour.
Is there a specificity to SPI2 and/or this GPIO setup ? Does the GND location on the board matter ?
I "fixed" (?) the issue by setting a pull-down to the SPI2 input GPIO on Slave side. I don't really understand why it was working without pull-down on SPI1 neither why this pull down is needed on a Slave ?

pca9685 and node mcu using micropython

I have a Lolin MCU like this Lolin v3
I have a PCA9685 board like this cheap controller
And Im coding in microPython in the nodeMCU device. I managed to attach one of those small 9g servos to the nodeMCU board and controll it. No problem. I want to use a controller since I need more servos, so I connect the PCA like this:
PCA V+ <--> 3v3 in the mcu (5v produce no changes)
PCA GND <--> GND in the mcu
PCA SDA <--> SDA (Pin 4) in the mcu
PCA SCL <--> SCL (Pin 5) in the mcu
PCA OE <--> GND, V+ or open. Makes no difference
Now I downloaded this PCA9685.py and Servo.py from this web microPython PCA controller
I create an I2C like this
>>> i2c = machine.I2C(scl=machine.Pin(5), sda=machine.Pin(4))
>>> i2c.scan()
[64, 112]
So the device is there. The cables are good, the i2c is working. But the servos won't move no matter what. Not even buzz.
I try moving the servo using
servos.position(1, us=1500)
no thing happened.. I connected several servos in several ports to make sure is port 1 not port 0 and those stupid errors.. nothing.
This is the code I'm running at the device right now:
from machine import I2C, Pin
import servo
servos = servo.Servos(I2C(scl=Pin(5), sda=Pin(4))
for i in range(16):
servos.position(i, us=1500)
Any clue ???

How to establish 3 UART and 2 I2C interface at a same time in STM32F103C8T6?

I am a newbie to STM32 and CubeMX. I need to create 3 UART interface and 2 I2C interface in STM32F103C8T6. I tried to, but there is a common port for both i2c and uart communication and it allows me to create only (2 uart and 2 i2c) or (3 uart and 1 i2c ) and I couldn't create as I needed . how can I establish 3 UART and 2 I2C interface at a same time in STM32F103C8T6 ?
Thanks in advance...
You can't. There's an unresolvable pin conflict.
The I2C2 peripheral must use pins PB10 and PB11 for SDA and SCL -- there are no remappings for this peripheral.
The USART3 peripheral uses those pins for TX and RX. On higher pin-count STM32F1 parts, it can be remapped to pins PC10/PC11 or PD8/PD9; however, the STM32F103C8 doesn't have those pins.
There are only two I2C and three USART peripherals on the STM32F103, so there are no alternate I2C or USART peripherals available.
use hardware I2C and as many as possible hardware UARTS. For the additional ones write the software implementation. You have an example here: https://www.st.com/resource/en/application_note/dm00110292.pdf or take stm32F103 with more pins

Raspberry Pi Zero I2C pull up + GY-521

I'm trying to talk via I2C to the gyro sensor MPU6050 which sits on a GY 521 board. But i can't get the device being detect.
I tested another i2c device (EEPROM) and got the device address detected. So i guess it has to be a hardware problem.
As far as i could find out:
RPi has a 1.8k pullup resistor on SDA and SLC already on board
my GY 521 also has also a pullup resistor (2.2k) on each line on board
Could the resistors be the problem? A good resistor value in sum would be around 5k on each line?
(The wiring should be ok, there are a lot of instructions around the net and i've checked it multiple times. I use 5v on the GY521 since it has a voltage converter)
Any help appreciated!
The problem was bad soldering.
For the record:
Using the RPi pullups in combination with the breakout board pullups works for me.

GPIO to I2C kernel driver (opposite of i2c-gpio)

My Zynq board has SPI, I2C but does not have kernel level GPIO (The GPIO on the MIO is sent to a bunch of other things) so I can't get it from the headers. Believe me when I say this.
I need some kernel level GPIO so I can drive a touch screen interface. I need to map some GPIO to the stmpe610 touch screen driver (Device Tree compatible = "st,stmpe610"). This is all well and good. So what I want to do is somehow map the I2C to GPIO (which will be connected to the display), and pipe the driver to interface through I2C. This way I can access the GPIO pins of my i2c expander from kernel space.
I looked at the i2c-gpio driver, but it does the opposite of what I want (http://lwn.net/Articles/230571/). It takes GPIO and makes it I2C by bit-banging.
I have an i2c expander mini-board that will take I2C and spit out GPIO. So if I have a gpio-i2C that would be great.
Maybe I have wandered too afar and off the beaten path. Does the stmpe610 have an i2c driver? This would also alleviate my issue.
<<
If I have understood you correctly, you have a GPIO expansion board that you can connect to your Zync main board.
If the above assumption is correct, what you have to do is find the correct driver for your GPIO extension board. What model do you have ? What chip is there on it ? Maybe there is already a driver for it in the kernel. If so, you then just have to declare it under your I2C base controller node in your device tree so that its GPIOs can then be referenced in your device tree for your stmpe610 touchscreen node.
If the chip does not have a driver yet, you then will have to write a GPIO driver for the chip. One good example to start with is the GPIO driver for the MAX 7300, that is connected via I2C as well. Have a look at gpio-max7300.c and gpio-max730x.c