How saulius1005/avr64dd32-main-controller works
This is AVR64DD32 firmware for a dual-axis solar tracker. Its main loop initializes hardware, receives Top Controller telemetry over the fiber/UART link and weather data over RS485, then runs motor actions and updates the display. The documented product also includes automatic weather protection, manual joystick control, fault reporting, and live electrical telemetry. The excerpts show the loop, RS485 parsing, display rendering, ADC sensing, and motor drivers; action logic and the fiber/UART parser were not sampled, so those links rely on README documentation or are marked unverified.
Main entry points: Actions.c Motor actions · main.c Controller loop · RS485USART.c Weather RS485 · FOUSART.c Fiber/UART receiver
Components 16
Communications
- Weather RS485
AVR64DD32-MAIN-Controller/RS485USART.c - Fiber/UART receiver
AVR64DD32-MAIN-Controller/FOUSART.c - CRC validation
AVR64DD32-MAIN-Controller/CRC.c - Weather measurements
AVR64DD32-MAIN-Controller/RS485USARTVar.h - Top-controller telemetry
AVR64DD32-MAIN-Controller/FOUSARTVar.h
Tracking control
- Controller loop
AVR64DD32-MAIN-Controller/main.c - Motor actions
AVR64DD32-MAIN-Controller/Actions.c
Sensing and motion
- I2C bus
AVR64DD32-MAIN-Controller/i2c.c - Analog sensing
AVR64DD32-MAIN-Controller/ADC.c - Azimuth stepper
AVR64DD32-MAIN-Controller/StepperMotor.c - Elevation linear motor
AVR64DD32-MAIN-Controller/LinearMotor.c
Operator interface
- Joystick input
AVR64DD32-MAIN-Controller/Joystick.c - Screen navigation
AVR64DD32-MAIN-Controller/Windows.c - LCD rendering
AVR64DD32-MAIN-Controller/SSD1306.c
Other components
- Weather station
- Top Controller
Connections 18
- Controller loop → Fiber/UART receiver: polls
AVR64DD32-MAIN-Controller/main.c - Controller loop → Weather RS485: polls
AVR64DD32-MAIN-Controller/main.c - Controller loop → Motor actions: runs
AVR64DD32-MAIN-Controller/main.c - Controller loop → Screen navigation: updates
AVR64DD32-MAIN-Controller/main.c - Weather station → Weather RS485: sends data
README.md - Top Controller → Fiber/UART receiver: sends telemetry
README.md - Weather RS485 → CRC validation: validates
AVR64DD32-MAIN-Controller/RS485USART.c - Weather RS485 → Weather measurements: stores
AVR64DD32-MAIN-Controller/RS485USART.c - Fiber/UART receiver → Top-controller telemetry: stores
- Motor actions → Azimuth stepper: controls
README.md - Motor actions → Elevation linear motor: controls
README.md - Joystick input → Screen navigation: provides input
AVR64DD32-MAIN-Controller/Windows.c - Screen navigation → LCD rendering: renders screens
AVR64DD32-MAIN-Controller/Windows.c - LCD rendering → I2C bus: writes display
AVR64DD32-MAIN-Controller/SSD1306.c - Analog sensing → Azimuth stepper: measures current
AVR64DD32-MAIN-Controller/StepperMotor.c - Analog sensing → Elevation linear motor: measures current
AVR64DD32-MAIN-Controller/LinearMotor.c - Motor actions → Weather measurements: uses conditions
README.md - Motor actions → Top-controller telemetry: uses telemetry
README.md