About XSCOPE

New to XMOS and XCore? Get started here.
Post Reply
cjf1699
Active Member
Posts: 48
Joined: Fri Mar 16, 2018 2:30 pm

About XSCOPE

Post by cjf1699 »

Hi everyone,
These days I have been learning xscope. I learned from AN00196 and the Xtimecomposer studio user guider that it seems that there are 2 methods to initialize xscope method,
one is to declare in the config.xscope file, for example:
<?xml version="1.0" encoding="UTF-8"?>

<!-- ======================================================= -->
<!-- The 'ioMode' attribute on the xSCOPEconfig -->
<!-- element can take the following values: -->
<!-- "none", "basic", "timed" -->
<!-- -->
<!-- The 'type' attribute on Probe -->
<!-- elements can take the following values: -->
<!-- "STARTSTOP", "CONTINUOUS", "DISCRETE", "STATEMACHINE" -->
<!-- -->
<!-- The 'datatype' attribute on Probe -->
<!-- elements can take the following values: -->
<!-- "NONE", "UINT", "INT", "FLOAT" -->
<!-- ======================================================= -->

<xSCOPEconfig ioMode="none" enabled="true">
<Probe name="Value" type="CONTINUOUS" datatype="UINT" units="Value" enabled="true"/>
</xSCOPEconfig>
The other way is to define a init function in the file where you use xscope, like this:
void xscope_user_init ( void ) {
xscope_register (2,
XSCOPE_CONTINUOUS , " Microphone Left ", XSCOPE_UINT , "mV",
XSCOPE_CONTINUOUS , " Microphone Right ", XSCOPE_UINT , "mV"
);
}
Am I right? And is there any difference between these 2 methods?
Thanks a lot!


User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

No real difference although I suppose one is less intrusive in your source file. Also, using the .xscope method you don't need -fxscope in the Makefile, although it won't hurt if you do have it.
cjf1699
Active Member
Posts: 48
Joined: Fri Mar 16, 2018 2:30 pm

Post by cjf1699 »

Thank you for your answer. I met a strange problem which had confused me for a long time. I 'm working on the example AN00162 and I want to trace my data in real-time mode. I used xSCOPE in the first way. I wrote a config.xscope file which define the probes. And I made a proper run configuration for it.
Target I/O: xSCOPE and I selected the real-time mode.
And Finally I called the xscope_int() function in the i2s_loopback function and ran the project. It is supposed to display the wave of the audio data ,and at the same time the music being input should be looped back to the output channel. But weird things happened. Although the board was connected. There was nothing displayed on the scope but two straight lines whose values are both 0. And meanwhile, the speaker played a ring bell sound for about 1.5 seconds and then kept playing buzz.
How did it come? And what should I do? I uploaded my project and am looking forward to help.
Thanks a lot!
cjf
Attachments
AN00162_i2s_loopback_demo.zip
(1.52 MiB) Downloaded 213 times
AN00162_i2s_loopback_demo.zip
(1.52 MiB) Downloaded 213 times
User avatar
larry
Respected Member
Posts: 275
Joined: Fri Mar 12, 2010 6:03 pm

Post by larry »

It might help to try realtime xSCOPE in a simple example first, such as AN00196
cjf1699
Active Member
Posts: 48
Joined: Fri Mar 16, 2018 2:30 pm

Post by cjf1699 »

larry wrote:It might help to try realtime xSCOPE in a simple example first, such as AN00196
I tried, but it can only run on the simulator.
Post Reply