Texas Instruments TLV320AIC12KEVMB-K Calculator User Manual


 
6.9.2WritingScripts
KitOperation
www.ti.com
Ascriptissimplyatextfilethatcontainsdatatosendtotheserialcontrolbuses.Thescriptinglanguageis
quitesimple,asistheparserforthelanguage.Therefore,theprogramisnotveryforgivingaboutmistakes
madeinthesourcescriptfile,buttheformattingofthefileissimple.Consequently,mistakesshouldbe
rare.
Eachlineinascriptfileisonecommand.Thereisnoprovisionforextendinglinesbeyondoneline.Aline
isterminatedbyacarriagereturn.
Thefirstcharacterofalineisthecommand.Commandsare:
i=======Setinterfacebustouse
r=======Readfromtheserialcontrolbus
w=======Writetotheserialcontrolbus
#=======Comment
b=======Break
d=======Delay
Thefirstcommand,i,setstheinterfacetouseforthecommandstofollow.Thiscommandmustbe
followedbyoneofthefollowingparameters:
i2cstdStandardmodeI
2
CBus
i2cfastFastmodeI
2
Cbus
spi8SPIbuswith8-bitregisteraddressing
spi16SPIbuswith16-bitregisteraddressing
gpioUsetheUSB-MODEVMGPIOcapability
Forexample,ifafastmodeI
2
Cbusistobeused,thescriptwouldbeginwith:
ii2cfast
Nodatafollowsthebreakcommand.Anythingfollowingacommentcommandisignoredbytheparser,
providedthatitisonthesameline.Thedelaycommandallowstheusertospecifyatime,inmilliseconds,
thatthescriptwillpausebeforeproceeding.
Note:UNLIKEALLOTHERNUMBERSUSEDINTHESCRIPTCOMMANDS,THEDELAYTIME
ISENTEREDINADECIMALFORMAT.Also,notethatbecauseoflatencyintheUSBbus
aswellasthetimeittakestheprocessorontheUSB-MODEVMtohandlerequests,the
delaytimemaynotbeprecise.
Aseriesofbytevaluesfollowseitherareadorwritecommand.Eachbytevalueisexpressedin
hexadecimal,andeachbytemustbeseparatedbyaspace.Commandsareinterpretedandsenttothe
TAS1020bytheprogramusingtheprotocoldescribedinSection6.9.1.
ThefirstbytefollowingareadorwritecommandistheI
2
Cslaveaddressofthedevice(ifI
2
Cisused)or
thefirstdatabytetowrite(ifSPIisused—notethatSPIinterfacesarenotstandardizedonprotocols,so
themeaningofthisbytewillvarywiththedevicebeingaddressedontheSPIbus).Thesecondbyteisthe
startingregisteraddressthatdatawillbewrittento(again,withI
2
C;SPIvaries—seeSection6.9.1for
additionalinformationaboutwhatvariationsmaybenecessaryforaparticularSPImode).Followingthese
twobytesaredata,ifwriting;ifreading,thethirdbytevalueisthenumberofbytestoread,(expressedin
hexadecimal).
26TLV320AIC12KEVMB-KandTLV320AIC14KEVMB-KUser'sGuideSLAU229BOctober2007RevisedAugust2008
SubmitDocumentationFeedback