socxin / phy6222 Goto Github PK
View Code? Open in Web Editor NEWL2 R2:phyplus 96MHz Cortex-M0 BLE SoC (PHY6222/PHY6252)
L2 R2:phyplus 96MHz Cortex-M0 BLE SoC (PHY6222/PHY6252)
I am trying to develop device with i2c modules. Unfortunatelly my PHY6222 does not comunicate with any module. There is no activity on SCL and SDA lines.
My code:
hal_i2c_pin_init(I2C_1, P1, P0);
void* i2c_inst_main = hal_i2c_init(I2C_1,I2C_CLOCK_100K);
uint8_t address;
int err_code = 0;
uint8_t sample_data = 0;
bool detected_device = false;
LOG_DEBUG("TWI scanner started.");
for (address = 1; address <= 127; address++) {
err_code = hal_i2c_read(i2c_inst_main, address, 0x01, &sample_data, sizeof(sample_data));
if (sample_data != PPlus_SUCCESS) {
detected_device = true;
LOG_DEBUG("\r\nDevice detected at address 0x%x.\r\n", address);
}
else{
LOG_DEBUG("Error: %d at 0x%x.\r\n", err_code, address);
}
}
if (!detected_device) {
LOG_DEBUG("\r\nNo device was found.\r\n");
}
LOG_DEBUG("TWI device scan ended.");
My code is in function called from osalInitTasks(void).
In result I get error 13 (PPlus_ERR_TIMEOUT) for all I2C address.
I use bleUart_at example. I add i2c.h import, and i add i2c.c file to project.
There is no difference between: I2C_1 and I2C_0, clock: I2C_CLOCK_100K and I2C_CLOCK_400K does not change anything.
These pins aren't use by me to any other tasks.
I try also pins P18 and P20 and thats the same. Pins are only pull up by PHY6222.
I use PHY6222 board V1.7 and self solded board, there are no differences.
Resistors don't make any difference.
What am I doing wrong?
Could you add I2C example to sdk?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.