How joeycastillo/sensor-watch works
Main Components
a. Hardware Layer:
• SAM L22 Microcontroller (Core Component)
• LCD Display Interface
• Button Interface (3 interrupt-capable buttons)
• LED Backlight System (Red/Green PWM)
• Optional Buzzer Interface
• USB Interface
• Sensor Board Connector (9-pin flex PCB)
• Power Management (CR2016 coin cell)
b. Software Layer:
• UF2 Bootloader
• Watch Library
• Movement Framework
• Application Layer
• Hardware Abstraction Layer (HAL)
Component Relationships
[Hardware Layer]
┌─────────────────────────────────────────┐
• Power Supply (CR2016) │
• ┬─────────────────────┬─┘
┌─────────────────┴─────────────────────┴─┐
• SAM L22 Microcontroller │
• ┬────────────┬───────────────┤
• LCD │ Buttons │ LED │
• Controller │ Interface │ Controller │
• ┴────────────┴───────────────┘
┌───────┴──────────┴────────────┴─────────┐
• Hardware Abstraction Layer │
• ┤
• Watch Library │
• ┤
• Movement Framework │
• ┤
• Applications │
• ┘
Interface Details
[Sensor Board Interface]
┌─────────────────────┐
• 3V Power │
• ┤
• I²C (SCL/SDA) │
• ┤
• GPIO/Analog (5 pins)│
• SPI │
• UART │
• PWM │
• Wake inputs │
• ┘
Important Notes
a. Modular nature of the sensor board interface
b. Dual-boot capability (main firmware and UF2 bootloader)
c. Different clock domains (32KHz RTC vs. main CPU clock)
d. Interrupt paths from buttons and sensor interfaces
e. Power domains and sleep mode capabilities
Additional Details
• Signal types (digital, analog, power)
• Communication protocols (I²C, SPI, UART)
• Power states
• Interrupt capabilities
• Memory regions (Flash, RAM, EEPROM emulation)
Applications (top)
Bidirectional data flow where appropriate, and mark critical paths for interrupts and wake signals.
This system design should capture both the hardware complexity and software architecture while maintaining clarity about how the components interact. The emphasis should be on the modular nature of the sensor board interface and the flexibility of the software framework.