Upload
ruth-riley
View
24
Download
0
Embed Size (px)
DESCRIPTION
Team 1: Algorhythms Software Design Considerations. Device Mockup. Chip Communication. ATMEL ATMega16. ANALOG DEVICES “Blackfin” BF532. SPI. Code Organization. Interrupt-Driven Timing is critical Sound output at 48kHz Song needs to be updated at its tempo Sensors and Buttons - PowerPoint PPT Presentation
Citation preview
Team 1: AlgorhythmsSoftware DesignConsiderations
Chris ArgesChris [email protected]@purdue.edu
Radhika MulaniRadhika Mulani
[email protected]@purdue.edu
Sumanth PeddamathamSumanth [email protected]@gmail.com
Alex TuckerAlex Tucker
[email protected]@purdue.edu
Device Mockup
Chip Communication
ATMELATMELATMega16ATMega16
ANALOG ANALOG DEVICESDEVICES
““Blackfin” BF532Blackfin” BF532SPISPI
Code Organization
• Interrupt-Driven• Timing is critical
– Sound output at 48kHz– Song needs to be updated at its tempo
• Sensors and Buttons– Sampled at low frequency ~1kHz
• Intra-chip Communication– ATMEL talks to Blackfin via SPI
Main Flowchart
START
Initialize Registers
Idle Loop
Main Function (BF532)
START
Initialize RegistersBoot Blackfin
Idle Loop
Main Function (ATMega16)
Operational State Diagram
START
IDLE
LOAD
ERROR
PLAY
PAUSE
Atmel done booting Blackfin?Blackfin done initializing?
Headphones plugged in?
Load sucessful?
Load unsucessful?
Wait until reset.
Headphones unplugged?
*Reset
Headphones plugged in?
Track change?
ISR Flowcharts
MOD Update ISR (~50Hz):
START
Based on data from sensors and random values generate a new
part of the song and place in RAM to be played.
Update MOD player variables (position, current sample, etc),
based on new MOD data in ram.
RTI
Confirm Interrupt
START
DAC ISR (48KHz):
Confirm Interruptcur = 0;
audioOut = 0;
Is cur < TotalChan?
Based on mod player channel pointersaudioOut += curSample[cur]/TotalChan;
cur++;
Ouput audioOut;
RTI
Yes
No
Input ISR (ATMEL) (~1kHz)
START
Read in all sensor data and button pushes and store results;
Send results to Blackfin via SPI;
RTI
Confirm Interrupt
Blackfin ATMEL
START
Input all data from ATMEL;Send sensor input to appropriate
variables;Parse through button data;
RTI
Confirm Interrupt
SPI Receive ISR (~1kHz)
Button Push(n)?
Handle_Button_Push_n();YES
NO
Hierarchical Block Diagram
main()
init()
DAC_ISR() Input_ISR()SPI_Recieve_ISR()MODUpdate_ISR()
MODProcessRow()
MODUpdate()
MODProcessEffects()
MODHandleUpdateFlags()
MODPlayNote()
MODGetNotePeriod()
Send_Data()Play() ProcessSensorData()Pause() Volume() ChangeTrack()
ModFileLoad()
LoadOrders()LoadPatterns() LoadSamples()LoadSamplesData()