Wiring up the PicAxe-18A

You are in home \ microcontroller \ PicAxe \ Picaxe-18A ports (back)  

PicAxe pages: Picaxe General   Wiring up the Picaxe   Programming the Picaxe   Projects  
Hardware

General

'08 Ports

'18A Ports

Power
Supplies

Input &
Output

Keypad
Options

serial
interface

   
 

Summary of Input and Output Ports on PicAxe-18A

  Input / ADC Port-Pins     In.0     In.1     In.2           In.6     In.7  
  Input Physical Legs     17     18     1           15     16  
 
  Output Port-Pins     Out.0     Out.1     Out.2     Out.3     Out.4     Out.5     Out.6     Out.7  
  Output Physical Legs     6     7     8     9     10     11     12     13  

Introduction to each pin on the PicAxe-18A

Power Supply Pins. +V (Physical Leg 14) and Ground (Physical Leg 5).

Supply decoupling of at least one 0.1uF ceramic capacitor is highly recommended and the addition of a small electrolytic capacitor should be considered in some cases. The absolute maximum current allowable through Vss (0V) or Vdd (+V) is 200 mA.
Several issues and solutions will be dealt with on the Power Supply page.

Serial-In (Physical Leg 3) for programming use only.

This pin requires a pulldown for the PicAxe to operate. A positive edge on this pin will trigger the internal bootloader to download a new program into memory. The required pulldown is built in to the serial download interface circuit, so this can be used, allowing for later program updates as required.

Serial-Out (Physical Leg 2) is used by the programming cable when downloading programs.

Reset Pin (Physical Leg 4).

This pin will reset the chip when pulled low. It should have a pullup resistor of a minimum value of 1k (rather than being tied directly to +V, to avoid spikes on the reset pin causing latchup), and optionally a 0.1uF capacitor (value not critical) to ground. A pushbutton to ground will reset the chip. This pin has no internal protection diode to +V, but one shouldn't be necessary since it's pulled up to +V with a 4k7 resistor, and only used when pulled low to initiate a reset.

Output Port-Pins Out.0 - Out.7 (Physical Legs 6 - 13) are Output only pins.

General purpose Output pins...

Input Port-Pins In.0, In.1, In.2, In.6, In.7 / Analog Inputs (Physical Legs 17, 18, 1, 15, 16)

These pins function as Digital Inputs, and pins 0, 1 & 2 can be alternately used as Analog Inputs (Leaving pins 6 & 7 as digital input only) (Port A)
All it takes for pins 0, 1 or 2 to be used as Analog Inputs is the use of the readadc command, and they are automatically configured as analog inputs. Merely reading the pins as digital inputs in the usual manner configures them automatically as digital inputs - it couldn't be easier.
See the ADC page for more detail.


Notes on Input Pins.

The Input Port-pins should be pulled high or low via a resistance to avoid them floating, which can cause abnormal chip behaviour and damage.
The Abs. max. current sourced or sunk by Port A is 100 mA.
The Abs. max. current sourced or sunk by any port pin is 25 mA.

Notes on Output Pins.

Ensure that any output pins do not clash with other voltage levels or outputs, or a situation known as contention will occur, leading to excessive current flow and chip damage. Contentions can be tolerated if a current limiting resistor is provided in series with the pin(s) in question with a suitable value to limit the current below the absolute maximum of 25mA (eg. 220 Ohm).

Be careful when switching Capacitive or Inductive loads that discharge current (Charge dumping) or back EMF (spikes) are protected against. Capacitive loads should have a current limiting resistor as protection, and Inductive loads should have a freewheeling diode fitted, and motors require a spike suppression capacitor (eg. 220nF) fitted across their terminals. Also piezo's or speakers can produce voltages when stressed or knocked that can be damaging to your chip, so these must be adequately protected against. Note that although inductive loads will generally be driven via. a driver transistor, the protection measures are still required to protect the driver transistor and to prevent spikes being passed back through the supply lines to other equipment
I will cover these issues and various solutions on the other hardware pages.

The Abs. Max. Input or Output clamp current is 20 mA (when V at pin > Vdd or < Vss)
The Abs. max. current sourced or sunk by Port B is 100 mA.
The Abs. max. current sourced or sunk by any port pin is 25 mA.


For more technical info on the Picaxe-18A see the Microchip website for the Pic16F819 datasheet.