Sunteți pe pagina 1din 20

c 

 Ê

c     


 
!" # 
$  % &
" 
   %
&   !Ê


 '()*+,Ê
The color Inchworm+ Assembly Manual including schematic.Ê


-
.  ,
 % 

     %!Ê


Ê Microchip ICD2 MPLAB IDE 7.xx compatibleÊ
Ê Programs the latest PIC chips always (16F887 is brand new and supported)Ê
Ê rDebugs most FLASH based PICs (more and more common with every new PIC)Ê
Ê ·ery high quality double sided PCB will last for many yearsÊ
Ê Fun and Easy to build, after all when you work with microcontrollers you'll generally
need to be able to solderÊ
Ê üreat manual, many inexpensive PIC programmers have very limited if any
documentationÊ
Ê þ· up to 1A power supply built in for your target projects, this is very rare among
inexpensive programmersÊ
Ê Designed to fit in a Hammond 1þ 1B case, few kits consider an enclosureÊ
Ê Can also be powered from your project, requires approx 60ma max.Ê
Ê hses a common inexpensive 7.þ - 1þ·DC AC wall adapter, many programmers
require 18·DC suppliesÊ
Ê Common parts used throughout design means easy to repair, people DO break their
ICD2s ($$$)Ê

c 
Ê
Ê hpgradeable to the very fast hSB version with the hnicorn KitÊ
Ê Switch / jumper controlled target power (switch optional, jumpers standard)Ê
Ê Switch / jumper controlled ·PP (switch optional, jumpers standard)Ê
Ê Software (MPLAB) controlled target power (optional BS2þ0 PFET)Ê

Microchips MPLAB IDE 7.60 current version as of this writing, is the tool that professional
PIC programmers use. You can download it free fromhttp://www.microchip.com it includes
everything you'll need to use your Inchworm ICD2.Ê

rDebugging makes programming and learning PICs very easy as you can stop, examine and
modify your code and/or symbols & variables at will.Ê

ICD2 bootloader firmware for a 16F877A Inchworm 16F877A Firmware supports both
Inchworm+ & InchwormÊ

Inchworm+ mounted on the Unicorn USB Experimenter (many times faster than the RS232 based Inchworm+).Ê

ÊÊ
.cc* .Ê

c     


 
!" # 
$  % &
" 
   %
&   !Ê


 &"c 
- Ê


./ -, 0, 12&& &1Ê

I've created a quick start poster to get you started with your first PIC program. Schematics
and source code for the Firefly 16F88 and a handful of popular PICs. Also a quick intro to
Microchips MPLAB IDEÊ

-
.  ,
 % 

     %!Ê


Ê Microchip ICD2 MPLAB IDE 7.xx compatibleÊ
Ê Programs the latest PIC chips always (16F887 is brand new and supported)Ê
Ê rDebugs most FLASH based PICs (more and more common with every new PIC)Ê
Ê ·ery high quality double sided PCB will last for many yearsÊ
Ê Fun and Easy to build, after all when you work with microcontrollers you'll generally
need to be able to solderÊ
Ê üreat manual, many inexpensive PIC programmers have very limited if any
documentationÊ
Ê þ· up to 1A power supply built in for your target projects, this is very rare among
inexpensive programmersÊ
Ê Designed to fit in a Hammond 1þ 1B case bottom or top (the Half Shell), few kits
consider an enclosureÊ
Ê Can also be powered from your project, requires approx 60ma max.Ê
Ê hses a common inexpensive - 1þ·DC AC wall adapter, many programmers require
18·DC suppliesÊ
Ê Common parts used throughout design means easy to repair, people DO break their
ICD2s ($$$)Ê
Ê on't damage your hSB port, a simple mistake can damage your hSB port when
powering a project ($$$)Ê

Microchips MPLAB IDE 7.þ0 as of this writing is the tool that professional PIC programmers
use. You can download it free from http://www.microchip.com it includes everything you'll
need to use your Inchworm ICD2.Ê

rDebugging makes programming and learning PICs very easy as you can stop, examine and
modify your code and/or symbols & variables at will.Ê

Some files and links you may need.


The colour Inchworm Assembly Manual including schematic.
ICD2 bootloader firmware for a 16F877A Inchworm 16F877A Firmware
PS I don't give away the PCB layout files, I've got to make a living after all.Ê

  %,3Ê

On a side-note I've integrated MeLabs PICBASIC into MPLAB. Integrating it was easy, just
follow the MPLAB instructions on MeLabs site.Ê

