12.07.2015 Views

VS1033 - MP3/AAC/WMA/MIDI AUDIO CODEC - VLSI Solution

VS1033 - MP3/AAC/WMA/MIDI AUDIO CODEC - VLSI Solution

VS1033 - MP3/AAC/WMA/MIDI AUDIO CODEC - VLSI Solution

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>VLSI</strong><strong>Solution</strong> y<strong>VS1033</strong>c<strong>VS1033</strong>C9. OPERATION9.8 Extra ParametersThe following structure is in X memory at address 0x1940 and can be used to change some extra parametersor get various information. The chip ID is also easily available.#define PARAMETRIC_VERSION 0x0001struct parametric {u_int32 chipID; /*1940/41 Initialized at reset for your convenience */u_int16 version; /*1942 - structure version */u_int16 midiConfig; /*1943 */u_int16 config1; /*1944 */u_int16 config2; /*1945 configs are not cleared between files */};u_int32 jumpPoints[16]; /*1946..65 file byte offsets */u_int16 latestJump; /*1966 index to lastly updated jumpPoint */s_int16 seek1; /*1967 file data inserted/removed bytes -32768..32767*/s_int16 seek2; /*1968 file data inserted/removed kB -32768..32767*/s_int16 resync; /*1969 > 0 for automatic m4a, ADIF, <strong>WMA</strong> resyncs */union {struct {u_int32 curPacketSize;u_int32 packetSize;} wma;struct {u_int16 sceFoundMask; /* SCE’s found since last clear */u_int16 cpeFoundMask; /* CPE’s found since last clear */u_int16 lfeFoundMask; /* LFE’s found since last clear */u_int16 playSelect; /* 0 = first any, initialized at aac init */s_int16 dynCompress; /* -8192=1.0, initialized at aac init */s_int16 dynBoost; /* 8192=1.0, initialized at aac init */} aac;struct {u_int32 bytesLeft;} midi;} i;Notice that reading two-word variables through the SCI WRAMADDR and SCI WRAM interface isnot protected in any way. The variable can be updated between the read of the low and high parts. Theproblem arises when both the low and high parts change values. To determine if the value is correct, youshould read the value twice and compare the results.The following example shows what happens when bytesLeft is decreased from 0x10000 to 0xffff andthe update happens between low and high part reads or after high part read.Address0x196a0x196b0x196a0x196bRead InvalidValue0x0000 change after this0x00000xffff0x0000Address0x196a0x196b0x196a0x196bRead ValidValue0x00000x0001 change after this0xffff0x0000No UpdateAddress Value0x196a0x196b0x196a0x196b0x00000x00010x00000x0001You can see that in the invalid read the low part wraps from 0x0000 to 0xffff while the high part stays thesame. In this case the second read gives a valid answer, otherwise always use the value of the first read.The second read is needed when it is possible that the low part wraps around, changing the high part, i.e.when the low part is small. bytesLeft is only decreased by one at a time, so a reread is needed onlyif the low part is 0.Version 1.00, 2008-02-01 52

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!