Skip to content

[stable, code] A weekend experiment using the Rust programming language on small attiny13a microcontrollers.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

UlinProject/rusty_attiny13a

Repository files navigation

mit

[rusty_attiny13a]

(A weekend experiment using the Rust programming language on small attiny13a microcontrollers.)

Description:

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.

Project Goal:

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.

Specifications:

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

UART:

  1. Supports I/O at a specified speed using a parity bit (write-only bit).

  2. Delays are implemented only in software (the timer is not used).

  3. Supports recording to multiple I/O ports simultaneously.

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

I2C:

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

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

Additional support:

SSD1306:

print_logo, print_u16counter, flip:

print_logo, print_u16counter, flip

cargo run --release --example ssd1306_x32_counter

License:

This project has a dual license according to (LICENSE-MIT) and (LICENSE-APACHE-2-0).

uproject  Copyright (c) 2021-2024 #UlinProject

 (Denis Kotlyarov).


Apache License:

apache2  Licensed under the Apache License, Version 2.0.



MIT License:

mit  Licensed under the MIT License.



About

[stable, code] A weekend experiment using the Rust programming language on small attiny13a microcontrollers.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published