Texas Instruments TLV320AIC3007EVM-K TV Converter Box User Manual


 
WritingScripts
www.ti.com
Thisscriptbeginswithacomment,specifiesthatafastI
2
Cbusisused,thenwrites0xAA0x55totheI
2
C
slavedeviceataddress0x90,writingthevaluesintoregisters0x03and0x04.Thescriptthenreadsback
twobytesfromthesamedevicestartingatregisteraddress0x03.Notethattheslavedevicevaluedoes
notchange.ItisunnecessarytosettheR/WbitforI
2
Cdevicesinthescript;thereadorwritecommands
doesthat.
HereisanexampleofusinganSPIdevicethatrequires16-bitregisteraddresses:
#setupTSC2101forinputandoutput
#usesSPI16interface
#thisscriptsetsupDACandADCatfullvolume,inputfromonboardmic
#
#Page2:Audiocontrolregisters
w1000000080000000453144FD400031C4
w13601120000000807F00C5FE31407C000200C40000002310FE
00FE00
Notethatblanklinesareallowed.However,besurethatthescriptdoesnotendwithablankline.
Althoughendingwithablanklinedoesnotcausethescripttofail,theprogramdoesexecutethatline,and
therefore,maypreventtheuserfromseeingdatathatwaswrittenorreadbackonthepreviouscommand.
Inthisexample,thefirsttwobytesofeachcommandarethecommandwordtosendtotheTSC2101
(0x1000,0x1360);thesearefollowedbydatatowritetothedevicestartingattheaddressspecifiedinthe
commandword.Thesecondlinemaywrapintheviewerbeingusedtolooklikemorethanoneline;
carefulexaminationshows,however,thatonlyonecarriagereturnisonthatline,followingthelast00.
Anytexteditorcanbeusedtowritethesescripts;Jeditisaneditorthatishighlyrecommendedforgeneral
usage.Formoreinformation,goto:http://www.jedit.org.
Oncethescriptiswritten,itcanbeusedinthecommandwindowbyrunningtheprogram,andthen
selectingOpenCommandFile...fromtheFilemenu.Locatethescriptandopenit.Thescriptthenis
displayedinthecommandbuffer.Theusercanalsoeditthescriptonceitisinthebuffer,butsavingofthe
commandbufferisnotpossibleatthistime(thisfeaturemaybeaddedatalaterdate).
Oncethescriptisinthecommandbuffer,itmaybeexecutedbypressingtheExecuteCommandBuffer
button.Ifbreakpointsareinthescript,thescriptexecutestothatpoint,andtheuserispresentedwitha
dialogboxwithabuttontopresstocontinueexecutingthescript.Whenreadytoproceed,pushthat
buttonandthescriptcontinues.
Hereanexampleofa(partial)scriptwithbreakpointsusingtheAIC33EVMasanexample:
#setupAIC33forinputandoutput
#usesI2Cinterface
Ii2cfast
#reg07-codecdatapath
w30078A
r30071
d1000
#regs15/16-ADCvolume,unmuteandsetto0dB
w300F0000
r300F2
b
Thisscriptwritesthevalue8Aatregister7,thenreadsitbacktoverifythatthewritewasgood.Adelayof
1000ms(onesecond)isplacedafterthereadtopausethescriptoperation.Whenthescriptcontinues,
thevalues0000iswrittenstartingatregister0F.Thisoutputisverifiedbyreadingtwobytes,andpausing
thescriptagain,thistimewithabreak.Thescriptdoesnotcontinueuntiltheuserallowsittobypressing
OKinthedialogboxthatisdisplayedduetothebreak.
50USB-MODEVMProtocolSLAU286June2009
SubmitDocumentationFeedback