Atmel AT83SND2C MP3 User Manual
Page 24

Communication Protocol
3-20
AT83SND2CMP3 User Guide
7525A–MP3–07/05
Example 1 Figure 3-6 . Transfer a File From Remote Controller to Player Selected Memory
During the file write transfer, after the FS_FCREATE command, no other commands
than FS_FWRITE_BLOCK, FS_FWRITE_LAST_BLOCKor FS_FCLOSE are allowed to
finish the file transfer because the AT83SND2CMP3 is an optimized transfer mode.
To create the file “wr_test.mp3” (total size 1312 Bytes: 2 block of 512 bytes + last block
288 bytes):
Send FS_FCREATE ( 3 blocks, ‘w’ ‘r’ ‘_’ ‘t’ ‘e’ ‘s’ ‘t’ ‘.’ ‘m’ ‘p’ ‘3’ ‘\0’)
Wait for response SYSTEM_ACK* frame.
Send FS_FWRITE_BLOCK + 1st block of data (512 bytes),
Wait for response SYSTEM_ACK* frame.
Send FS_FWRITE_BLOCK + 2nd block of data (512 bytes)
Wait for response SYSTEM_ACK* frame.
send FS_FWRITE_LASTBLOCK ( 288 bytes ) + last block of data (288 bytes)
Wait for response SYSTEM_ACK* frame. The file is now created.
Note:
If Player response is SYSTEM_NACK to any command during this procedure, the Player
will return into the IDLE state and the file creation procedure will be aborted.
C o n tro lle r
P la ye r
T ra n s fe rin g A F ile
F ro m R e m o te
C o n tro lle r to P la ye r
F S _ F C R E A T E (N a m e o f F ile, N um ber of block to transfer)
S Y S T E M _ A C K + S T A T U S
F S _ F W R IT E _B LO C K + data
S Y S T E M _ A C K + S T
A T U S
P la y e r c re a te s th e
file o n s e le c te d
m e m o ry (in ro o t d ir).
N o w w a itin g fo r d a ta .
P la y e r p ro g ra m m s
n o w th e m e m o ry a n d
p re p a re N o w w a itin g
fo r d a ta .
F S _ F W R IT E _LA S T_BLO CK +
d a ta
S Y S T E M _ A C K + S T
A T U S
P la y e r p ro g ra m s th e
la s t b lo c k o f d a ta .
F ile is c lo s e d . N o
n e e d to s e n d th e
F S _ F C L O S E fra m e .