
[rusty_attiny13a]
(A weekend experiment using the Rust programming language on small attiny13a microcontrollers.)
Our package provides a minimal but functional SDK for use on ultra-small microcontrollers such as the ATTiny13A. The package implements a variety of software buses, including UART and I2C, which provides the ability to connect and interact with various peripheral devices. The library also includes experimental ultra-lightweight support for output to SSD1306.
The aim of our experimental project is to showcase the use of the Rust programming language on ultra-small microcontrollers like ATTiny13A. We aim to demonstrate that even on such constrained devices, Rust can be an effective and flexible development tool.
name | value |
---|---|
mcu | attiny13a |
cpu | 9.6Mhz (internal, +osccal(pre-recorded in eeprom)) |
mem | 64bytes |
flash | 1kb |
eeprom | 64bytes |
pio | PB0-TX, PB1-RX, PB4-SDA, PB3-SCL |
-
Supports I/O at a specified speed using a parity bit (write-only bit).
-
Delays are implemented only in software (the timer is not used).
-
Supports recording to multiple I/O ports simultaneously.
-
Support for burst or single-byte reads.
examples: uart
, uart_rw
, uart_rw_debug
, uart_rw_onebyte
env:
env_name | def_env_value | possible_env_value | description |
---|---|---|---|
UART_BAUD | 115200 |
460800 , 230400 , 115200 , 57600 , 9600 , 4800 , <CUSTOM_BAUD> |
Sets UART BAUD to default. |
UART_PARITY | EVEN |
Even: (1 , EVEN , even ), Odd: (2 , ODD , odd ), Skip: (0 , SKIP , skip ) |
Specifies the requirement to set the parity bit when writing. |
Launch example:
UART_BAUD=115200 UART_PARITY=0 cargo run --release --example uart
-
Support for the I2C bus with setting the desired frequency (it was not possible to set the exact frequency due to flash memory limitations, for example, at a frequency of 400 kHz we get +-355 kHz at the output). (100khz/400khz/800khz/... also supported.)
-
Support for the ACK bit, and with it the ability to determine the success of a transmission.
i2c_scan:
A classic example of i2c bus scanning.
UART_BAUD=115200 cargo run --release --example i2c_scan
print_logo, print_u16counter, flip:
cargo run --release --example ssd1306_x32_counter
This project has a dual license according to (LICENSE-MIT) and (LICENSE-APACHE-2-0).