The difficult part was setting the __config directive. It's poorly documented (I couldn't find
it) on the MeLabs site. So to save you the trouble here's what I found out.Ê

Here's an example on a 16F628A, you set the __config directive as followsÊ

w  %4$56# $


  "  % %Ê

You will get a "Error[118] C:\PIC DEMOS\INCHORM DISPLAY.ASM 26þ : Overwriting


previous address contents (2007)"Ê

hen you compile, just ignore it.Ê

After that it worked like a charm. Just "Compile" (F10) and "Release from Reset" to run
your project. Takes about 10 seconds.Ê

Ê
! !  
    
  Ê
K  %,7  "Ê

,- 
 &, % 

 8
. %% Ê
9:65:4  8 $
 Ê

Ê
Kunebug is a combination USB PICKit2 SE* PIC development tool and Enhanced 18F TutorÊ

K  % '(;Ê

"  $  % &


  && < - 
 % " !Ê

Here's the Junebug Assembly Manual be sure to check for new update, currently April 20,
2008Ê
Ê hSB based PICKit2 compatible PIC Programmer / debugger for many 16F &
18F PICsÊ
Ê Supports both MPLAB IDE 8.x and standalone PICKit2 softwareÊ
Ê Onboard tutor support for either 16F88 or 18F1320Ê
Ê hSB powered programmer & tutor, can supply up to 100ma @ þ·DC to your
target projectÊ
Ê 3.3· support is possible by adding a pair of clamp diodes to the PüC & PüD
pinsÊ

r the SE (Student Edition) does not have a programmable 2.þ· - þ· ·DD or the internal
EEPROMs found on the genuine Microchip PICkit2.Ê

+

  %Ê

    5 

&"7% %* %
,:65$$
R R
Ê

Originally written as Mississippi State hniversity course material at 664


pages (plus a CD ROM)Ê

Mr Reese's website contains the source code ‰    


R converted to C18 and the well written lecture notes & quiz
available for free download.Ê

ÊÊ

  3Ê

Swordfish BASIC is an excellent Structured Modular BASIC compiler for the 18Fxxx series of
PIC microcontrollers. The developers have a free Student Edition, download it from
the Swordfish website. It has a very generous limit of 2þ6 bytes of RAM but no limit on the
ROM size.Ê

It's a powerful full featured language, if you have a Junebug or Mongoose we've got a
couple of modules for it, copy the modules into Swordfish Library directory.Ê

JhNEBhü.BAS the Junebug module 0. 3beta supports the LEDs and pushbuttons.Ê

MONüOOSE.BAS the Mongoose module also in beta, easy PM Motor control.Ê

Here's a simple Swordfish BASIC SE program that flashes Junebugs LEDs in sequence.Ê

]]   
 
^  = 18F1320
u = 4 ]]  
  M M
^

 
OS ON = $62 ]]    
! ON1 = %11110101 ]]  ]   ! " ! #
   

 = 0 6
LE 
 ]] $ %&' ()   %&'*)
^  300 ]] +  *** ,  
  
  ]]   ,-
Ê

And here's a reaction time game called +""=>Ê

]] %& #./. 01.  20 3    %& 



]] &4 1$ 3 0 2    0 0 45/ 6 !7
7
^  = 18F1320
u = 8 ]] 8 
  M M
  M
 M
  M M
^Q T
 
^T
 =    0
  º

T0 ON = 0 =  $ 
Q = 0
 
W M T

 Y
 h
w  LE #1 
 M1310
LE 6 


T = TMR0L =  7!*
T =  T
S TMR0H*256 T *166
W M Y
  w 0MTM S
M1310
LE 4

 NT ON4 = 0
    
 
  
OS ON = $2 ]] 8  
S º 600
NT ON2 = 0 = 1 00  
NT ON1 = 0 = 7*9
NT ON4 = 1 = 7*%
NT ON26 =0 = 7%&:* ,  
! ON1 = %11110101
W MWh LE 1 h   
 #1M1310
Q = 0
T0 ON = $04 = ]#/    *. ( 2 
TMR0L = 0 =  $ 
TMR0H = 0
LE 3 = !+
^  1000
NT ON1 = 0 =  $ 0  ,
 º

LE 2 = +
^  500
Q = 1 = = ;0,+ +0, 2+  
+
T0 ON = 1 =  $ 
LE 1 = :
^  1000 =  0
NT ON4 = 0 =  1 2 0 
LE 5
W M T

S
w  RESET
 M1310
    
 
Ê

ÊÊ


