Open saragervan opened 4 days ago
---
title: System Configuration and Initialization
---
flowchart TB
A(["Start"]) --> B(["Configure ports"])
B --> C["PINSEL configuration"]
C --> D["GPIO configuration: directions & interrupts"]
D --> E(["Timers configuration"])
E --> F["Timer0 initialization"]
F --> G["Match0 configuration for ADC"]
G --> H["Enable Timer interruption"]
H --> I(["ADC configuration: Channel0 & interrupt"])
I --> J(["DAC configuration"])
J --> K(["DMA configuration"])
K --> L["Configure LLI, Channel0, Channel1, interrupts"]
L --> M(["Configure i2c: LCD transmission"])
M --> N(["Wait for interrupts"])
N --> N
---
title: System operation - Tuning functionality
---
flowchart TB
A([Press push buttom<br/>P2.10])
A --> |EINT0| B([EINT0_Handler])
B --> C[Flag tuning mode CLEAR?]
C --> |Yes| CA[ SET flag tuning mode]
C --> |No| CB[CLEAR flag tuning mode]
CB --> CB1[Instrument mode]
CA --> CC[Tuning mode]
CC --> D[start timer0]
D --> E[wait interrupt]
E --> |Match0=30sec0nds| F[timer0 Handler]
F --> G[clear interrupt flag]
G --> H[Start AD conversion<br/>Channel 5 P1.31 AD0.5]
H --> |conversion DONE| I[ADC interrupt Handler]
I --> |DMA| J[Save lectures in buffer]
J --> K[Buffer full?]
K --> |Yes| KA[DMA interrupt<br/>Terminal Count]
K --> |No| KB[Continue conversions] --> H
KA --> L[DMA IRQ Handler]
L --> M[clear interrupt<br/>SET buffer_full flag]
M --> N[Call find_tune function<br/>-sound analysis-]
N --> O[Find tune process]
O --> P[Current Frequency obtained]
P --> Q[Send to LCD]
---
title: System operation - Instrument functionality
---
flowchart TB
A([Press push buttom])
A --> |GPIO interrupt| B[EINT3 Handler]
B --> C[Identify port]
C--> D[Go to corresponding musical note]
D --> E[Send to DAC]
E --> |DMA| F[Play sound]