Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use PicAxe 18M2+: Examples, Pinouts, and Specs

Image of PicAxe 18M2+Design with PicAxe 18M2+ in Cirkit Designer

Introduction

The PicAxe 18M2+ is a powerful and versatile microcontroller designed for hobbyists, educators, and professionals. It combines a BASIC programming environment with a wide range of input/output (I/O) capabilities, making it an excellent choice for controlling electronic projects and automating tasks. Its ease of use and flexibility make it ideal for applications such as robotics, data logging, home automation, and educational projects.

Common applications and use cases:

Explore Projects Built with PicAxe 18M2+

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Raspberry Pi-Controlled Drone with Brushless Motors and Camera Module: A project utilizing PicAxe 18M2+ in a practical application
Raspberry Pi-Controlled Drone with Brushless Motors and Camera Module

This circuit is designed for a multi-motor application, likely a drone or a similar vehicle, featuring eight brushless motors controlled by two 4-in-1 electronic speed controllers (ESCs). The ESCs are powered by a 3s2p 18650 battery pack and interfaced with a Pixhawk flight controller for motor management. Additionally, the system includes a Raspberry Pi 4B for advanced processing and control, which is connected to a NoIR camera module and a cooling fan, and a power module to supply and monitor the power to the Pixhawk.

Open Project in Cirkit Designer
Image of Raspberry Pi Pico and OV7670 Camera-Based Robotic System with TFT Display: A project utilizing PicAxe 18M2+ in a practical application
Raspberry Pi Pico and OV7670 Camera-Based Robotic System with TFT Display

This circuit features two Raspberry Pi Pico microcontrollers interfacing with various peripherals including an OV7670 camera module, a TFT display, and an OLED display. It also includes a multiplexer and a motor driver to control two planetary gearbox motors, powered by a battery and regulated through buck converters. The setup is designed for image capture, display, and motor control applications.

Open Project in Cirkit Designer
Image of Raspberry Pi Pico-Based Navigation Assistant with Bluetooth and GPS: A project utilizing PicAxe 18M2+ in a practical application
Raspberry Pi Pico-Based Navigation Assistant with Bluetooth and GPS

This circuit features a Raspberry Pi Pico microcontroller interfaced with an HC-05 Bluetooth module for wireless communication, an HMC5883L compass module for magnetic field measurement, and a GPS NEO 6M module for location tracking. The Pico is configured to communicate with the HC-05 via serial connection (TX/RX), with the compass module via I2C (SCL/SDA), and with the GPS module via serial (TX/RX). Common power (VCC) and ground (GND) lines are shared among all modules, indicating a unified power system.

Open Project in Cirkit Designer
Image of Raspberry Pi Pico-Based Navigation System with Bluetooth and GPS: A project utilizing PicAxe 18M2+ in a practical application
Raspberry Pi Pico-Based Navigation System with Bluetooth and GPS

This circuit features a Raspberry Pi Pico microcontroller interfaced with multiple peripherals for navigation and control. It includes an HC-05 Bluetooth module for wireless communication, an HMC5883L compass for magnetic heading detection, a GPS NEO 6M module for location tracking, and an SG90 servomotor for actuation. The Pico manages data exchange with the GPS and compass via serial connections, controls the servomotor, and communicates wirelessly through the HC-05 module.

Open Project in Cirkit Designer

Technical Specifications

The PicAxe 18M2+ microcontroller offers the following key technical features:

Specification Value
Operating Voltage 2.0V to 5.5V
Clock Speed 32 MHz (internal resonator)
Programming Language BASIC
I/O Pins 16 (including 6 analog inputs)
EEPROM 256 bytes
RAM 128 bytes
Program Memory 2048 lines of BASIC code
Communication Protocols Serial, I2C, SPI
Power Consumption Low power (nanoWatt technology)
Package Type 18-pin DIP

Pin Configuration and Descriptions

The PicAxe 18M2+ has an 18-pin layout, with each pin serving specific functions. Below is the pin configuration:

Pin Number Pin Name Description
1 V+ Positive power supply (2.0V to 5.5V)
2 C.5 Digital I/O or analog input (ADC channel 4)
3 C.4 Digital I/O or analog input (ADC channel 3)
4 C.3 Digital I/O or analog input (ADC channel 2)
5 C.2 Digital I/O or analog input (ADC channel 1)
6 C.1 Digital I/O or analog input (ADC channel 0)
7 C.0 Digital I/O
8 0V (GND) Ground
9 B.0 Digital I/O or PWM output
10 B.1 Digital I/O or PWM output
11 B.2 Digital I/O or serial input
12 B.3 Digital I/O or serial output
13 B.4 Digital I/O
14 B.5 Digital I/O
15 B.6 Digital I/O or I2C clock (SCL)
16 B.7 Digital I/O or I2C data (SDA)
17 RES Reset pin (active low)
18 V+ Positive power supply (2.0V to 5.5V)

Usage Instructions

How to Use the PicAxe 18M2+ in a Circuit

  1. Power Supply: Connect the V+ pin (pin 1 or 18) to a power source (2.0V to 5.5V) and the 0V (GND) pin (pin 8) to ground.
  2. Programming: Use the PicAxe Programming Editor software to write and upload BASIC code to the microcontroller via a serial programming cable.
  3. I/O Connections: Connect sensors, actuators, or other peripherals to the I/O pins. Use the appropriate pins for digital, analog, PWM, or communication functions.
  4. Communication: For serial communication, use pins B.2 (input) and B.3 (output). For I2C communication, use pins B.6 (SCL) and B.7 (SDA).

Important Considerations and Best Practices

Example Code for Arduino UNO Integration

The PicAxe 18M2+ can communicate with an Arduino UNO via serial communication. Below is an example of Arduino code to send data to the PicAxe:

// Arduino code to send data to PicAxe 18M2+ via serial communication
void setup() {
  Serial.begin(4800); // Initialize serial communication at 4800 baud
}

void loop() {
  Serial.println("Hello PicAxe!"); // Send a message to the PicAxe
  delay(1000); // Wait for 1 second before sending the next message
}

On the PicAxe side, you can use the following BASIC code to receive and display the message:

' PicAxe BASIC code to receive data from Arduino
main:
  serin B.2, N4800, b0  ' Receive data on pin B.2 at 4800 baud
  sertxd ("Received: ", b0, 13, 10) ' Send received data to the PC via serial
  goto main             ' Repeat the process

Troubleshooting and FAQs

Common Issues and Solutions

  1. Problem: The PicAxe does not respond to programming commands.

    • Solution: Check the serial programming cable connections and ensure the correct COM port is selected in the PicAxe Programming Editor.
  2. Problem: The microcontroller resets unexpectedly.

    • Solution: Verify the power supply voltage is within the specified range (2.0V to 5.5V). Add a decoupling capacitor if necessary.
  3. Problem: I2C communication is not working.

    • Solution: Ensure pull-up resistors (typically 4.7 kΩ) are connected to the SCL and SDA lines. Check the wiring and device addresses.
  4. Problem: Analog readings are inaccurate.

    • Solution: Ensure the analog input voltage does not exceed the supply voltage. Use proper grounding and shielding to reduce noise.

FAQs