![Cirrus Logic CobraNet EV-2 Скачать руководство пользователя страница 39](http://html.mh-extra.com/html/cirrus-logic/cobranet-ev-2/cobranet-ev-2_development-manual_2608610039.webp)
Page 38
Rev. 2.0
CobraNet
TM
EV-2
Please note the difference between the “
peek
<target = address>” and “<target = MI>” commands. The
“
peek
<target = address>” command will return the raw value at the specified address location whereas the
“
peek
“<target = MI>” command will return a properly formatted value. The difference is significant
between the CM-1 and CM-2 where the variables are not stored in memory in the same format. An exam-
ple is the
rxPriority
MI variable.
On the CM-1:
peek 0x40104
- command
0x101000
- what is returned
peek
rxPriority
- command
0x1010
- what is returned
On the CM-2:
peek 0x40104
- command
0x1010
- what is returned
peek
rxPriority
- command
0x1010
- what is returned
This difference here is that the “
peek 0x40104
” command returns the raw value as it is stored in memory,
the “
peek
rxPriority
”
command returns the value as it should be represented. In this example the CM-1
returned a different value than the CM-2 for the “
peek 0x40104
” command but the same value for the
“
peek
rxPriority
” command; this is because the storage format of the variable in memory is different
between the CM-1 and CM-2. The main memory architecture difference between the CM-1 and CM-2 is
that the CM-1 has a 24-bit wide memory bus whereas the CM-2 has 32-bit wide memory bus. In the above
example the
rxPriority
MI variable is an Integer16 data type. On the CM-1 this type of data uses the mid-
dle and upper byte of the 24-bit memory location to store the data whereas the CM-2 stores the data in the
lower two bytes.
In summary, using the MI variable name will return data in the proper format. Using the address will return
the raw data at the address location.
This also applies to the Poke command. When using the “
poke
<target = address> <value>” command you
must pay attention to how the data (i.e. the <value>) is stored on the respective CM. Where supported,
using the “
poke
<target=MI> <value> [offset]” command means that the format of <value> is independent
of how the data is stored. This allows for writing a command line interface script that works on either the
CM-1 or the CM-2.
Содержание CobraNet EV-2
Страница 29: ...Page 28 Rev 2 0 CobraNetTM EV 2 Drawings ...
Страница 46: ...CobraNetTM EV 2 Page 45 ...