Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use PICAXE-40X: Examples, Pinouts, and Specs

Image of PICAXE-40X
Cirkit Designer LogoDesign with PICAXE-40X in Cirkit Designer

Introduction

The PICAXE-40X is a versatile microcontroller designed for educational and hobbyist projects. It features a built-in BASIC interpreter, enabling users to program it with ease, even without prior experience in complex programming languages. The 40X variant offers a wide range of input/output pins, analog-to-digital conversion capabilities, and compatibility with various interfacing options. These features make it ideal for applications such as robotics, sensor interfacing, home automation, and data logging.

Common applications of the PICAXE-40X include:

  • Robotics and motor control
  • Environmental monitoring with sensors
  • Home automation systems
  • Educational projects for learning microcontroller programming
  • Data acquisition and logging systems

Explore Projects Built with PICAXE-40X

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino UNO-Based Coin-Operated Communication System with LCD Display and Servo Control
Image of Veding Machine: A project utilizing PICAXE-40X in a practical application
This is a microcontroller-based control system for a vending or arcade application, featuring an Arduino UNO that manages user inputs through arcade buttons, drives servos, displays information on an LCD, and communicates over GSM with the SIM900A module. Power regulation is achieved through a switching power supply and DC-DC buck converters.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Based Accelerometer Data Logger with LCD Display and Audio Alert
Image of ed: A project utilizing PICAXE-40X in a practical application
This circuit features an Arduino UNO microcontroller powered by a 9V battery, interfaced with an I2C LCD screen and an ADXXL335 accelerometer. The Arduino reads the X, Y, and Z outputs from the accelerometer on analog pins A0, A1, and A2, respectively, and can display data on the LCD screen. Additionally, there is a piezo buzzer connected to digital pin D12 for audio output, with all components sharing a common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Line Following Robot with ATmega328P and L298N Motor Driver
Image of Arduino-Controlled Line Following Robot with Dual DC Motors and L298N Driver: A project utilizing PICAXE-40X in a practical application
This circuit is a line-following robot controller. It uses a Nano 3.0 ATmega328P microcontroller to read inputs from a line sensor and control two DC motors via an L298N motor driver. Power is supplied by a 9V battery regulated through an XL4015 DC buck converter.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Controlled Soundwave Generator with IR Sensor Activation and Relay Switching
Image of Fish Attractor: A project utilizing PICAXE-40X in a practical application
This circuit features an Arduino UNO microcontroller interfaced with a 4-channel relay, two IR sensors, a servo motor, an LCD I2C display, a PAM8403 audio amplifier connected to a speaker, and an XR2206 function generator with a resistor and capacitor for frequency shaping. The Arduino controls the relays based on a potentiometer input, displays frequency information on the LCD, and adjusts the servo position in response to the IR sensors. The XR2206 generates an adjustable frequency signal, while the PAM8403 amplifies audio for the speaker.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with PICAXE-40X

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 Veding Machine: A project utilizing PICAXE-40X in a practical application
Arduino UNO-Based Coin-Operated Communication System with LCD Display and Servo Control
This is a microcontroller-based control system for a vending or arcade application, featuring an Arduino UNO that manages user inputs through arcade buttons, drives servos, displays information on an LCD, and communicates over GSM with the SIM900A module. Power regulation is achieved through a switching power supply and DC-DC buck converters.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of ed: A project utilizing PICAXE-40X in a practical application
Arduino UNO Based Accelerometer Data Logger with LCD Display and Audio Alert
This circuit features an Arduino UNO microcontroller powered by a 9V battery, interfaced with an I2C LCD screen and an ADXXL335 accelerometer. The Arduino reads the X, Y, and Z outputs from the accelerometer on analog pins A0, A1, and A2, respectively, and can display data on the LCD screen. Additionally, there is a piezo buzzer connected to digital pin D12 for audio output, with all components sharing a common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Arduino-Controlled Line Following Robot with Dual DC Motors and L298N Driver: A project utilizing PICAXE-40X in a practical application
Battery-Powered Line Following Robot with ATmega328P and L298N Motor Driver
This circuit is a line-following robot controller. It uses a Nano 3.0 ATmega328P microcontroller to read inputs from a line sensor and control two DC motors via an L298N motor driver. Power is supplied by a 9V battery regulated through an XL4015 DC buck converter.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Fish Attractor: A project utilizing PICAXE-40X in a practical application
Arduino UNO Controlled Soundwave Generator with IR Sensor Activation and Relay Switching
This circuit features an Arduino UNO microcontroller interfaced with a 4-channel relay, two IR sensors, a servo motor, an LCD I2C display, a PAM8403 audio amplifier connected to a speaker, and an XR2206 function generator with a resistor and capacitor for frequency shaping. The Arduino controls the relays based on a potentiometer input, displays frequency information on the LCD, and adjusts the servo position in response to the IR sensors. The XR2206 generates an adjustable frequency signal, while the PAM8403 amplifies audio for the speaker.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

