Background Telemetry Channel (BTC) on the BlackFin

advertisement
Background Telemetry
Channel (BTC) on the BlackFin
Presented by Alan Martin
Winter 2004 - ENCM 515
What is it?
BTC is a method of communication
between an embedded processor (the
Blackfin in this case) and the host (your
computer).
This communication occurs in the
background, not interfering with other
tasks that the processor may be
performing at the time
How does it work?
BTC uses shared registers that both the
host and target application have
read/write access to during program
run-time
BTC is designed for use over a JTAG
connection through an emulator
USB works, but to a limited extent
Why do I care?
You can view data without having to
stop the processor first.
You can view data that is constantly
changing, and watch it change
You can change data values while the
program is running, and the program
will immediately use these new values
without having to recompile
WOW! How do I use it?
You need to include a library file with
your project – libbtc532.dlb on the
Blackfin 533
You should also include btc.h with your
project, unless you know all the macros
you’ll need and define them yourself
(this is a waste of time in my opinion,
since the header file is easy to use)
Is that it?
Not entirely.
You still need to define some BTC
channels in your program
You also need to initialize BTC
Finally, you need to set the priority of
BTC
Channels? Like CNN?
You need to define a name for each channel
(basically a label for some data you will read)
You also need to define the starting address and the
length of the channel, much like a circular buffer
Initialize? Priority? What?
BTC priority is determined by where you put
the btc_poll function call. For example:



Placing it in a high-priority interrupt effectively makes it
high priority
Placing it in a low-priority interrupt gives it low priority
Placing it in a loop in the main body of the function can have
different effects depending on how interrupts on your system
work
Are you quite finished?
Well… no.
BTC is now setup and ready for use, but
you have to setup the BTC window in
VisualDSP++ to read/write the values.
You also need to do a couple things in
order to view a plot being updated by
BTC as you go.
BTC memory?
The BTC memory window
is a debug window, much
like Plot. It can be
accessed through the
same menu
Double-click on a number
to edit it (if possible).
Plot windows with BTC? How?
Open a plot window as
normal
Right click on the
window and select Auto
Refresh Settings… and
then select the settings
you need
Don’t forget to set the
refresh rate and activate
the Auto Refresh
Now are you finished?
Yes. BTC is now ready to use! Build
the program, run it, and you’ll see BTC
in action!
You lied! This doesn’t work!
The simulator does not currently
support BTC
Using the USB connection will give you
a much more limited amount of BTC.
You can still view arrays, but only one
plot at a time can be updated.
(There may be other limits as well, but
those are what I have found)
Are there any examples?
There are a few sample programs
available that use BTC.




Timer run using C code
Timer run using Assembly code
FFT code, which updates a plot
Audio example, where you can modify a
value using BTC for volume control
Did you say Assembly code?
Yes, I did. BTC can be run in Assembly
code as well as C/C++. The code is
only slightly more complicated.
Now I can use BTC?
Now you can use BTC.
For best learning, download one of the
examples and run it. The examples
come with a readme.txt file that
explains how to operate BTC in
VisualDSP++.
There’s no better way to learn than by
doing
Who told you what to say?
(aka References)
“VisualDSP++ Development Environment for Analog
Devices Embedded Processors for Digital Signal
Processing”, Analog Devices, 2003
“VisualDSP++ Getting Started Guide for 16-bit
Processors”, Analog Devices, n.d.
Examples programs of BTC operation from sample
programs installed with VDSP 3.5
Download