LibreSolar / charge-controller-firmware

Firmware for Libre Solar MPPT/PWM charge controllers
https://libre.solar/charge-controller-firmware/
Apache License 2.0
144 stars 71 forks source link

DC/DC control function in interrupt to allow slow communication in main #16

Closed martinjaeger closed 5 years ago

martinjaeger commented 6 years ago

Communications via WiFi, LoRa or GSM modules need lots of time to establish connections and wait for data. In the current software it is not possible to run these tasks from within the main function, as it would block the DC/DC control.

Two possible solutions:

  1. Use mbed RTOS and put communication into separate (lower priority) thread
  2. Move DC/DC control to interrupt function (and make it as fast as possible) to be sure that control continues during wait phases of communication subsystem.

Mbed RTOS consumes lots of additional memory (especially RAM), so this option is almost impossible with STM32F072. Option 2 should be preferred.

atochukwu0 commented 5 years ago

Since the new development started, and basically 20a is way too small for the load demands in my country, so I started the development of 50a version of libresolar project, hopefully I am not supporting OLED display, I am using ht1621 based segment custom display, and user configurations done through buttons near the display, will post my updates as soon as the project is successful . 👻 libre

martinjaeger commented 5 years ago

Very cool. I'm excited to see your design.

atochukwu0 commented 5 years ago

When is the update firmware going to be published ?

martinjaeger commented 5 years ago

Solution 2 implemented in 112f36b08b5601f0589ff6dae10fd9f6d68d40e0.