The RCC
project is based on a pcb with an ATtiny402 and two RGB LEDs that are controlled via SPI-bus. The cube itself is controlled over a single push-button that enables/disables the cube and can be used to setup the color and intensity of the rgb leds.
Experience | Level |
---|---|
Soldering | |
Mechanical | |
Software |
Type | File | Description |
---|---|---|
Schematic | pdf / cadlab | Schematic files |
Board | pdf / cadlab | Board file |
Drill | Drill file | |
PCB | zip / tar | KiCAD/Gerber/BoM/Drill files |
Mechanical | zip / tar | FreeCAD/Housing and PCB (STEP) files |
Firmware | zip / tar | Firmware for ATtiny402 |
There are two parts of the hardware. The pcb and the housing of the RCC
. The pcb is created with KiCAD and the housing with FreeCAD
. The software is programmed with Microchip (Atmel) Studio. All files are built with github actions
so that they are ready for a production environment. The housing is printed with a 3D-printer (Dremel 3D40
).
The circuit board is populated on both sides (Top, Bottom). The best way for soldering the SMD
components is within a vapor phase soldering system and for the THT
components with a standard soldering system.
The housing has a tolerance of 0.2mm
on each side of the case. So the pcb should fit perfectly in the housing. The tolerance can be modified with FreeCAD
in the Parameter
Spreadsheet.
The RCC
is powerd with a 3V
battery (CR2032
). It can be programmed over UPDI on TP1
. The firmware for the cube can be downloaded in the download section.
# +-----------+ +---------------------+
# | U +---+---+ | |
# +---------------------+ | S | USB |--+ +-----------------+ |
# | | | B +---+---+ | | AVR-Dude | |
# | RCC - Color Cube | +----------+ | / | | | ~~~~~~~~ | |
# | +--+--+ +--+--+ U | | U | | | ~~~~~ | |
# | VCC | TP3 +---+ VCC | P +--+--+ +--+--+ A | | | ~~~~~~~~~~~~ | |
# | GND | TP2 +---+ GND | D | GND +--+ GND | R | | | | |
# | +--+--+ +--+--+ I | VCC +--+ VCC | T | | +-----------------+ |
# | | | +-----+ +-----+ A | | |
# | +--+--+ +--+--+ | RxD +--+ RxD | +------+ | Computer |
# | UPDI | TP1 +---+ PDI | | TxD +--+ TxD | |5V/3V3| | |
# | +--+--+ +--+--+ +--+--+ +--+--+ +------+ +---------------------+
# +---------------------+ | ADAPTER | +----+------+
# +-----------+
Register | Value |
---|---|
WDTCFG |
0x00 |
BODCFG |
0x00 |
OSCCFG |
0x03 |
TCD0CFG |
0x00 |
SYSCFG0 |
0xF5 |
SYSCFG1 |
0x00 |
APPEND |
0x00 |
BOOTEND |
0x00 |
The leds are controlled by SPI
. The interface is displayed in the dataflow diagram. There is a pre-configured firmware to use the cube or a library to implement own solutions.
A documentation of the code can be found here https://0x007e.github.io/rcc.
With the attached led
library it is quiet easy to use the cube for own implementations. To setup the led library for the cube implement the header file.
#define F_CPU 20000000UL
#include <avr/io.h>
#include <util/delay.h>
#include "./hal/avr0/system/system.h"
#include "./led/led.h"
LED_Data led1 = {
0x01,
0x0F,
0x00,
0x0A
};
LED_Data led2 = {
0x01,
0x00,
0x0F,
0x0A
};
int main(void)
{
system_init();
led_init();
// ...
while(1)
{
led_blink(LED_Position_Left | LED_Position_Right_Alternating, led_status_color(LED_Status_Ready, LED_MIN_INTENSITY), LED_Delay_MS_200, 2);
LED_SOF();
led_data(led1);
led_data(led2);
LED_EOF();
_delay_ms(2000);
}
}
Type | Link | Description |
---|---|---|
ATtiny402 | ATtiny microcontroller | |
T3A33BRG | RGB Color LED | |
Atmel ICE | Atmel ICE datasheet | |
UPDI | web | UPDI-Adapter with AVR-Dude |
Microchip Studio | web | Download page for Microchip Studio |
KiCAD | web | KiCAD project page |
FreeCAD | web | FreeCAD project page |
R. GAECHTER