# edgarreis/codes-msp430g2 architecture

> Architecture diagram of the GitHub repository edgarreis/codes-msp430g2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/edgarreis/codes-msp430g2
- Repository: https://github.com/edgarreis/codes-msp430g2

## Overview

This repository is a collection of independent MSP430G2 teaching exercises, not one integrated application. The user chooses an Assembly or C example, runs it on the microcontroller, and observes peripheral behavior such as LED blinking, display output, motor control, ADC/PWM operation, or serial communication. The graph preserves the major documented capabilities and the indexed exercise sources. Most source files were not sampled, so their internal control flow is not inferred; the serial, debouncing, seven-segment, and P21 relationships are grounded in excerpts.

Main entry points: [`EX26-SerialCom-C/EX26.c`](https://github.com/edgarreis/codes-msp430g2/blob/master/EX26-SerialCom-C/EX26.c) (Serial Communication), [`EX18-TimerInterrupt-Debouncing-C/EX18.c`](https://github.com/edgarreis/codes-msp430g2/blob/master/EX18-TimerInterrupt-Debouncing-C/EX18.c) (Debounced LEDs), [`P21/P21.c`](https://github.com/edgarreis/codes-msp430g2/blob/master/P21/P21.c) (Button and Timers), [`EX19-Count7Seg-C/EX19.c`](https://github.com/edgarreis/codes-msp430g2/blob/master/EX19-Count7Seg-C/EX19.c) (Seven-Segment Counter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_basics["Assembly Basics"]
  node_assembly["Assembly Exercises<br/>[EX01.asm]"]
end

subgraph group_timing["GPIO and Timing"]
  node_ex15["LED Timing<br/>[EX15.c]"]
  node_ex16["Port Interrupt<br/>[EX16.c]"]
  node_ex17["Timer Interrupt<br/>[EX17.c]"]
  node_ex18["Debounced LEDs<br/>[EX18.c]"]
  node_p21["Button and Timers<br/>[P21.c]"]
end

subgraph group_devices["Peripheral Exercises"]
  node_ex19["Seven-Segment Counter<br/>[EX19.c]"]
  node_ex19b["Display Variant<br/>[EX19b.c]"]
  node_ex20["Stepper Motor<br/>[EX20.c]"]
  node_ex21["ADC and PWM<br/>[EX21.c]"]
  node_ex21a["ADC LED Control<br/>[EX21A.c]"]
  node_ex23["LCD Display<br/>[EX23.c]"]
  node_ex23a["LCD Variant<br/>[EX23a.c]"]
  node_ex23file["LCD Example<br/>[ex23.c]"]
  node_ex23child["LCD Example Variant<br/>[C_ex231.c]"]
  node_ex26["Serial Communication<br/>[EX26.c]"]
end

subgraph group_advanced["Additional Programs"]
  node_p22["P22 Program<br/>[P22.c]"]
  node_p22a["P22 Variant<br/>[p22a.c]"]
end

node_learner(("Learner"))
node_mcu{{"MSP430G2"}}

node_learner -->|"runs exercises on"| node_mcu
node_mcu -->|"runs firmware"| node_ex18
node_ex18 -->|"configures timer and port"| node_mcu
node_mcu -->|"runs firmware"| node_ex19
node_ex19 -->|"updates display outputs"| node_mcu
node_mcu -->|"runs firmware"| node_ex26
node_ex26 -->|"configures UART"| node_mcu
node_ex26 -->|"sends received bytes"| node_ex26
node_mcu -->|"runs firmware"| node_p21
node_p21 -->|"configures timers and GPIO"| node_mcu

click node_ex15 "https://github.com/edgarreis/codes-msp430g2/blob/master/EX15-BlinkLEDs3-Assembly/EX15.c"
click node_ex16 "https://github.com/edgarreis/codes-msp430g2/blob/master/EX16-InterruptPort-C/EX16.c"
click node_ex17 "https://github.com/edgarreis/codes-msp430g2/blob/master/EX17-TimerInterrupt-C/EX17.c"
click node_ex18 "https://github.com/edgarreis/codes-msp430g2/blob/master/EX18-TimerInterrupt-Debouncing-C/EX18.c"
click node_p21 "https://github.com/edgarreis/codes-msp430g2/blob/master/P21/P21.c"
click node_ex19 "https://github.com/edgarreis/codes-msp430g2/blob/master/EX19-Count7Seg-C/EX19.c"
click node_ex19b "https://github.com/edgarreis/codes-msp430g2/blob/master/EX19-Count7Seg-C/EX19b.c"
click node_ex20 "https://github.com/edgarreis/codes-msp430g2/blob/master/EX20-StepMotor-C/EX20.c"
click node_ex21 "https://github.com/edgarreis/codes-msp430g2/blob/master/EX21-ADCConverter-C/EX21.c"
click node_ex21a "https://github.com/edgarreis/codes-msp430g2/blob/master/EX21a-PWMController-C/EX21A.c"
click node_ex23 "https://github.com/edgarreis/codes-msp430g2/blob/master/EX23-LCD-Display-C/EX23.c"
click node_ex23a "https://github.com/edgarreis/codes-msp430g2/blob/master/EX23-LCD-Display-C/EX23a.c"
click node_ex23file "https://github.com/edgarreis/codes-msp430g2/blob/master/EX23-LCD-Display-C/Arquivos/ex23.c"
click node_ex23child "https://github.com/edgarreis/codes-msp430g2/blob/master/EX23-LCD-Display-C/Arquivos/C_ex231.c"
click node_ex26 "https://github.com/edgarreis/codes-msp430g2/blob/master/EX26-SerialCom-C/EX26.c"
click node_p22 "https://github.com/edgarreis/codes-msp430g2/blob/master/P22/P22.c"
click node_p22a "https://github.com/edgarreis/codes-msp430g2/blob/master/P22/p22a.c"
click node_assembly "https://github.com/edgarreis/codes-msp430g2/blob/master/EX01-Registradores-Assembly/EX01.asm"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_assembly toneBlue
class node_ex15,node_ex16,node_ex17,node_ex18,node_p21 toneAmber
class node_ex19,node_ex19b,node_ex20,node_ex21,node_ex21a,node_ex23,node_ex23a,node_ex23file,node_ex23child,node_ex26 toneMint
class node_p22,node_p22a toneRose
class node_learner,node_mcu toneIndigo
```

## Components

### Assembly Basics

- [Assembly Exercises](https://github.com/edgarreis/codes-msp430g2/blob/master/EX01-Registradores-Assembly/EX01.asm): `EX01-Registradores-Assembly/EX01.asm`

### GPIO and Timing

- [LED Timing](https://github.com/edgarreis/codes-msp430g2/blob/master/EX15-BlinkLEDs3-Assembly/EX15.c): `EX15-BlinkLEDs3-Assembly/EX15.c`
- [Port Interrupt](https://github.com/edgarreis/codes-msp430g2/blob/master/EX16-InterruptPort-C/EX16.c): `EX16-InterruptPort-C/EX16.c`
- [Timer Interrupt](https://github.com/edgarreis/codes-msp430g2/blob/master/EX17-TimerInterrupt-C/EX17.c): `EX17-TimerInterrupt-C/EX17.c`
- [Debounced LEDs](https://github.com/edgarreis/codes-msp430g2/blob/master/EX18-TimerInterrupt-Debouncing-C/EX18.c): `EX18-TimerInterrupt-Debouncing-C/EX18.c`
- [Button and Timers](https://github.com/edgarreis/codes-msp430g2/blob/master/P21/P21.c): `P21/P21.c`

### Peripheral Exercises

- [Seven-Segment Counter](https://github.com/edgarreis/codes-msp430g2/blob/master/EX19-Count7Seg-C/EX19.c): `EX19-Count7Seg-C/EX19.c`
- [Display Variant](https://github.com/edgarreis/codes-msp430g2/blob/master/EX19-Count7Seg-C/EX19b.c): `EX19-Count7Seg-C/EX19b.c`
- [Stepper Motor](https://github.com/edgarreis/codes-msp430g2/blob/master/EX20-StepMotor-C/EX20.c): `EX20-StepMotor-C/EX20.c`
- [ADC and PWM](https://github.com/edgarreis/codes-msp430g2/blob/master/EX21-ADCConverter-C/EX21.c): `EX21-ADCConverter-C/EX21.c`
- [ADC LED Control](https://github.com/edgarreis/codes-msp430g2/blob/master/EX21a-PWMController-C/EX21A.c): `EX21a-PWMController-C/EX21A.c`
- [LCD Display](https://github.com/edgarreis/codes-msp430g2/blob/master/EX23-LCD-Display-C/EX23.c): `EX23-LCD-Display-C/EX23.c`
- [LCD Variant](https://github.com/edgarreis/codes-msp430g2/blob/master/EX23-LCD-Display-C/EX23a.c): `EX23-LCD-Display-C/EX23a.c`
- [LCD Example](https://github.com/edgarreis/codes-msp430g2/blob/master/EX23-LCD-Display-C/Arquivos/ex23.c): `EX23-LCD-Display-C/Arquivos/ex23.c`
- [LCD Example Variant](https://github.com/edgarreis/codes-msp430g2/blob/master/EX23-LCD-Display-C/Arquivos/C_ex231.c): `EX23-LCD-Display-C/Arquivos/C_ex231.c`
- [Serial Communication](https://github.com/edgarreis/codes-msp430g2/blob/master/EX26-SerialCom-C/EX26.c): `EX26-SerialCom-C/EX26.c`

### Additional Programs

- [P22 Program](https://github.com/edgarreis/codes-msp430g2/blob/master/P22/P22.c): `P22/P22.c`
- [P22 Variant](https://github.com/edgarreis/codes-msp430g2/blob/master/P22/p22a.c): `P22/p22a.c`

### Other components

- **Learner**
- **MSP430G2**

## Connections

- Learner → MSP430G2: runs exercises on (evidence: `README.md`)
- MSP430G2 → Debounced LEDs: runs firmware (evidence: `EX18-TimerInterrupt-Debouncing-C/EX18.c`)
- Debounced LEDs → MSP430G2: configures timer and port (evidence: `EX18-TimerInterrupt-Debouncing-C/EX18.c`)
- MSP430G2 → Seven-Segment Counter: runs firmware (evidence: `EX19-Count7Seg-C/EX19.c`)
- Seven-Segment Counter → MSP430G2: updates display outputs (evidence: `EX19-Count7Seg-C/EX19.c`)
- MSP430G2 → Serial Communication: runs firmware (evidence: `EX26-SerialCom-C/EX26.c`)
- Serial Communication → MSP430G2: configures UART (evidence: `EX26-SerialCom-C/EX26.c`)
- Serial Communication → Serial Communication: sends received bytes (evidence: `EX26-SerialCom-C/EX26.c`)
- MSP430G2 → Button and Timers: runs firmware (evidence: `P21/P21.c`)
- Button and Timers → MSP430G2: configures timers and GPIO (evidence: `P21/P21.c`)
