Project
Figure 6. The Digital Filter Development Board is teamed up
with a Little Bits to complete the realization of a
PIC10F206 bit-bang serial port.
Communicating With Little Bits
There are no USARTs (Universal Synchronous
Asynchronous Receiver Transmitters) or UARTs (Universal
Asynchronous Receiver Transmitters) contained within the
PIC10F206 silicon. So, there’s no native PIC10F206 serial
communications functionality. Just because the specialized UART hardware doesn’t exist doesn’t mean we can’t
implement a software PIC10F206 UART of our own.
In fact, we can do just that and — thanks to the HI-TECH
PICC C compiler — we won’t have to write any of the serial
communications drivers from scratch. All of the bit-bang serial driver code that comes with HI-TECH PICC C compiler is
shown in Listing 5. You can study the code in detail if you
wish. However, the only things you have to know about the
serial driver are the serial functions that you will use when
applying the driver code. To send a character, use the putch
function. To receive a character, use the getch function. A
optional function called getch echoes the incoming character.
This is where the 20-pin female connector I added to my
Little Bits comes into play. As you can see in Figure 6, I’ve
called upon a Digital Filter Development Board to aid the
Little Bits in getting its serial port operational. I’ve wired the
Digital Filter Development Board’s SP233ECT RS-232 IC
into one of the PIC10F206 microcontrollers on Little Bits via
a 20-pin male header on the Digital Filter Development
Board. Only four connections are necessary, with power and
ground being givens. Look again at the beginning of the
code in Listing 5. You’ll see that I’ve designated GP2 as the
transmit pin and GP3 as the receive pin and specified a baud
rate of 9600 bps. I’ve detailed the PIC10F206-to-Digital Filter
E
l
e
c
t
r
o
n
i
c
s
NUTS & VOLTS
F
o
r
E
v
e
r
y
t
h
i
n
g
Interface a sharp LCD display to your BASIC Stamp® or other
micro-controller project with ease. No-solder wiring harnesses
and easy mounting kits available too. See www.seetron.com today.
• 3.2 x 1.4 in. supertwist LCD
• 2400/9600 baud serial
• Low (≈2mA) current draw
• Great with BASIC Stamps®
BPI-216N
• 3.2 x 2 in. backlit LCD
• 1200-9600 baud serial ILM-216L
• Advanced protocol, 4 switch inputs
• EEPROM for configuration settings
• Favorite for OEM applications
• 3.2 x 1.4 in. graphics LCD
• 2400/9600 baud serial
• Font and 15 screens in EEPROM
• Easily draw points, lines, screens
SGX-120L
• 3 x 2 in. supertwist LCD
TRM-425L
• 1200-9600 baud serial
• ESD-protected, 4x4 keypad input
• Store up to 95 screens in EEPROM
1939 S. Frontage Rd. #F, Sierra Vista, AZ 85635
phone 520-459-4802 • fax 520-459-0623
www.seetron.com • sales@seetron.com
46
Circle #117 on the Reader Service Card.
Circle #123 on the Reader Service Card.
JANUARY 2005