Revision A of the board is now working and can send a single IR sequence out to a device in the real world when the on board switch is pressed. If OpenIR is to be truly universal the system needs to be able to send a multitude of commands not just a single command. In order to do this we need to be able to store IR command sequences and also allow the user to select which IR sequence is transmitted.
The STM8S has been set up to connect the TTL serial port to the FTDI and RedBear BLE board ports. Doing this allows communication with the outside world (PC, iPhone etc.). The proposed solution uses the serial TTL port to send commands to the STM8S and for the STM8S to store details of the IR signals (carrier frequency, active period etc.) in the on chip EEPROM.
Serial Commands
The STM8S will listen on the serial TTL port for commands from the outside world. The following list of commands are proposed as a starting point:
Command ID | Description |
1 | Get Remote control ID. This returns a text string which identified the remote control. |
2 | Set the remote control ID. |
3 | Get the carrier frequency. This gets the two bytes which are used by Timer 1 to determine the frequency of the PWM signal. |
4 | Set the carrier frequency. This set the two bytes which are used by Timer 1 to determine the frequency of the PWM signal. |
5 | Get the contents of the EEPROM pulse data store. |
6 | Set the contents of the EEPROM pulse data store on the STM8S. |
7 | Transmit pulses for sequence number x where x is the item in the payload. |
8 | Transmit pulses. This transmits and arbitrary sequences of pulses which are contained in the remainder of the payload. |
9 | Time Lapse mode. Send the pulses for sequence x after y seconds. |
10 | Reset the remote control. |
11 | Enable or disable the on board power LED. |
Layout of the EEPROM
The STM8S on the EEPROM stores the configuration of the remote control. The data stored is a mixture of basic configuration along details of the pulses for each command the remote control can transmit.
Offset | Length | Description |
0x00 | 16 | Text ID of the remote control |
0x10 | 2 | Two bytes which are used by Timer 1 to determine the frequency of the carrier signal. The carrier signal is assumed to be 50% duty cycle. |
0x12 | 1 | Number of command sequences stored in the EEPROM. |
0x13 | 1 | Number of seconds to use for the time lapse sequence. |
0x14 | 12 | Unused. |
0x20 | 64 | Length of the pulse sequences (0x20 = length of sequence 0, 0x21 = length of sequence 1 etc.). |
0x60 | 512 | Pulse data. It is assumed that the pulse sequences will start with an on period followed by and off period until the number of sequences have been consumed. |
Conclusion
The basic layout of the EEPROM has been determined along with a proposed command sequence. The next step is to implement the STM8S code and some sample Windows code to configure the remote control.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.