Page 2 of 2

Re: Pi PICO No Hardware I2C on Channel 1 or Channel 2

Posted: Sat Feb 10, 2024 1:27 pm
by LeighM
Hi,
The issue is that on Pico (and other families, such as STM32, ESP32, Raspberry Pi)
the I2C does not work at the low level "Start, Byte, Stop" (as it does on PIC etc)
You need to use the Transaction API that use data buffers.

ps. You can also use the Transaction API with PIC, the CAL does the low level stuff for you. :D

Re: Pi PICO No Hardware I2C on Channel 1 or Channel 2

Posted: Sat Feb 10, 2024 1:30 pm
by chipfryer27
Hi Leigh

Hmm, I seem to remember that.....

Regards

Re: Pi PICO No Hardware I2C on Channel 1 or Channel 2

Posted: Sat Feb 10, 2024 1:52 pm
by chipfryer27
Hi Leigh

Using Transaction on Ch1

Transaction on Ch1.jpg
Transaction on Ch1.jpg (65.38 KiB) Viewed 262 times

In a previous post (that I probably linked to) it did mention transactions :oops:

Regards

Re: Pi PICO No Hardware I2C on Channel 1 or Channel 2

Posted: Sat Feb 10, 2024 3:16 pm
by jay_dee
Hi Guys,
So if I have a User Macro that I used to read a sensor with PICs
My process for PIC was
Initialise Macro
Start, Tranmit device Address, Transmit register address, transmit Data_Byte, stop.

For PICO, ESP32 etc
I use the Transaction_Initialise Macro
then should I just do three transaction_writes?
Transaction_Write Device Address, Transaction_Write Register Address, Transaction_Write Data_Byte

Are all other macros listed are redundant, other than any Transaction_xxx macros ?
Thanks, John.

Re: Pi PICO No Hardware I2C on Channel 1 or Channel 2

Posted: Sat Feb 10, 2024 3:40 pm
by LeighM
Create a byte Buffer[8]
Call Transaction_Initialise (with the device address as a parameter)
Setup the Buffer data (Buffer[0] = register address, Buffer[1] = data)
Call Transaction_Write(Buffer, 2)
Are all other macros listed are redundant, other than any Transaction_xxx macros ?
For the Pico, yes