AVR Crux
Contents
Introduction
Note: This wiki is for older version of Crux board which used Micronuclues bootloader. All boards shipped after 1st January 2016 uses Arduino Gemma Bootloader. You don't have to use the modified version of Arduino IDE anymore. Just download the official version of Arduino IDE from Arduino website, select Gemma as programmer and board, click upload. Detailed tutorial will follow and this wiki will be updated.
AVR CRUX is a tiny microcontroller development board based on ATtiny85, similar to the Arduino line, only cheaper, compact, lower power consumption and a bit less powerful. The board supports use of specific Arduino IDE and conveniently uses Arduino syntax for programming. This is a great way to jump into electronics and also perfectly fits when an Arduino is too big
AVR CRUX board may be tiny, but don’t be fooled by its size. The board has digital IO pins for regular use, PWM outputs to control motors and actuators, Analog inputs to interface with your sensors and a USB port to program and interact with your computer. It even has a tiny button switch used as reset button or a custom button and a user controllable LED to play around and create your first “blinking LED” program. A powerful board intended for artists, designers, hobbyists and anyone interested in creating interactive things
This board is a perfect start for beginners interested in electronics, sensors, motor controllers and robotics
Features
Crux Board Details
This tiny board is designed to be helpful for a user with any level of expertise. If you are familiar with AVR programming, you can use AVR-GCC and start programming. On the other hand, if you are an Arduino maniac, you would feel right at home programming this board. You can use this board to begin your first electronics lesson by blinking an LED or get into more complex projects like interfacing via. Bluetooth, Display characters on LCD, or make your tiny remote controlled or autonomous robot. The number of pins, memory and size might be limited, but the possibilities are endless
Product Features
- Really really tiny development board!
- On board USB interface with micro USB connector. Since most mobile phones come with a micro USB cable, you don’t even need to purchase one separately
- Reset button available for entering into bootloader or to restart the program. No need to disconnect and reconnect the board every time you program it
- Solder pads for I2C pull-up resistors for PB0 and PB2 pins available on PCB backside. This is useful if you are communicating with sensors and modules over I2C protocol
- No expert knowledge or external connections required to write programs. Download specific Arduino IDE; connect CRUX board, program, upload and have fun
- Hundreds of tried and tested programs available online and also on veerobot website
- Two LEDs; Power LED to indicate power and a custom LED for your experiments
- Regulated external power supply with built-in current limiting and over-temperature shutdown feature
- Micronucleus boot loader V1.11; This bootloader uses ~2K bytes of memory and ~6K Bytes of memory available for user programs
- 5 general purpose input output pins (GPIO) with 4 analog inputs and three PWM outputs. 2 Analog input and 1 PWM output is shared across 2 pins which are used for USB interface
- Schottky diode to isolate USB power from battery power (reverse protection)
- 4 Mounting holes on this tiny board
- Two additional ground pins for testing and connecting external circuits
- Works out of the box with Digispark Arduino IDE (thanks to them for making it accessible to the community)
- High quality printed circuit board. Each board comes with bootloader burnt and blink LED program uploaded. Just power up the board and see the LED blinking
Specifications
Microcontroller Specifications
The brain of this board is Atmel's AVR ATtiny85 8 bit microcontroller. Some of the most important features of this microcontroller are:
- High Performance, Low Power AVR 8-Bit Microcontroller
- Advanced RISC Architecture
- 120 Powerful Instructions and most of them are Single Clock Cycle Execution
- 32 x 8 General Purpose Working Registers
- Fully Static Operation
- Non-volatile Program and Data Memories
- 8K Bytes of In-System Programmable Program Memory Flash
- 512 Bytes In-System Programmable EEPROM
- 512 Bytes Internal SRAM
- Programming Lock for Self-Programming Flash Program and EEPROM Data Security
- Peripheral Features
- 8-bit Timer/Counter with Prescaler and Two PWM Channels
- 8-bit High Speed Timer/Counter with Separate Prescaler
- 2 High Frequency PWM Outputs with Separate Output Compare Registers
- 10-bit ADC with 4 Single Ended Channels
- 2 Differential ADC Channel Pairs with Programmable Gain (1x, 20x)
- Temperature Measurement (used internally to read chip temperature)
- Programmable Watchdog Timer with Separate On-chip Oscillator
- On-chip Analog Comparator
- Special Microcontroller Features
- In-System Programmable via SPI Port
- External and Internal Interrupt Sources
- Low Power Idle, ADC Noise Reduction, and Power-down Modes
- Programmable Brown-out Detection Circuit
- I/O and Packages
- Six Programmable I/O Lines
Crux Board Specifications
| Microcontroller | ATtiny85 |
|---|---|
| Operating Voltage | 5V |
| GPIO Pins | PB0, PB1, PB2, PB3, PB4 (PB5 is disabled and tied to Reset) |
| Analog Input pins(ADC) | PB2 |
| PWM Pins | PB0, PB2, PB4 |
| LED Indicator | SIG (Orange or Red), PWR (Green) |
| Flash Memory | 8 KB of which 2 KB used by bootloader |
| SRAM | 512B |
| EEPROM | 512B |
| Dimension (LxWxH) | 33mm X 15mm X 5mm |
| FLASH Memory | 8K |
| USB/VCC Power Supply | 5V |
| External Power Supply | 6V – 12V |
| Weight | 15.00g |
| Product ID | CB-AVR-DEVB-15 |
| Oscillator Frequency | 16.5MHz (Internal PLL Oscillator) |
| Output Current Max. | Up to 500mA (On USB Power) |
| Output Current Max. | Max. 150mA (On external supply) |
| GPIO Output Current | 20mA max. per pin |
Power Supply
Crux can be powered by USB power source or through an external power source (Battery, Power adapter, Solar Panel etc.)
BAT+: The first pin on the left side of the board (with USB port on top and board facing up) is BAT+ pin. This is where the positive side (+) an external power source should be connected. Negative side (-) of the power supply can be connected to any of the ground pins available. You can connect up to 16V, though the suggested safe voltage is 12V. The regulator on board makes sure the board gets 5V regulated power supply and current usage can be up to 150mA.
USB+: This pin is directly connected to USB port positive power pin (+5V). When the board is connected to the computer, this pin can source current up to 500mA from computer’s USB port.
VCC: If you are connecting this board to another microcontroller board (or module) which can output regulated +5V power supply, then the positive +5V pin from that board can be connected here. Be careful while using this pin as it is directly connected to VCC pin or microcontroller; anything more than +5V can permanently damage the chip. This pin can also be used to source power to other modules if powered by battery or USB.
Ports & Pins
Ports on AVR microcontroller are bi-directional and have true Read-Modify-Write functionality when used as general digital I/O ports. This means that the direction of one port pin can be changed without unintentionally changing the direction of any other pin. Crux board has all the pins of ATtiny85 chip extended out to make it easier to connect sensors, actuators, motor drivers, servos and other external components.
PB0-PB5: Crux board has 5 general purpose input output pins (6 if reset pin is also enabled). This means all the 5 pins can be used for basic input output operations. Few pins have alternate functions for PWM and Analog Input. Since the chip does not support true USB operation, the board comes with a boot loader uploaded that supports USB operation. This comes with a catch. Two of the 5 pins are used for USB operation and other three are completely free. Even if there is no traffic on the USB data bus, the resistors and diodes can still interfere. The best use of these pins is to connect to LED’s and Switches that can be used after uploading the program into the chip. If the pin is configured as input, make sure you do not connect it to ground or VCC while uploading the program.
- PB0: PB0 pin is marked as #0 on the board and can be used for PWM Output, SPI (MOSI) and I2C
- PB1: Marked as #1, this pin can be used for PWM and SPI (MISO)
- PB2: Marked as #2, this is used for SPI (SCK) and I2C. This pin can also be used for analog input to read data from your sensors
- PB3: Marked #3 on the board, this is pin is used for USB communication and has a 1.5K pull-up (connected to VCC) resistor soldered. The chip is designed to use this pin for analog input, but the pull-up resistor might give you wrong values. It is best to try not using this pin and if required, can be used for external interrupts. However, make sure you do not connect the pin to ground while programming
- PB4: Marked #4, this pin can be used for PWM output and Analog input
- PB5: Marked RST (for reset), this pin is connected to reset pin of AVR chip and as the name suggests, it resets a running program. For the experts out there with the right tools, the fuse bits can be set to disable reset pin. Once disabled, the pin can be used for analog input or as general purpose input output pin
Power LED and Custom LED
There are two LED on either side of the board. The green LED is power indicator and the Orange (or Red) LED on the right side of the board is connected to PB1 (#1) pin and can be used as per your requirement (similar to LED on Arduino boards connected to Pin13). Two jumpers at the back of the board can be used to disconnect these LED’s from the circuit. This is useful if you are using the board for a battery powered application.
Reset Button
A tiny tactile push button on the board is internally connected to reset pin. USB programming requires you to unplug and insert back the CRUX board for uploading each new program. To avoid it, press this reset button and the program will be uploaded without requiring unplugging. Optionally, if the fuse bits are set to disable reset, this push button can be used as an external interrupt (and you will lose the previous advantage of pressing it for uploading code)
ISP Programming
The best part of CRUX board is that you may never need to use ISP programming. However in an event of bootloader error (overwriting bootloader, or a buggy program), you may need to use ISP programming. To reload the bootloader, you need an ISP programmer like USBasp, AVR Dragon, MKI/II etc. Connect the 6 SPI pins (MOSI, MISO, SCK, Reset, VCC and GND) to the programmer, upload micronucleus v1.11 bootloader and you are ready to continue the journey. However, if the reset pin is disabled for GPIO, then you may need a high voltage programmer to reset the fuses and get the chip back to factory settings.
Clock Settings
CRUX uses chips internal PLL clock. When the board is powered on, it boots up and uses the USB signal to calibrate its clock to 16.5MHz. A wrong clock setting on your program can lead to slow blinking of LED when you expected it to be fast, or vice versa.
Using Inter-Integrated Circuit or I2C
The board can be used to communicate with multiple modules using I2C protocol. All you need to do is solder two 4.7K resistors on the bottom side (marked I2C) of the board. The pads are available, but since these require SMD soldering, you need a fair bit of practice.
Reverse Voltage Protection
A diode is in place to avoid current flowing back to USB port if both the battery and USB are connected. It is always wise to use only one of the two power sources, but the protection is there in place to avoid human errors. However, make note that there is no reverse voltage protection on Battery or VCC or USB+ pins. Reverse connecting the battery will surely damage the board.
Good to know
- Headers are included but not soldered on to give you more flexibility. If you need a soldered version, mention in the comments while ordering and we will send you a breadboard friendly soldered board (male headers on the bottom of the board). On unsoldered version, you can use two 6 pin female headers (not included) to make it sensor and add-on board friendly (like Arduino boards)
- Though you can program CRUX board using modified Arduino IDE, it's not 100% Arduino-compatible. This board does not have a Serial port connection for debugging so the serial port monitor will not be able to send/receive data. USB v3.0 ports on few PC’s do not recognize the boot loader; you may have to use USB v2.0 port or a USB hub
- If you feel adventurous, you can disable reset pin (Hint: Change fuse bits) to use the reset button as a custom function switch. This also gives you an additional pin for your projects. The catch is that you lose the power to be able to use ISP programmers with the chip. In case of boot loader failure, you would need to use a high-voltage programmer to reset the chip, upload boot loader again and work on the chip
- Tweaking a bit can convert this development board into USBtinyISP programmer and can program other Atmel AVR chips. To make it work, you may have to disable reset pin and upload littlewire program
- All the boards are tested on a Windows machine with Windows 7 operating system (64 bit). If you would ask us for a suitable setup, we would suggest a Windows 7 (32 or 64 bit) system for testing. However, there is nothing stopping you from using CRUX board on any other Windows variants or on a MAC. If you face an issue using this on a Linux machine, try running AVRdude and Arduino IDE as root user
Usage
Download modified Arduino IDE from GitHub
- Windows
- Mac
- Linux 32bit
- Linux 64bit
Install or extract IDE and start the application.
Plug in the Crux board to your computer. For a windows machine if it asks for drivers, locate the drivers within your installation folder and install the drivers. Once installed, you are ready to program.
Code for modified Arduino IDE
/*
* Product: CRUX - AVR Development Board
* SKU : VEE00015
* Description: The example demonstrates blinking an LED on Crux Board
* Connect a micro USB cable to Crux board and upload below code. You should
* see LED blinking every 1 second
*/
void setup() {
//All pins are capable of Digital output
pinMode(0, OUTPUT); //0 is #0, 1 is #1, 2 is #2 etc.
}
void loop() {
digitalWrite(0,HIGH); // Set pin HIGH (+5V)
delay(1000);
digitalWrite(0,LOW); // Set pin LOW (GND)
delay(1000);
}
Application Ideas
This tiny board has an array of applications:
- If this is the first time you are interacting with micro controllers, Crux board gives you that very first kick start needed to begin. All the strenuous work is already taken care of and you are given a USB programmable tiny board. Code, IDE and everything else needed to start is already available
- Using multiple boards to connect different parts of a gadget where each part can take intelligent decisions while communicating back to the main controller. I2C on this tiny board is a boon for these types of projects
- This is extremely useful when your project requires only a few pins and an Arduino is too big for the task or when space for a bigger Arduino is insufficient.
Demonstration
Resources
Support
If you have any questions or queries, Contact Us