I2C garbage data on the Pi Pico VS RPi4 #11671
-
Hello everyone! So, I am interfacing a temperature sensor MCP9600. The data read out works just fine. Now what doesn't work is the setup of the sensor (initialization). For the sake of reference, I made two identical codes, one for the Pi Pico that has a problem, the other one for the RPi 4. The same sensor is used, and the code is completely identical. Lets start with the RPi 4 code that works completely as excepted:
This is the output of the code captured by a cheap logic analyser and everything is just fine: Now for the Pi Pico code:
The output from the Pi Pico: As you can see in the two first write to functions there is a lot of unexpected garbage data (0x00) and the values that I want to write to the registers are gone (0x20 and 0x04). This is where I configure the sensor. The code is quite literarily copy and paste. With the exception of the Micropython functions for I2C (i2c1.writeto_mem, i2c1.readfrom_mem). The physical connection is also identical on a bredboard. I use the latest version of Micropython. I don't really understand what the problem is. Hope someone here can share some light on the situation. Thank you so much for your time reading all of this! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
bytearray(adc16bit) creates an array with a length of 32 bytes with a value of 0, since adc16bit has a value of 32. Is that intentional? Or did you want to write bytearray([adc16bit])? |
Beta Was this translation helpful? Give feedback.
bytearray(adc16bit) creates an array with a length of 32 bytes with a value of 0, since adc16bit has a value of 32. Is that intentional? Or did you want to write bytearray([adc16bit])?