The PICAXE-40X microcontroller is equipped with the following technical features:

Key Technical Details

  • Microcontroller Core: PIC16F877A (with PICAXE firmware)
  • Operating Voltage: 4.5V to 5.5V
  • Clock Speed: 4 MHz (internal resonator)
  • Programming Language: BASIC (via PICAXE Editor software)
  • Digital I/O Pins: 33
  • Analog Input Pins: 8 (10-bit resolution)
  • EEPROM Memory: 256 bytes
  • RAM: 368 bytes
  • Flash Memory: 8 KB (shared with program storage)
  • Communication Protocols: Serial (RS232), I2C, SPI
  • Power Consumption: ~2 mA (active), ~50 µA (sleep mode)
  • Package Type: 40-pin DIP (Dual Inline Package)

Pin Configuration and Descriptions

The PICAXE-40X has a total of 40 pins, with specific functions assigned to each. Below is the pin configuration:

Pin Number Pin Name Function
1 VSS Ground (0V reference)
2 VDD Positive power supply (4.5V to 5.5V)
3 Serial In Serial programming input (connect to PC via download cable)
4 Serial Out Serial programming output (connect to PC via download cable)
5-12 Port A (A0-A7) Analog inputs (10-bit ADC) or digital I/O
13-20 Port B (B0-B7) Digital I/O pins
21-28 Port C (C0-C7) Digital I/O pins
29-36 Port D (D0-D7) Digital I/O pins
37 Reset Active-low reset pin
38 OSC1 External clock input (optional)
39 OSC2 External clock output (optional)
40 VSS Ground (0V reference)

Usage Instructions

How to Use the PICAXE-40X in a Circuit

  1. Power Supply: Connect the VDD pin to a 5V power source and the VSS pins to ground.
  2. Programming: Use the PICAXE Editor software to write your BASIC program. Connect the Serial In and Serial Out pins to a PC using the PICAXE download cable for programming.
  3. I/O Connections:
    • For digital inputs/outputs, connect devices (e.g., LEDs, switches) to the appropriate pins on Ports B, C, or D.
    • For analog inputs, connect sensors to the pins on Port A (A0-A7).
  4. External Components: Add pull-up or pull-down resistors to input pins as needed. Use decoupling capacitors near the power pins for stable operation.
  5. Communication: Use the built-in serial, I2C, or SPI protocols to interface with other devices like displays, sensors, or other microcontrollers.

Important Considerations and Best Practices

  • Always use a regulated 5V power supply to avoid damaging the microcontroller.
  • Avoid leaving input pins floating; use pull-up or pull-down resistors to define their state.
  • Use heat sinks or current-limiting resistors when driving high-power devices like motors or LEDs.
  • Ensure proper grounding for all connected components to prevent noise or erratic behavior.
  • Use the PICAXE Editor's simulation feature to test your code before uploading it to the microcontroller.

Example Code for Arduino-like Functionality

Below is an example of a simple program to blink an LED connected to pin B0:

' Blink an LED connected to pin B0
' This program toggles the LED on and off every second

main:                     ' Define the main program loop
  high B0                 ' Set pin B0 to HIGH (turn LED on)
  pause 1000              ' Wait for 1 second (1000 ms)
  low B0                  ' Set pin B0 to LOW (turn LED off)
  pause 1000              ' Wait for 1 second (1000 ms)
  goto main               ' Repeat the loop

Troubleshooting and FAQs

Common Issues and Solutions

  1. Microcontroller Not Responding to Programming:

    • Ensure the Serial In and Serial Out pins are correctly connected to the PC.
    • Verify that the PICAXE Editor software is configured for the correct COM port.
    • Check the power supply and ensure the microcontroller is powered on.
  2. Erratic Behavior or Resetting:

    • Add decoupling capacitors (e.g., 0.1 µF) near the VDD and VSS pins.
    • Ensure all input pins are properly terminated with pull-up or pull-down resistors.
  3. Analog Inputs Not Working:

    • Confirm that the input voltage to the analog pins is within the 0-5V range.
    • Check the program code to ensure the correct ADC channel is selected.
  4. Overheating:

    • Reduce the current load on the I/O pins by using current-limiting resistors.
    • Ensure the microcontroller is not exposed to voltages exceeding its specifications.

FAQs

Q: Can the PICAXE-40X be powered by batteries?
A: Yes, it can be powered by a 4.5V to 5.5V battery pack. Ensure the voltage is regulated.

Q: What software is required to program the PICAXE-40X?
A: The PICAXE Editor software, available for free on the PICAXE website, is used for programming.

Q: Can I use the PICAXE-40X with external sensors?
A: Yes, the microcontroller supports analog and digital sensors. Use the analog pins (A0-A7) for sensors with variable voltage outputs.

Q: Is the PICAXE-40X compatible with Arduino shields?
A: No, the PICAXE-40X is not directly compatible with Arduino shields due to differences in pin layout and programming.

By following this documentation, users can effectively utilize the PICAXE-40X microcontroller for a variety of projects and applications.