Unwanted HIGH states with Spresense extension board



  • Hi,

    My setup is: Raspberry Pi 4, which is connected to Sony Spresense via USB, and the Spresense is connected to the extension board.

    It is very important for my application to have controlled high and low states for pin output. Unfortunately, Spresense extension boards seem to output HIGH values by default. However, this is not the biggest problem because I can just set value to LOW in the setup phase. But... every time the Spresense receives serial communication from the Raspberry, the pin goes to HIGH state for a brief moment.

    This is very undesirable behavior for my application. Does anyone have any suggestions on how to avoid this?


  • DeveloperWorld

    Hi @Grawave,

    I have some questions to you.

    Are you using Spresense SDK or Arduino?

    Have you noticed it on any particular pin or does it occur on all pins?

    Can you share the code where you set all pins to low?

    Best Regards,
    Kamil Tomaszewski



  • Hi @KamilTomaszewski and thanks for your response!

    -I'm using Arduino to develop.
    -Now I'm using PIN_D13
    -I looked up an excel config file from sony which noted that HIGH state is the default state on startup - although I don't understand why, or why this could not be changed

    The largest problem is that the output goes high upon receiving Serial input.

    Here is the code.

    const int outputChannel1 = PIN_D13; // the pin the LED is connected to
    const int baudRate = 9600;
    
    String programVersion = "Version 1.2";
    
    void setup() {
      Serial.begin(baudRate);
      pinMode(outputChannel1, OUTPUT); 
      digitalWrite(outputChannel1, LOW);
      Serial.println("-------------");
      Serial.println("Done with Setup phase");
    }
    
    void loop() {
      digitalWrite(outputChannel1, LOW);
      Serial.println("Beginning Loop");
      String input = readInput();
      Serial.println("Input received");
    ...
    }
    
    ...
    String readInput() {
      String incomingString;
      Serial.println("Waiting for inputs!");
      while (true) {
        if(Serial.available() > 0) {
          incomingString = Serial.readString();
          break;
        }
      }
      return incomingString;
    }
    
    

  • DeveloperWorld

    Hi @Grawave,

    Thanks for the answers. I tried to reproduce your problem. However, I am using a PC instead of Raspberry and I did not notice this problem.

    Could you please try using a PC instead of a Raspberry and check it out? Maybe there is a problem in connecting Raspberry with Spresense via USB. Please let me know.

    Best Regards,
    Kamil Tomaszewski



  • Hi,

    Thanks for your reply. Unfortunately the same problem exists while I send the communication from my Ubuntu laptop. After receiving serial communication via USB, the output of the pin remains high for roughly one second.


  • DeveloperWorld

    Hi @Grawave

    It's very strange. Could you please try to do the same with the other pins. For example, try pin D5 on the extension board and pin D20 on the main board.

    Please let me know if it gives the same result.

    Best Regards,
    Kamil Tomaszewski


Log in to reply