i2c with gp32

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i2c with gp32

1,188 Views
Edusra
Contributor I
Hello,
I´m developing a system using a GP32 microcontroller, and I need to use an external flash memory (24C04).
I´m triyng to use the software implemented i2c bean.
Reading the documentation of the SendBlock method, I noticed there is no parameter in the function call for the word address.
Maybe I need to send the word address as an additional byte of data. Is this correct?
Thank you in advance (and sorry for my poor english)

Labels (1)
0 Kudos
2 Replies

294 Views
mstrocka
Contributor I
If you mean address of the slave i2c device, then you can set it following way:
 
1. Using just one slave device - Bean Inspector -> Properties -> Slave address init. The address will be used automatically with each call of SendBlock, RecvBlock, etc.
 
2. Using more than one i2c slave devices. Use "SelectSlave" method to change the address of the slave device in your application. Address passed to SelectSlave method will be again used automatically with each call of SendBlock, RecvBlock, ....
 
Address will always be sent first when calling SendBlock method. After that data passed as parameter of SendBlock method will be sent.
 
I hope this will help you.
 
Martin
0 Kudos

294 Views
Edusra
Contributor I
Thank you for your answer Martin.
I wasn't talking about the device address, I was talking about the address of memory where the data is actually stored.
I also noted this in the RcvBlock method.
Thank you again
Eduardo
0 Kudos