%-  9 &&Ê

ongoose with solderless breadboardÊ


Ê

ongoose with LCD (4 & 8 bit modes supported)Ê

ÊÊ
Ê
Here's the Swordfish BASIC Mongoose module (beta 0. ) it works great but I'd like to add
the tachometer module too. Currently the modules sole subroutine is  
!which will drive the Left and Right motors. ë   R
Ê

^  = 18F2525 ]]  546 45 89/</<


u = 8 ]] 8
  MM


M
    
M

LR6412 ]] , ,1 ( '<*=). !$ - > /? ' **=)
‰ ORT 0 ]] 0  $ $$ %&
^  5000 ]] + < 
ORT 0 ]] 0 ,, $ $$ %&
M

LR00 ]] 
^  1000 ]] + 
 ]]  
Ê
The first production run of the Mongoose kits are ready, the black anodized frame halves
look and fit great. I've posted a couple of photos to show the front and underside view of
the first assembled kit   R  . I've been working on some demo code in both
assembler and SwordfishSE BASIC I'll be posting it here ASAP. Note: Mongoose does not
get its power from the ICD2 but relies on the NiMH batteries for both motor & CPh power.
Do not use an unregulated power supply in place of the 4xAA batteries as this will damage
the PIC.
A þ· 2A
switch
mode
regulate
d
adapter
will work
fine. The
ferrite
bead at
J1 can
be
replaced
by a
simple
wire link
if
desired.Ê

The
SN7þ441
0 runs
only
warm so
the heat
sink in
the drawings is not necessary. All that we're waiting for is the new chassis metalwork and
anodizing to be done.Ê

The manual is currently a work in progress but I won't make you wait if you can't wait to
get your hands on the kit ASAP. The manual will be updated and available free online with
the first release having the BOM, schematic and a few diagrams like the one on the left to
get you started. hen building the PCB you'll have to pay attention to the build order and
the part location as parts mount on both sides of the board.Ê

The Mongoose is well balanced and stable, at full speed the wheels turn about 120RPM this
translates to about 0.36 meters per second. Having the rotation sensors as standard
equipment (usually an expensive option on small robot kits) you can slow the Mongoose
down to a crawl and even get an idea on how far its traveled.Ê

The optical interrupter gears (the blue one with the three black stripes) are easy to paint
with a Sharpie fine tip paint marker. If you're skilled enough you can add more stripes to
increase rotation sensing resolution. The interrupter gears turn 27x faster than the wheels,
so two or three stripes represent either 108 or 162 light to dark or dark to light transitions
per wheel rotation. Higher resolution is possible but for ease of assembly we'll be choosing
from either two or three stripes
as the recommend standard.Ê

On he top right is a pin


connector designed for a pair of
optional servo motors. The pair
of inline connectors contain
access to all the unused pins on
the 18F2þ2þ. A single white LED
is on the right side and a single
10K pot on the left (when
viewed from the front).Ê

13mm standoffs on the front are


for user boards (example a line
follower PCB or sonar PCB).Ê

The Inchworm ICD2 connector is


on top.Ê

Here's an early release of the Mongoose Assembly manual.Ê

ÊÊ

ÊÊ

*  
*% ? $
 Ê
 *  ,3 
>Ê
The *   PCBs are here, they look great but a small opps
crept in while I was editing the silkscreen layer (I bumped Q1
too high and it touches a trace shown in purple!). Luckily it
does not affect normal operation of the hnicorn and the simple solution is to 
7 .:
+@ (designed for Experimenter use and has no effect on the hSB Inchworm+ upgrade).Ê

*  *3*%  


? $
 
, 9 Ê
 
*  !!!Ê

Ê MPLAB compatible
hSB upgrade for the
Inchworm+ (simply
snaps to the bottom
of the Inchworm+)Ê
Ê Many times faster
than the RS232
version of InchwormÊ
Ê hses your hSB port
for power 2þ0ma
maxr to power itself,
Inchworm+ and your
target project.Ê
Ê For extra power use
the Inchworm+
onboard power
supply 1A maxÊ
Ê hses MPLAB
firmware client
driverÊ

ÊÊ

*   
 *3 $
 !!!Ê

Ê 128x64 üLCD connector with backlight controlÊ


Ê 2x16 LCD with backlight controlÊ
Ê hSB port for fast communicationsÊ
Ê RS48þ for long range 4000', multi-node (32 devices) serial communicationsÊ
Ê I2C option with socket for 24LCxxx EEPROMÊ
Ê 4 pushbuttons on PCBÊ
Ê 4x4 keypad connector optionÊ
Ê iButton / 1 ire connectorÊ
Ê LEDÊ
Ê ICD2 Inchworm connector for reprogramming & debuggingÊ

