Can be used as a replacement of the original LEGO IR serial tower with programs and platforms such as
- WebPBrick: web-based NQC IDE (see also: github.com/maehw/WebPBrick/)
- Bricx Command Center (BricxCC): 32-bit Windows IDE
firmdl3
command line download tool- probably other software
to load user programs and firmware on the yellow LEGO Mindstorms RCX programmable brick.
Pin Assignment Table for the ATtiny13A:
IC Pin | Pin | Purpose | Direction | Side of IC |
---|---|---|---|---|
1 | PB5 | Reset | Unused | Left |
2 | PB3 | IR_LED_TX_PIN | Output | Left |
3 | PB4 | PHOTO_RX_PIN | Input | Left |
4 | GND | Ground | - | Left |
5 | PB0 | UART_RX_PIN | Output | Right |
6 | PB1 | UART_TX_PIN | Input | Right |
7 | PB2 | IR_ACTIVITY_LED_PIN | Output | Right |
8 | VCC | Supply Voltage (VCC) | - | Right |
Find the productive firmware in folder ./firmware
.
To build, run:
avr-gcc -g -Wall -Os -mmcu=attiny13 -o main.elf main.c
Want to check if it will it fit into the internal flash?
avr-size main.elf
text data bss dec hex filename
776 0 7 783 30f main.elf
Make sure to burn the fuses so that
- the calibrated internal 9.6 MHz oscillator is selected
- clock pre-scaler set to 1 (device is shipped with CKDIV8 programmed).
Reading fuses with avrdude (and in this case an ehajo-isp
in-system programmer):
avrdude -c ehajo-isp -p t13a -U hfuse:r:-:h -U lfuse:r:-:h
Flash the firmware:
avrdude -c ehajo-isp -p t13a -U flash:w:main.elf:e
LEGO® is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this project.