MATLAB EMBEDDED IDE LINK 4 - FOR USE WITH TEXAS INSTRUMENTS CODE COMPOSER STUDIO User's Guide Page 37

  • Download
  • Add to my manuals
  • Print
  • Page
    / 575
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 36
Getting Started with Automation Interface
a Enter ddatv = read(cc,address(cc,'ddat'),'double',4).
MATLAB software responds with
ddatv =
16.3000 -2.1300 5.1000 11.8000
b Enter idatv = read(cc,address(cc,'idat'),'int16',4).
Now MATLAB software responds
idatv =
-1 508 647 7000
If you used 8-bit integers (int8), the returned values would be incorrect.
idatv=read(cc,address(cc,'idat'),'int8',4)
idatv =
10-41
c Y ou can change the valu es stored in ddat by entering
write(cc,address(cc,'ddat'),double([pi 12.3 exp(-1)...
sin(pi/4)]))
The double argument directs MATLAB software to write the values to
the processor as double-precision d ata.
d To change idat,enter
write(cc,address(cc,'idat'),int32([1:4]))
Here you w rite the data to the proce ssor as 32-bit integers (convenient
for representing phone numbers, for example).
e Start the program running again by entering the following command:
run(cc,'runtohalt',30);
2-15
Page view 36
1 2 ... 32 33 34 35 36 37 38 39 40 41 42 ... 574 575

Comments to this Manuals

No comments