Not receiving anything over serial line

I want to set up serial communication between a Teensy 3.6 and a bq76PL455A-Q1 integrated circuit.

I am trying to do a basic read of the IC's device address register after I set the register value to 0. However, I am only receiving 0xFF from the IC's tx line and Serial1.available() returns 0 as well. I presume that I am receiving 0xFF (all 1's) because the default state for idling (not communicating/transmitting) is 1.


#include <Arduino.h>
#include "helper.h"
#include "init.h"
const int WAKEUP = 32; 

// On Teensy, Serial1 goes to pins 0 & 1 

void setup() { 
  Serial1.begin(250000); // sets data rate to 250000 bps
  Serial.println("testing has begun");
  // WAKEUP bq device 
  pinMode(WAKEUP, OUTPUT);
  digitalWrite(WAKEUP, HIGH); // bq will wake up and enter IDLE state  
  digitalWrite(WAKEUP, LOW); // after applying high signal, pin must de-assert to allow it to enter shutdown again
  initialize(); // request sent to read device address register in this function

Send/receive over serial:
The helper functions to actually provide the values to read/write are directly from the sample code provided by Texas Instruments. I have verified the messages are correct by referencing the software design reference (

void sciSend(uint32_t len, uint8_t * data) {
  int j = 0;
  uint8_t toSend[len];

  Serial.println("Serial1.availableForWrite(): ");
  while ((len--) > 0) {
    // copying contents of pointer into array:
    toSend[j] = *data;
  Serial1.write(toSend, sizeof(toSend));

  // sending data all at once:
  Serial.println("data we are sending: ");
  for (int i = 0; i < (int)sizeof(toSend); i++) {
    Serial.println(toSend[i], HEX);
void sciReceive(uint32_t len, uint8_t * data) {
  int i = 0;
  Serial.println("printing serial1.available: "); 
  Serial.println("reading back dev address ");
  Serial.println("expected output 00 00 00 00");
  //while ((len--) > 0 && Serial1.available() > 0) {
  while ((len--) > 0) {
    //*data =;
    Serial.println(, HEX);
    //Serial.println(*data, HEX);

What I am seeing on the serial monitor:

data we are sending: 

printing serial1.available(): 

reading back device address 
expected output 00 00 00 00

Is there anything you can think of that could be the reason why I'm not receiving values from the IC over the Serial1 line? I have verified that the rx/tx connections are correct and that the baudrate is correct with an oscilloscope. Additionally, when I do a serial1.availableForWrite() I get back 63.

Welcome to the forum.

From you description, I do not believe you get any data back. You commented the Serial1.available. That function will tell you when you received a character. If you call without a Serial.available the result is unpredictable (unless you look into the source code of the library).

You have an oscilloscope. See if you get any data back. The line will need to go from HIGH to LOW for the startbit even if all data bits are HIGH. If it stays HIGH all the time, you do not get anything back.

Not quite true; it is predictable :wink: returns an int and the value will be -1 if there was nothing to read.

This is very common in communication (serial, ethernet, ...) and also applies in the world of computers (PCs).

1 Like

@sterretje Now that I looked at the source code for Serial, you are right. Thanks.

@rg65 The error code of is -1 that is 0xFFFF in an int data type (the method signed numbers are stored is called two's complement).

Hello! Thank you for your responses. I took @sterretje 's advice and used Serial.available in a SerialEvent1 function that mimics an interrupt sequence when data is on the port:

void loop() {
  ReadReg(0, 10, &wTemp, 1, 0);

 * SerialEvent1 occurs whenever a new data comes in the hardware serial RX
 * routine is run between each time loop() runs
void serialEvent1() {
  while (Serial1.available()) {
    // get the data on the port and print out
    byte inByte =;

However, I wasn't getting back any data because Serial1.available() was never > 0. Is there any other reason why the comms isn't working?

Can you provide a schematic (hand drawn is OK)?

Do you have a module for the bq76PL455A-Q1 or did you build you own PCB? Can you provide a link if it is a module?

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