sandeepmistry / arduino-LoRa

An Arduino library for sending and receiving data using LoRa radios.
MIT License
1.64k stars 627 forks source link

MKRWAN 1310 Battery charging mode is not working. #312

Closed 03sarath closed 4 years ago

03sarath commented 4 years ago

Hey Guys,

Thanks in advance.

My Li-ion battery is not getting Recharged

  1. I'm testing the recharging capacity of MKR WAN 1310
  2. Trying to read battery status

1.I'm testing the recharging capacity of MKR WAN 1310

My MKRWAN 1310 is connected with Li-Ion battery(For JST connector) and used USB for external power supply. But my battery is not getting recharged. There is no output voltage at JST connector. Just wondering what is my mistake.

2. Trying to read battery status

I can see in variant.cpp of MKRWIFI 1010, We have support for reading Battery Status by using ADC_BATTERY.

void initVariant() {
#if defined(USE_BQ24195L_PMIC)
  pinMode(ADC_BATTERY, OUTPUT);
  digitalWrite(ADC_BATTERY, LOW);
  delay(10);
  pinMode(ADC_BATTERY, INPUT);
  delay(100);

  bool batteryPresent = analogRead(ADC_BATTERY) > 600;
  if (batteryPresent) {
    enable_battery_charging();
  }
  disable_battery_fet(!batteryPresent);
#endif

  // NINA - SPI boot
  pinMode(NINA_GPIO0, OUTPUT);
  digitalWrite(NINA_GPIO0, HIGH);

  // disable NINA
  pinMode(NINA_RESETN, OUTPUT);
  digitalWrite(NINA_RESETN, HIGH);
}

But in MKRWAN 1310 ADC_BATTERY is connected as FLASH_CS, Still is that possible to read battery status.

morganrallen commented 4 years ago

This issue is unrelated to LoRa, try asking in either the Arduino forums or the MKRWAN repo.

https://www.arduino.cc/en/Reference/MKRWAN https://www.arduino.cc/en/Guide/MKRWAN1300 https://github.com/arduino-libraries/MKRWAN