General purpose PICBasic programmable board
This web page documents a board with a variety of inputs and outputs,
designed to be easily programmed with PICBasic.
Board size is 2.75" square.
Project timeframe: August 2006
Client: Leo Villareal
Initial webpage creation: August 22 2006
- RS-485 / DMX input and output, switchable termination
- 16 NFET-switched outputs, up to 3A each
- DC 8-14V input, 100mA max, polarity protected, with on/off switch
- 3 pole DIP switch for general use
- 8 position selector switch for general use
- finger-turnable potentiometer
- screwdriver-turnable potentiometer (trimpot)
- 2 pushbuttons, with terminal block to wire alternative external
- 2 external switch inputs
- Red/Green status LED
- 6-pin header for USB TTL serial cable (Mouser 626-DLP-TTL232R)
- 5-pin header for PIC programming via ICD2 (or any other
in-circuit capable programmer)
My client has a need for a simple to program board to control external
LEDs (or laser diodes or whatever), as well as generate (and possibly
receive) DMX. It
has to be small, battery-powerable, have flexible controls, and
Not much of any trickyness. The pots are 5K so the PIC's A/D can
read them without buffering. The 16 SOT-23 NFETs all have 100K
pulldowns to keep them off when power is first applied and PIC is
starting up (avoids a flash of external LEDs or whatever at
power-on). The PIC 18F4620 is the microcontroller used. The
debugging serial in/out is also the two external switches, so they
can't be used simultaneously. Likewise, the pushbuttons use the
PIC PGC/PGD programming pins, so they cannot be pressed while the PIC
is being programmed. Not a big deal.
Mistakes, tools and future work
All in all pretty good, pcb changes for the prototypes were minor and
are easily fixed for the next run of boards. The two errors that
- Wired the pushbuttons wrong, so they were always on. Made
it impossible to program. Ack.
- Pullup resistors for the BCD rotary DIP switch were forgotten.
Tools used: Eagle 4.16 (www.cadsoft.de), which
I wholeheartedly recommend, the CCS PCH C compiler (www.ccsinfo.com),
horrendously buggy for 18 months and is now more or less reasonable,
and PICBasic, which I got into for the first time for this board and
like a lot. (www.melabs.com)
Schematics? Board layouts?
Gerbers? BOM? Software downloads? ...
Sorry, this was a paying client project and the IP is not available for
give-away. If you would like to purchase some boards or have a
proposal for commercialization of the design, feel free to contact me.
However, sample PICBasic code that runs everything:
And CCS C code that does a basic test of the hardware:
test C code