Home -> Electronic projects -> A.I.R.

Project name: Advance Infrared Control
Console: Nintendo GameBoy Advance with a SuperCard
Module: ATMEL AVR tiny44, TSOP24438 IR receiver, LD274 IR diode
Programming: AVR programmed in assembler (Algorithm Builder), GBA programmed with GCC C
Purpose: Universal remote control with sample-and-send and GUI

There are many universal remote controls out on the market. None of them have the style of a GameBoy Advance fitted with a little infrared transceiver and a functional programm.
It features a grafical interface with customable buttons. The signal information can be sampled from the original remote control. One key feature is that it is possible to programm up to two commands on one button. So if your favorite TV station is channel '13' you can sample a '1' and a '3' on one button and A.I.R. will send both commands at once. This functionality is also required for the RC5 protocoll which has a toggle bit.

A.I.R.

The .gba ROM file is loaded onto a SD-card and then inserted into a SuperCard.

A.I.R.

The GameBoy no longer has an infrared port. But it does have a user port similar to the RS232 port on the PC. A little IR module is inserted in the user port.

A.I.R.

In SIO general purpose mode (bit 15 of RCNT set) of the GBA link port it is possible to access the ports directly. I decided to emulate a sort of SPI interface for the communication with the AVR module because it is a synchronous protocoll that makes the timing uncritical. But this SPI has an SIR (slave initiated read) function that I had to develop for this system. The SPI has a data rate of 5K bytes which is more than enough for this purpose.

A.I.R.









A.I.R.
Command reference between AVR and GBA:

Echo:
GBA 0xEE
AVR 0xEE
end

Sample to buffer:
GBA 0xA1
AVR samples
AVR 0xAA - succsess
0xFF - error
end

Transmit buffer:
GBA 0xA2
AVR transmitts
AVR 0xAA
end

Download buffer to GBA:
GBA 0xB1
AVR 0xAA
AVR sends 200 bytes
end

Upload buffer to AVR:
GBA 0xB2
GBA sends 200 bytes
AVR 0xAA
end

Sample for transmitting a button:
GBA 0xB2
GBA sends 200 bytes
AVR 0xAA
GBA 0xA2
AVR transmitts
AVR 0xAA
end


The pin layout.

A.I.R.

The ATtiny44 converts the received IR data into serial data that can be read by the GameBoy Advance. Vice versa the GameBoy can send data to the module. The data is converted into pulses and modulated to the carrier frequency of 37KHz. This is compatible with all 38 and 36 KHz devices.

A.I.R.

One of the essential parts is the software in the GameBoy. It is programmed with the free GCC C compiler. It features menus and buttons with a wide variety of icons and even the TV station logos can be placed. So when you want to watch a certain TV station you just need to click on the icon.

A.I.R.



The GUI with buttons. To the left is a list of the currently available icons with a few TV station logos.


A.I.R. Dialogue for sampling a signal and choosing an icon for a button. It is possible to scan two signals and choose if they should be sent after each other or alternating.
The buttons have the following functions:

A: sample signal into the AVR
B: send the signal that is currently in the AVR's buffer for test
L: upload the AVR buffer into signal 1 in the GBA array
R: upload the AVR buffer into signal 2 in the GBA array
Select: mode selection
Start: enter and save to cartridge nonvolatile RAM


A.I.R.



The GUI for placing a folder with icon. The little screen to the left shows the position to which the icon is being placed and what fields are already ocupied. The folder method will not be supported in the end version but rather the ability to scroll the screen to a screen on each of the four sides (that gives you 5 times 24 buttons).


Here is the little module mounted on the GBA. I took a multiplayer cable and connected a little socket to it. It was then coated with Plasti Dip (blue).

A.I.R.


A.I.R.

Still to be implemented: a preview that makes it possible to see where the current button is being placed (blue square).