How to access OLED on HTIT-WB32 with Micropython through I2C? - micropython

I have Micropython v1.9.2 on an HTIT-wb32 ESP32 board. I can run code, connect to my router, etc. I have not been able to access the built-in OLED display through I2C.
The OLED pin layout for the board states that SDA is on pin 4 and SCL is on pin 15.
So with the code:
from machine import I2C, Pin
i2c = I2C(sda=Pin(4), scl=Pin(15))
i2c.scan()
I should get an address from i2c.scan() but it is returning:
[]
Other code examples I've read seem pretty straightforward and just work but I have not found code for this device yet.
What am I doing wrong?

Not sure if you ever found out, but I just got one of these modules and was experiencing the same issue, found that the OLED reset pin (GPIO16) had to be pulled high first, then shows up as 3c straight away.

Related

Interfacing StM32F4xx Nucleo board with LCD HD44780 16x2 module

I am interfacing LCD module in 8bit mode to STM32F446RE Nucleo board the connections are as below:
connections
wiring (if pic is not clear)
PB0-->RS PB1-->RW PB3-->E
D0-D7-->PC0-PC7
code
Dear members,
I have pasted all my codes.. in the link above The GPIO.h,.c files are 100percent working fine I have checked with other peripheral projects. The delay function also works correctly tested for led blink..
Now I am stuck in LCD program only..
My main aim is to just display 1 character I have gone through datasheet and forums and have taken everyones's suggestion accurately I still can't figure out what's wrong with my program..
I have tried this LCD board for arduino program it works there.
Also I have checked voltage specifications and all pin's connected are 5v Tolerant as per stm32 datasheet.
Please can someone figure out whta I may be doing wrong..
Your suggestions may help me..
I would be greateful..

STM32 with LCD 2004 + I2C, can't communicate

I am using a STM32F030F4P6 MCU and a LCD 2004 with PCF8574T I2C display driver. I have tried the library from this tutorial: https://controllerstech.com/interface-lcd-16x2-with-stm32-without-i2c/. I have found a datasheet for the PCF8574T device, but there are no commands specified in there. I am quite new in the field, but I already communicated with other devices over I2C and SPI and got them to work. Can somebody tell me what I am doing wrong, or at least show me where to get a datasheet with commands for the device? I am sorry in advance if this is a noob question.
As already mentioned, PCF8574T - is an i2c expander. So you need to write a driver which manipulates data pins on PCF8574T in way described in tutorial you found.
Check the arduino code for this type of LCD. It may save your time/ https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library
If you have an Arduino board, you can test your LCD according this tutorial https://create.arduino.cc/projecthub/Arnov_Sharma_makes/lcd-i2c-tutorial-664e5a
Nice to know that your device still alive before debug the code.

Olimax STM32-E407 cannot connect over SWD

Good day
The problem:
I am trying to connect/flash/debug a Olimax STM32-E407 dev board over SWD and I am not able
When trying to connect, using CubeProgrammer, I get: "No STM32 Target Found"
What I have tried:
I have connected a ST-link V3 mini to the pinout of the the 20pin header of the Olimax board including 3.3V, GND, SWDIO (PA13/Pin7), SWCLK (PA14/Pin9) and NRST (Pin15).
I am powering the powering the board from a power supply into the power jack
All jumpers and solder bridges are in stock places.
I have also tried manually pulling NRST to ground and doing a full chip erase, but that has not worked either.
I have used these ST-link debuggers on other boards I made and it works perfectly fine
I have 3 Olimax boards and none of them work
Any help would he hugely appreciated.
Debugging problems on microcontrollers have two general common methodes.
Hardware Problems:
In this part, it is highly recommended that use an oscilloscope to monitor circuit.
Make sure the microcontroller is powered with a correct and stable power supply.
Check the soldering quality and there is no short circuit on the board (especially between ground pins and other pins).
Check the NRST pin is high when the board is powered.
Remember that this reset is active low so during programming or debugging this pin should be high. Also, check this pin is debounced with a capacitor.
Also you can check the JTAG pins signals with an Oscilloscope to check if the programmer device is working fine.
Sometimes adding a capacitor between debugging pins and GND increases the bus capacitance and solves the problem. The value of the capacitor should be found by trying.
Software Problems
Check the programmer driver is correctly installed on your PC.
Check the programming method is true(for example maybe the board is designed to be programmed with SWD, not JATG).
Sometimes reducing the programming clock of the programmer solved the problem.
If all of these methods didn't work and you are sure that the board is fine, probably the programmer is broken, so change the programmer with another one.

How to connect LOLIN 7 WS2812B LED's to Raspberry Pi Pico (RP2040)?

I have spent numerous hours googling for the solution, but no tutorial or guide uses the LED's that I own. Everyone keeps mentioning Data IN, and Data OUT, but there are no such markings on my LED's.
I only know that I need to connect the 5V on LED with VBUS (Pin 40) Pin on Pi Pico, and GND on LED with GND (Pin 38) on Pi Pico.
Can someone please help me out?
I have following LED:
This piece of hardware was probably meant to be used with Wemos D1 Mini board, but you can use it with pico too. Connect D4 pin to any gpio on your pico, ground to ground and 5V to VBUS as you said. That's probably everything you have to connect. Than install Neopixel library and get the code from this link:
https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitpython/neopixel-leds
I don't this hardware at home, so I am not sure, but hope I at least showed you a way.
also pretty useful:
https://www.wemos.cc/en/latest/d1_mini_shield/rgb_led.html

Coding Raspberry Pi with an ADC - SPI

I am trying to connect an analogue to digital converter to the raspberry pi. As far as I am able to understand, the RPi doesn't support Bi-directional SPI mode. The adc I am using says it is SPI compatible but only has the inputs SCLK, CNV and outputs CLKOUT+ and CLKOUT- and SD0+ and SD0-. This leads me to understand that it will only work with bi-directional SPI as there is only the serial data out. I am thinking of using a PWM for CNV (which I think CE), GPIO clock for SCLK and then an interrupt on the falling edge of the GPIO clock to just digitally read each bit from the adc. I don't understand SPI in detail but from what I've read quite often it requires sending data in order to receive it. Do you know if the setup I mentioned (without using SPI) will work? Or am I missing something about SPI and the adc will work with that while not in bi-directional mode?
We are using the Raspberry Pi 3 b
adc - http://cds.linear.com/docs/en/datasheet/232316fa.pdf
Thanks for any help you can provide.
Read the data sheet carefully, in particular pages 8 and 9. I suggest that you tie CMOS/LVDS pin to ground to enable CMOS mode. Then use only the "+"-pins. Use the SCK for SPI clock, SD01+ for SPI data input to the Rpi. Connect a GPIO pin to CNV.
Also observe that the RPi runs at 3.3V, and the ADC's max rating is also 3v3, that is running the IC right to the edge.