Giter Club home page Giter Club logo

phy6222's People

Contributors

qitas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

phy6222's Issues

I2C not working

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.