180 likes | 429 Views
FEST. ECE 477 Fall 2011 TEAM 5 Gloria Budiman Alexander Kidarsa Christopher Sakalis Vishal Gala. fEST. Far End Speakerphone Test System. Software design. State Machine Different phases of test Optimize power consumption based on current state Interrupt Driven
E N D
FEST ECE 477 Fall 2011 TEAM 5 Gloria Budiman Alexander Kidarsa Christopher Sakalis Vishal Gala
fEST • Far • End • Speakerphone • Test • System
Software design • State Machine • Different phases of test • Optimize power consumption based on current state • Interrupt Driven • Flexible peripheral control • Minimize waste of CPU time
Peripherals • I2C • SCI • Mux1: Serial LCD • Mux2: SPL • SPI • A: SD card • B: Codec I/O • PWM + ADC • Timer2: 100Hz • 100 interrupts for “natural one second” (hint: BCD) • 20 interrupts for buttons sampling • Timer0: 16kHzfor codec
codebase • Boring Boilerplate • Adc.c • CpuTimers.c • Epwm.c • I2C.c • PieCtrl.c • PieVect.c • Sci.c • Spi.c • SysCtrl.c • usDelay.asm • … +16 more • FatFS • ff.c • Made in EE063 • Main.c • dialog.c • gpioSetup.c • F28035_FLASH.cmd* • mmc-c28x.c* • fft.c • … more coming
fatfs • FAT32 filesystem handler • Requires low-level driver • mmc-c28x.c in our case • Requires 100Hz timer
The machine: state0 • Initialization spree • GPIO • PLL (Set to 60MHz) • Low Speed Peripherals Clock Prescaler (LOSPCP) • Interrupt Vectors • Initialize peripherals • Entry: (Hard) Reset • Next state: Always
The machine: main • Hello World! User! • Initialize LCD • Initialize Codec • Wake the SD card upSet LOSPCP as slow as possible • Entry: User interaction, immediate from State0 • Next state: User interaction
The machine: COnfiguration • Test options • Full Duplex • Far End only • Near End only • Source file selection, loop, test length • Entry: User interaction • Next state: User interaction
The machine: calibration • Test output level • Volume digitally adjusted by re-programming the codec • Using Sound Pressure Level • Characterize and equalize the speaker • Entry: User interaction • Next state: User interaction
The machine: preset test • Time delay • Frequency response • THD (+N?) • InterModulation Distortion • Crosstalk • …+n! more • Entry: User interaction • Next state: SD card present
The machine: free-run test • Marathon burn-in test • Entry: SD card present • Next state: User interaction, pre-programmed timer exceeded, SD card full
The machine: full • Detection: f_write() returns ByteWrittenless than ByteToWrite • Entry: see above • Next state: Trap state, user intervention required
Memory map Not to scale As defined in F28035_FLASH.cmd RAM usage will increase as FFT joins the party
Code buster • LCD is 20x4 (non-graphical) • No means of conveying graphical data • Preset Test result has to be stored somewhere if SD card is not present • f_getfree() returns number of free cluster • Problem: out-of-sync file system structure returns incorrect count
Code buster • Minimize critical section • Prevent file system collapse on apocalypse