UNO board: No response from series port (uint8_t, size_t)

Hi guys.

I met a question when I use Arduino UNO board. Could you guys please help me with that?

Please provide details like your code and the version of the IDE. When posting code, please use code tags (the </> button). The same applies when posting errors.

I suspect that English is not your native language but below is difficult to understand. Can you try to rephrase? Is it an error message when you try to compile?

I use the UNO board, with [ProtoCentral_fdc1004_breakout]. The arduino coding is from (GitHub - Protocentral/ProtoCentral_fdc1004_breakout: A breakout board for the Texas Instruments FDC1004 capacitance to digital converter) in GitHub. The first time I soldered sensor with UNO, did a little modification of code (please see attached file) and uploaded code. I did see the data which coming from the series port of Arduino IDE. After that I uploaded again. It doesn't work any more. I could uploaded code successfully, with only one line ' Cannot locate "flash" and "boot" memories in description'. But in series port, no data appears. If I tried another different coding (like print something each second), the series port show words I set. Then I tried another MCU (NANO Every boards), the same questions as I mentioned above.

#include <Wire.h>
#include <Protocentral_FDC1004.h>

#define UPPER_BOUND  0X4000                 // max readout capacitance
#define LOWER_BOUND  (-1 * UPPER_BOUND)
#define CHANNEL 0                          // channel to be read
#define MEASURMENT 0                       // measurment channel

int capdac = 0;
char result[100];
unsigned long timer1 = 0;
unsigned long lastMillis = 0;

FDC1004 FDC;

void setup()
{
  Wire.begin();        //i2c begin
  Serial.begin(115200); // serial baud rate
}

void loop()
{

  FDC.configureMeasurementSingle(MEASURMENT, CHANNEL, capdac);
  FDC.triggerSingleMeasurement(MEASURMENT, FDC1004_100HZ);
 
  //wait for completion
  delay(15);
  uint16_t value[2];
  if (! FDC.readMeasurement(MEASURMENT, value))
  {
    int16_t msb = (int16_t)value[0];
    int32_t capacitance = ((int32_t)457) * ((int32_t)msb); //in attofarads
    capacitance /= 1000;   //in femtofarads
    capacitance += ((int32_t)3028) * ((int32_t)capdac);


   if (millis() - timer1 > 5000)
    {
    timer1 = millis();
    Serial.print((((float)capacitance/1000)),4);
    Serial.print("  pf, ");
    Serial.println();
    }

    if (msb > UPPER_BOUND)               // adjust capdac accordingly
  {
      if (capdac < FDC1004_CAPDAC_MAX)
    capdac++;
    }
  else if (msb < LOWER_BOUND)
  {
      if (capdac > 0)
    capdac--;
    }

  }
}

But with more information shown as follow:

In file included from C:\Users\maeuser\Documents\Arduino\libraries\ProtoCentral_fdc1004_breakout-1.0.2\src/Protocentral_FDC1004.h:25:0,
                 from C:\Users\maeuser\Documents\Arduino\libraries\ProtoCentral_fdc1004_breakout-1.0.2\src\Protocental_FDC1004.cpp:21:
C:\Users\maeuser\Documents\ArduinoData\packages\arduino\hardware\megaavr\1.8.7\libraries\Wire\src/Wire.h: In member function 'uint16_t FDC1004::read16(uint8_t)':
C:\Users\maeuser\Documents\ArduinoData\packages\arduino\hardware\megaavr\1.8.7\libraries\Wire\src/Wire.h:63:12: note: candidate 1: size_t TwoWire::requestFrom(int, int)
     size_t requestFrom(int, int);
            ^~~~~~~~~~~
C:\Users\maeuser\Documents\ArduinoData\packages\arduino\hardware\megaavr\1.8.7\libraries\Wire\src/Wire.h:61:12: note: candidate 2: virtual size_t TwoWire::requestFrom(uint8_t, size_t)
     size_t requestFrom(uint8_t, size_t);
            ^~~~~~~~~~~
Sketch uses 8828 bytes (17%) of program storage space. Maximum is 49152 bytes.
Global variables use 550 bytes (8%) of dynamic memory, leaving 5594 bytes for local variables. Maximum is 6144 bytes.
avrdude: jtagmkII_initialize(): Cannot locate "flash" and "boot" memories in description

I tried debug several times and I found that the following two lines doesn't work when sensor board is connected with UNO. So it may due to the issue from I2C transmission in the code. But I have no idea how to modified it.

  FDC.configureMeasurementSingle(MEASURMENT, CHANNEL, capdac);
  FDC.triggerSingleMeasurement(MEASURMENT, FDC1004_100HZ);

Could you please provide a trend to me about that? Tenfold thanks.

Hi~ I made a mistake yesterday when uploading the words. I had already upload the code. Would you mind have a look? Thanks so much for your kindly reminder.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.