This project that I start may delay a little bit the other project, the hybrid cooling system, but I consider this project in higher priority as Christmas comes, and also, it is winter and there are not such high temperatures to disturb my CPU.
So, I will continue the idea of my friend Supernova about scripting. The project will carry an extra eeprom that will hold the scripts. This eeprom will be programmed by computer. The structure will be:
FROM 00x0000h TO 00x0080h : Script starting position.
This will be something like the FAT area of a HDD. The device will hold up to 64 (00x0040h) scripts and each one will have a starting position in eeprom. This starting position is indicated by 2 bytes in this eeprom position. The script will end at the point that the other start. So every time someone knows the start and position of each script.
FROM 00x0081h TO 00X0140 : Script configuration
Each script will have 3 bytes for configuration. These bytes are:
B1[0]: Script loop. If it is 0, then the script will not loop. If it is 1, then it will loop infinitely until broken.
B1[3:1]: Data byte length. This indicates the byte length of the outputs. Each byte will be 8bit length. If fir example the output of this script is 2 bytes length, it means that it will capable of controlling 16 outputs simultaneously.
B1[4]: Not used
B1[7:5]: Time base of script scrolling. These bits will determine the scrolling rate of the script according to the following board:
000b: 100 mSec
001b: 250 mSec
010b: 500 mSec
011b: 750 mSec
100b: 1000 mSec
101b: 1500 mSec
110b: 2000 mSec
111b: 3000 mSec
B2[7:0]: Trigger. This byte will carry the trigger input for this script. The MSB (B2[7]) will carry the trigger state of the input. The rest of the bits (B2[6:0]) will carry the trigger input number. For example, 10000010b means that the script will start running when input 2 goes HIGH. There can only one script that is triggered for a specific input state. This means that each time, only one script may run. There can be for example two scripts that will be triggered from the same input, but one will be triggered when this input is 1 and the other when this input is 0.
B3[7:0]: Break. This byte will carry the break input for this script. The MSB (B3[7]) will carry the break state of the input. The rest of the bits (B3[6:0]) will carry the break input number. For example, 00000010b means that the script will stop running when input 2 goes LOW.
The rest of the memory will be dedicated for the scripts data. According to the Data byte length of each script (B1[3:1]), they will be arranged in rows. For example, a 1 data byte length script may be like:
00000001
00000010
00000100
00001000
00010000
00100000
01000000
10000000
This will scroll outputs 0 to 7 (from byte 1) in series.
00000000
11111111
This script will flash all 8 outputs continuously.
The above data are only for information on the structure of the memory. The programming will be made using an appropriate software.