Skip to content

0x007E/rcc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Version: 1.0 Release License CC By-NC-SA License GPLv3 Build

RCC - RGB Color Cube

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 ?%

Downloads

Type File Description
Schematic pdf / cadlab Schematic files
Board pdf / cadlab Board file
Drill pdf 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

Hardware

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).

PCB

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.

Top Layer

Top Layer

Bottom Layer

Bottom Layer

Mechanical

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.

Assembled

Assembled

Exploded

Exploded

Programming/Setup

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   |        +----+------+
#                                     +-----------+

FUSES

Register Value
WDTCFG 0x00
BODCFG 0x00
OSCCFG 0x03
TCD0CFG 0x00
SYSCFG0 0xF5
SYSCFG1 0x00
APPEND 0x00
BOOTEND 0x00

Software

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.

Dataflow diagram

Dataflow

Library (led.h)

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);
    }
}

Additional Information

Type Link Description
ATtiny402 pdf ATtiny microcontroller
T3A33BRG pdf RGB Color LED
Atmel ICE pdf 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