more interesting.
The first byte in a serial transmission always has the command
number (if you’re using binary
commands) or is a textual character.
The rest of the main program loop
just checks that first byte to see what
to do next.
If the first byte is a binary
command, then the program goes to
the corresponding function which
executes that command. If the first
byte is a textual character, then the
program goes to the memory location
marked by ‘cmd_text’ where the rest
of the command string is received,
processed, and finally the command
is executed by the processor.
Assembly Instructions
You can find detailed assembly
and test instructions by going to
www.kitsdoneright.com/daq.html and
clicking on the ‘Assembly instructions’ link. You will also find a parts
placement diagram, the images for
the PCB (should you decide to make
your own), and the parts list on the
website. You can also download the
complete firmware ( DAQ.asm) so you
can make your own custom modifications to the code.
The hex file is provided for
download so you can just program
the PIC without having to first
compile the code. You can purchase
a preprogrammed PIC, as well as the
printed circuit board or the entire kit
on the website. The website has
many other resources, including
programming examples and a utility
program for testing your completed
DAQ.
Possible Improvements
I use the DAQ board quite a bit,
and it works very well for me, but
there are a few improvements that
could be made. The most obvious
improvement would be to convert
it to USB. This would greatly
increase the speed of the DAQ,
although it would also decrease the
distance your project can be from
the computer.
In regards to protection, you may
have noticed that the DAQ inputs are
protected relatively well to voltages
over +5V, but not as well if you apply
a negative voltage. In this case, the
input pin would be clamped at -.6V,
overstressing the PIC by .3V more
than the manufacturer’s specification
allows for.
The addition of
Schottky diodes in
parallel with the
zeners might be a
good idea to clamp
any negative voltages
to -.2V. One other
improvement that
wouldn’t take more
than some additional
firmware would be
the addition of
analog inputs.
Turning PORT1 pins
0-3 and PORT2 pin 0
into analog inputs
wouldn’t be too
difficult if you’re
using the binary commands. If you want
to use the text commands, however, you
will have to convert
the binary number
produced by the ADC
into text — doable,
but a little more
difficult. The good
news is, there’s lots of
room left in the PIC
to add features. The
current program only
takes up about half of
the program memory
available. NV
PARTS LIST
RESISTORS
❑ R1-R4
❑ R6, R7
❑ R5
❑ R8-R27
❑ R28-R46
SUPPLIER
Panasonic
Panasonic
Panasonic
Panasonic
Panasonic
PART NO.
ERD-S1TJ1R0V
ERD-S2TJ102V
ERD-S2TJ103V
ERD-S1TJ221V
ERD-S2TJ101V
DESCRIPTION
1 ohm, 1/2 watt, 5%, Carbon Film
1K ohm, 1/4 watt, 5%, Carbon Film
10K ohms, 1/4 watt, 5%, Carbon Film
220 ohm, 1/2 watt, 5%, Carbon Film
100 ohm, 1/4 watt, 5%, Carbon Film
CAPACITORS
❑ C1-C3 AVX Corporation SA305E474MAA
❑ C4 Panasonic ECE-A1CKS100
❑ C5-C8 AVX Corporation SA305E474MAA
DIODES
❑ D1-D20
Fairchild
1N751ATR
ICs
❑ U1
❑ U2
❑ U3
❑ U4
Microchip
Linear Technology
NJR
ECS
PIC16F873A-I/SP
LT1181ACN
NJM7805FA
ECS-2100A-018
CONNECTORS
❑ P1 CUI, Inc.
❑ P2 Kobiconn
❑ P3, P5, P7 Phoenix Contact
P8, P10, P11
❑ P4, P6
❑ P9, P12
PJ-202A
152-3409
1984785
AMP
AMP
640456-4
640456-8
MISCELLANEOUS
❑ AC Adapter, 9 VDC, 300 mA
❑ Xicon, 412-109033
❑ Power Supply
0.47 µF, 50V, Ceramic
10 µF, 16V, Electrolytic
0.47 µF, 50V, Ceramic
5.1V zener, 1/2 watt
Microcontroller
RS232 Driver/Receiver
Voltage Regulator, 5V, 1.5A
1.8432 MHz Crystal Oscillator
Power Jack, 2.1 mm, PCB mount
9 pin D-sub Receptacle
Terminal Block, 3. 5 mm, Four Position
Vertical Header, Four Position, . 100 in
Vertical Header, Eight Position, . 100 in
42
March 2006