check the Experimenter pushbutton. If
it is depressed and the USB is ready to
transmit, the pot value is transmitted
over USB (using API putsUSBUART())
and is also displayed on the Experimenter
LCD. We also make use of the
stdio.h C library to help with data
formatting and the analog library to
digitize the pot value at the AN4 pin.
Rotary Encoder
Knob USB
Service Demo
This demo uses the Mini-Kit rotary
encoder as the data source to the
Experimenter. Rotary encoder data is
captured as a string containing direction
CCW (-) or CW (+) and accumulative
encoder rotation counts to the PC. The
data string originating on the
Experimenter will be displayed on both
the Experimenter LCD, as well as the PC
terminal. No additional software files
are included in the demo workspace.
Rotary encoder device drivers are
integrated into the Main function as
an interrupt service. The workspace
is included in the rotary demo folder.
Open EXPROTARY.mcs, then build
and download to the Experimenter.
The ProcessIO() is as follows:
In this example, we first look for
a rotary count difference before
proceeding. If there is a difference,
we format the string, display and
output it, and update the new rotary
count internally.
In Conclusion
We’ve embarked on long journey
in order to understand how to create
a virtual serial port to a PC using the
Experimenter, its USB interface, and
Microchip’s USB firmware stack. A
number of demos were covered, with
an introduction to a new analog
library for the Experimenter ADC. We
can now maintain required legacy
communications to a PC using this
new bag of tricks, and with the five
steps covered, we now have a
valuable tool set that creates a serial
port with minimal hardware and
software impact to any future
Experimenter designs. Until next
time, happy 32-bit processing! NV
Wireless… without
the high power
consumption!
Not all wireless applications
require a robust power
supply. That’s where Anaren
Integrated Radio (AIR)
modules come in!
> Industry’s easiest, most cost-effective RF implementation
> Low-power RF solution
> Virtually no RF engineering
experience necessary
> Tiny, common footprints
> Pre-certified/compliant:
FCC, IC, ETSI (as applicable)
> Choice of modules based
on TI CC11xx and CC25xx,
low-power RF chips:
433MHz, 868MHZ (Europe),
900MHz, 2.4GHz
To learn more, write
AIR@anaren.com, visit
www.anaren.com/air,
or scan the QR
code with your
smart phone.
ONLY
FOR 10K OR
MORE!
9
99
800-411-6596
www.anaren.com
In Europe, call +44-2392-232392
Available from:
February 2012 49