r Although hSB can supply up to þ00ma, 100ma is the maximum recommended. There is a
2þ0ma self resetting thermal fuse on hnicorn.Ê
hnicorn Assembly
InstructionsÊ

To use your hnicorn as a


Inchworm+ hSB upgrade just
program it
with hnicorn.hex You can
then attach your hnicorn to
the underside of an
Inchworm+ (like the
illustration on the bottom of
this page). You can always
remove and repurpose the
hnicorn for use as an
experimenter at any time.
Note: the Inchworm+ when
running in hSB mode is
somewhat faster than the RS232 mode.Ê


  & %"  Ê
Here's a link to things you can do with a 18F4þþ0 Create hSB InterfaceÊ

To get you started with both LCD & üLCDs I've linked an excellent LCD Info Page by Dincer
Aydin with simulator for both Character and üraphic LCDs

And this is the Inchworm+ mounted directly to the hnicorn, the pair appear in MPLAB as a
MPLAB firmware client. You have to program the 18F4þþ0 with a special18F4þþ0 hSB
client first. 12mm spacers are ideal for mounting when used this way. I've use this
combination for all my project work, and although you can power your projects with hSB
power you should be aware that hSB very limited in the amount of current it can supply.
Typically 200ma before the power will sag (this can cause the debug mode to reset
unexpectedly). Low power requirement kits like Firefly work fine with hSB power but high
current kits like Dragonfly will also require an external DC supply connected to the
Inchworm+. This method uses almost no hSB power and can supply almost 1A to your
target project. hse external power with any loads greater than 100ma.
ë
 


5 &"AB3
  ?A5C 
+,'))Ê

5 &"B  
A5C +,
'()Ê

5 &"ABA5
-c7DC 
+,')Ê
The Firefly Assembly
Instructions Includes
description, schematic, parts
list and more. Now expanded to 16 pages.Ê

Kit #2 Firefly is a PIC 16F88 tutor and a companion project for the Inchworm ICD2 kit.
Firefly can be built as either a PIC ZIF socket adapter or as a PIC tutor with debug support.
For only a few dollars more Firefly TZ than a ZIF socket only adapter like Melabs (or a few
dollars less the Firefly Z (ZIF only).Ê

Firefly's main features: (when built with both ZIF and Tutor options)Ê

Ê ZIF socket for flash based 8 thru 40 pin


FLASH PICsÊ
Ê PIC16F88 (The 16F88 supports the ICD2
debug mode)Ê
Ê Three pushbutton switches (PCB space
for either small or large buttons)Ê
Ê Three Red/üreen BiColor LEDsÊ
Ê Two variable resistors 0-þ· for
hardware Analog portsÊ
Ê 38KHz IR sensorÊ
Ê Hardware RS232 with level converterÊ
Ê DIP switch for programmer select and IR, ·R1 & ·R2Ê
Ê Three pin socket for iButtons, switches, resistors, capacitors and other small
componentsÊ
Ê Six pin hSER port for expansion (possible projects include motor control & range-
finding)Ê
Ê Three pin Servo, IR OhT, LED, Speaker & hardware PM/CCP portÊ
Ê Reset switch and power LEDÊ
Ê ICD2 (Inchworm style) connector ·PP,+þ,üND,PüD,PüCÊ
Ê þ· 1.3mm power jack
(Requires regulated
þ·, normally the
Inchworm ICD2
provides power)Ê

The 16F88 is a recent PIC


that is an ideal candidate for
learning PIC programming as
it contains the internal
hardware required for
debug. It's also a more fully
featured and modern version
of the PIC16F84 and even the
newer 16F628. In short it's
like a tiny version of the
16F87x and it's cheaper than
the 16F84! The
documentation including
schematic is coming soon and will be posted as soon as it's ready.Ê

5 &"3& -":E566
 % 
Ê

Sample program Blinky 16F88 source as seen in the Assembly Instructions.Ê

&!$ :E566B   5 &"AC

Depending on the software you've got programmed on the Fireflys Tutor 16F88 you might
have problems reading PICs when using the ZIF socket. Here's the Sleep.hex program as
described in the Firefly assembly manual. Simply program it onto the 16F88 before using
the ZIF socket.

Ê
5 &"A5-    % 

Ê
Ê
Ê

S-ar putea să vă placă și