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:
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 |
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) |
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
Problem: The PicAxe does not respond to programming commands.
Problem: The microcontroller resets unexpectedly.
Problem: I2C communication is not working.
Problem: Analog readings are inaccurate.
Q: Can the PicAxe 18M2+ run on batteries?
Q: What is the maximum current output of the I/O pins?
Q: Can I use the PicAxe 18M2+ with a breadboard?
Q: Is the PicAxe 18M2+ compatible with other microcontrollers?