Wiring up the PicAxe-08

You are in home \ microcontroller \ PicAxe \ Picaxe-08 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-08

 Bit_Pin  Leg  I/P  O/P  Notes
0 7   -  CMOS   O/P only. Shared with programming cable.
1 6  TTL / ADC  CMOS   Low-res ADC, used with readadc command.
2 5  SCHMITT  CMOS   GPIO
3 4  TTL   -   Input only, requires diode to +V for serin use
4 3  TTL  CMOS   GPIO
GPIO = General Purpose I/O (Bit-pins 1, 2 & 4)

Introduction to each pin on the PicAxe-08

Power Supply Pins. +V (Physical Leg 1) and Ground (Physical Leg 8). A wide supply voltage range is possible (2 V min. to 5.5 V max.) and excessive voltage is liable to damage the chip and should be protected against if the supply voltage isn't otherwise controlled. Insufficient supply voltage (ie. below 2 V) will result in unreliable operation (as well as reduced output drive capacity and altered input voltage trip-points). Providing protection from polarity reversal of supply should be considered and may be accomplished in several ways (eg reverse polarity protection diode, biased FET, fuse and shorting diode, zener limiter...). Supply decoupling odf at least one 0.1uF ceramic capacitor is highly recommended and the addition of a small electrolytic capacitor should be considered in some cases.
Several issues and solutions will be dealt with on the Power Supply page.
Serial-In (Physical Leg 2) 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 7) is used by the programming cable when downloading programs, and can also be used as a digital Output Pin (known then as Port-Pin 0). See the description of Port-Pin 0 for considerations when using it for digital output. downloadingto provide a serout and debug

Output Port-Pin 0 (Physical Leg 7) is an Output only pin.

Although this pin is available for general purpose output, the fact that it shares its function with the programming cable means that consideration must be made that there is no interference between this function and usage as a digital output in the user circuit. (Often) this pin shgould be jumpered (or switched) to separate these functions, unless the circuitry is designed so that they don't interfere with each other.
See the serial interfacing page for more details on usage and function sharing methods.

Input & Output Port-Pin 1 / Analog Input (Physical Leg 6)

This pin can function as an input or an output as desired, and also includes a Low-resolution Analog-to-Digital Converter function. Being a low-resolution ADC (Analog to Digital Converter) means it reads values in only the lower two-thirds of the input voltage range, and these values have been scaled up to 16 larger steps to match the scale of the full ADC's.
See the ADC page for more detail.

Input & Output Port-Pin 2 (Physical Leg 5)

This pin can function as an Input or an Output as desired. Input is by a Schmitt trigger buffer, which can make it a bit more versatile. I'll provide an interface circuit or two that takes advantage of the Schmitt trigger input specifically in the Interface section later.

Input Port-Pin 3 (Physical Leg 4) is an input only port.

You can use it for normal digital input like the other ports, but if you intend to use it for serin then you will have to provide an extra protection diode to +V (say a 1N4148 with stripe end to +V) because the simple and common resistor-only serial interface relies on the internal protection diodes to protect the chip from the wide voltage swings present on the serial cable. (

Input & Output Port-Pin 4 (Physical Leg 3)

This is a General Purpose port that can function as an Input or an Output as desired.

Notes on General Purpose Input / Output (GPIO) Pins.

Port-Pins 1, 2 & 4 are GPIO pins that are inputs by default on bootup, and may need to be set as Outputs if so desired. You must make sure that no pins configured as inputs are left floating (unconnected) as nasty things like instability, rogue current consumption and heating, and latchup can occur. There are several methods of setting a pins direction to output, and initially the simplest of these is to just use the low <port-pin> or high <port-pin> command on the appropriate pin(s) at initialisation. This will be dealt with more fully under the I/O in the Programming section.
GPIO pins may have their direction changed between Input and Output at will under program control.

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.

Abs. max. Vsupply is 6.5 V
Abs. max. voltage on port-pin 3 (phys. leg 4) is 13.5 V.
Voltages on all other pins must not be more than 0.3 V below 0V or more than 0.3 V above +V.
Abs. Max. current out of 0V pin is 300 mA.
Abs. Max. current into +V pin is 250 mA.
Abs. Max. clamp current (i/p or o/p) with Vin < 0V or > +V) is 20 mA.
Abs. Max. current (sunk or sourced) by any I/O pin is 25 mA.
Abs. Max. current to be sourced or sunk by all I/O pins is 125 mA.


For more technical info on the Picaxe-08 see the Microchip website for the Pic16F629 datasheet.