Giter Club home page Giter Club logo

Comments (11)

SV-Zanshin avatar SV-Zanshin commented on May 28, 2024

from ina.

AluminioVanadio avatar AluminioVanadio commented on May 28, 2024

Hi,
I tried BackgroundRead also, with the library freshly installed and does not compile :

Compiling 'BackgroundRead' for 'Teensy 3.2 / 3.1'

BackgroundRead.ino: 71:5: error: expected constructor, destructor, or type conversion before '(' token
ISR (PCINT0_vect) { \ handle pin change interrupt D8

BackgroundRead.ino: In function void setup()
Error compiling project sources
Build failed for project 'BackgroundRead'

BackgroundRead.ino: 95:3: error: 'PCIFR' was not declared in this scope
PCIFR |= bit (digitalPinToPCICRbit(INA_ALERT_PIN)); \ clear any outstanding interrupt

BackgroundRead.ino: 96:3: error: 'PCICR' was not declared in this scope
PCICR |= bit (digitalPinToPCICRbit(INA_ALERT_PIN)); \ enable interrupt for the group

Using Visual Studio IDE.

Compiles OK selecting an Arduino Leonardo. It looks like port manupulation in teensy is different. Also I don not hace interrupts pins hooked up.
DisplayReadings compiles but it does not detect the INA226.
No INA device found, retrying in 10s...
No INA device found, retrying in 10s...
No INA device found, retrying in 10s...

SDA and SCL pins are correctly mapped by Wire.h looking at the scope.

from ina.

SV-Zanshin avatar SV-Zanshin commented on May 28, 2024

from ina.

AluminioVanadio avatar AluminioVanadio commented on May 28, 2024

Hello Arnd.
I added the code, and maxDevices is at 0. I forced maxDevices to 127 and it works OK, you are right, there are differences in the EEPROM implementation of the Teensy.
Thanks

from ina.

SV-Zanshin avatar SV-Zanshin commented on May 28, 2024

I added some #ifdefs to support the TEENSY boards to the code, that should work for your implementation now.

from ina.

AluminioVanadio avatar AluminioVanadio commented on May 28, 2024

Line 188 of the modified INA.cpp file has the variable type declaration missing:
uint8_t maxDevices = 2048 / sizeof(inaEE);
But stiil doesn't work in teensy 3.2, unless I assign maxDevices a fixed value.

from ina.

SV-Zanshin avatar SV-Zanshin commented on May 28, 2024

from ina.

AluminioVanadio avatar AluminioVanadio commented on May 28, 2024

Hi,
If I compile with line 188 in INA.ccp unmodified I get the following compiler error:
Compiling 'DisplayReadings' for 'Teensy 3.2 / 3.1'
INA.cpp: In member function uint8_t INA_Class::begin(uint8_t, uint32_t, uint8_t)

INA.cpp: 188:3: error: 'maxDevices' was not declared in this scope
maxDevices = 2048 \ sizeof(inaEE); \ defined, so use 2Kb as value
Error compiling libraries
Build failed for project 'DisplayReadings'

Looking at i2c_t3, made for teensy boards, they use the following definitions for detecting all board models:
#if defined(MK20DX128) || defined(MK20DX256) || defined(MKL26Z64) ||
defined(MK64FX512) || defined(MK66FX1M0) // 3.0/3.1-3.2/LC/3.5/3.6

#include "i2c_t3.h"
Thanks again

from ina.

SV-Zanshin avatar SV-Zanshin commented on May 28, 2024

The compiler error would seem to indicate that the branch in the #ifdef was taken correctly, but I've added the directives you listed above to the code and fixed the way that the variable "maxDevices" is declared. Can you check to see if the current version works correctly?

from ina.

AluminioVanadio avatar AluminioVanadio commented on May 28, 2024

Hi,
The problem is that 2048/ sizeof(inaEE) is 256, and maxDevices is 8 bit long, so making maxDevices a 16 bit integer or limiting maxDevices to 255 should work.
I modified it to:
maxDevices = 2048 / sizeof(inaEE)-1;
and works fine.

from ina.

SV-Zanshin avatar SV-Zanshin commented on May 28, 2024

Thanks for pointing out that error - I should start using those bigger boards to broaden my horizons from the much more resource-restricted Atmel processors.

from ina.

Related Issues (20)

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.