P8 (jeffmer) : how to activate ACCEL

Posted on
  • If I'm not posting in the right place, please LMK. I have jeffmer's P8 firmware (2v09.343) running on my P8. Things are looking good, but the ACCEL doesn't seem active (ACCEL.read() ={ ax: 0, ay: 0, az: 0 }). I tried to ACCEL.init() but still doesn't give any readings. Watch won't wakeup on raise. Anything I can try before declaring my accelerometer to be DOA?

  • It may be that you have a version of the P8 with a different accelerometer. accel.js only works with the SC7A20 while your P8 may have a BMA421. Search here for more information.

  • I checked that discussion but didn't see anything specific on the accel. I'm going to assume it's a BMA421 and follow the BMA423 specs. My issue is I'm new to I2C... how do I know what the device address is? And I see your version writes to a register in order to read it. Is that typical I2C?

  • OK, turns out the address is still 0x18, and using your accel.js code reading/writing seems to work (I got a 0x11 back as the ID), so I think I'm good. But the question still stands: how does one determine the address of the chip?

  • Any one have luck with the P8 / accel? I'm able to get x,y,z from it, but as for step counts, or setting the interrupt I'm lost. I've got datasheet for 423 (allegedly the same as 421...??) and sample C code from several sources, but I can't seem to get anything useful. Looks like µPython got it working, and I'm following the logic, but no luck!

  • @jeffmer I am using your Espruino fork now with my Pinetime and am wondering if you have folded your SPI changes into Espruino master? They seem harmless and can even be #ifdef'd for specific devices. Any plan to merge?

  • Hi, no plans to merge at the moment as I also had to add non-standard Espruino fns to disable and enable SPI to switch between lcd driver and storage access. Gordon rightly thinks this is a bit of a hack. It is unique to the P8 as in shares SPI. I will update the build to current Espruino in the next few weeks when I get a chance.

  • totally understand, and no rush! just curious. Who knows, future Bangles may need a shared SPI and use a _DSHARED_SPI flag. Anyway, nice work!

  • actually that flag got upstream and I am using it in P8 builds, it wouldn't work without it
    https://github.com/espruino/Espruino/blo­b/5739c2aad424102842307dc8194f10e79bb8c7­69/targets/nrf5x/jshardware.c#L2336
    with this you can deselect flash CS pin from video driver and the flash reading recovers here
    There was maybe different issue with merging?

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

P8 (jeffmer) : how to activate ACCEL

Posted by Avatar for yngv126399 @yngv126399

Actions