ESP32 ULP assembler I2C_WR

Posts: 16
Joined: Wed Dec 27, 2017 4:20 pm

ESP32 ULP assembler I2C_WR

Postby Valerii » Tue Feb 20, 2018 11:24 am

Hi, I'm trying to communicate via i2c interface and faced next probem.
According to tutorial:

Code: Select all

I2C_WR      0x20, 0x33, 7, 0, 1      // Write byte 0x33 to sub-address 0x20 of slave with address set in SENS_I2C_SLAVE_ADDR1.

In my case I want to readout date from variable and write it to i2c

Code: Select all

//here var becomes 0x1234
move r1, var       
ld      r0, r1, 0                // load value to r0
i2c_wr  0x22, r0, 7,  0, 0    //send 0x34 part of R0
i2c_wr  0x22, r0, 15,  8, 0    //send 0x12 part of R0

compiler returns
Error: syntax error. Input text was r0.
Error: syntax error. Input text was r0.

both for lines starting from i2c_wr.

How to work with this command correctly?

Who is online

Users browsing this forum: Baidu [Spider] and 4 guests