Instructions

311 C-Control Pro IDE
© 2013 Conrad Electronic
void main(void)
{
Port_Attribute(PC23, PORT_ATTR_OUTPUT | PORT_ATTR_INIT_LOW);
Port_Attribute(PC20, PORT_ATTR_INPUT);
while(true) // Endlosschleife
{
if(Port_ReadBit(PC20))
{
Port_WriteBit(PC23, PORT_OFF);
}
else
{
Port_WriteBit(PC23, PORT_ON);
}
}
}
5.19 RC5
A common used standard protocol for infrared data communication is the RC5 code, originally de-
veloped by Phillips. This code has an instruction set of 2048 different instructions and is divided into
32 address of each 64 instructions. Every kind of equipment use his own address, so this makes it
possible to change the volume of the TV without change the volume of the hifi. The transmitted code
is a dataword which consists of 14 bits.
Original protocol:
2 start bits for the automatic gain control in the infrared receiver
1 toggle bit (changes every time a new button is pressed on the IR transmitter)
5 address bits for the system address
6 instruction bits for the pressed key
The start bits help the IR receiver to synchronize and to adjust the automatic gain control of the sig-
nal. The toggle bit changes its value with every keypress. Therefore it is possible to distinguish the
long press of a key with repeated presses of the same key. After a while there was a need to extend
the number of possible instructions from 64 to 128. To maintain compatibility the second start bit
was used for this purpose. If the second start bit is "1", the first 64 instructions can be addressed, if
the 2nd start bit is "0" the next 64 instructions can be selected.
How are the individual bits transferred?
The C-Control Pro generates a carrier frequency of approx. 36Khz on the configured pin, that is con-
nected to the IR-Diode. All transmission pulses are 6,9444 long. There is a delay of 20,8332 µs
between two pulses. For a "1" value, the frequency generation of the transmission is turned of for
88s, and then turned on for 88s (this equals to 32 IR impulses). A value of "0" is created with a
pause of 88s, followed from a frequency generation of 889µs. The time to transfer a whole bit is
1,778ms (2 * 88s) and to transfer a complete 14 bit dataword is 24,889ms. If a key on remote con-
trol is pressed for a longer duration, the corresponding dataword is repeated every 113m778ms.