-
Keyboard Matrix Reloaded
01/30/2015 at 19:35 • 0 commentsA quick update on my Keyboard Matrix.
The strictly hardware part (not yet connected to mcu) has been completed.
-
Keyboard-Matrix
01/30/2015 at 12:42 • 0 commentsSo, like I stated in my last post, I went to get 50 1n4148 diodes - 3.00€. I already feel bad for not taking more of them. I am going to use most of them for my keyboard matrix of 30 buttons, which will be the input of my computer (it probably won't be the only one, since it would be cool to use the computer for processing other types of input data also (sensors maybe).
Bellow, you can see a few images of how the keyboard looks so far. -
S-RAM module
01/29/2015 at 22:11 • 0 commentsTomorrow, after I get home from work, I'm going to pick up some 1N4148 diodes. I need at least 30 of them, for my keyboard matrix, but I better stack up a bit.
Tomorrow, or the day after, I will start implementing S-RAM module. I have a CS18LV02563P low power SRAM. Basically it's a 256K RAM IC, made by Chiplus. I hope I will manage it, or I will have to stick to my eeprom acting as a ram (lower speed). EEPROM is 24LC256 Serial ROM, which will definetly stay, since I want to have some form of permanent data storage for my OS (which will be written using ASM compiler embeded in my computer's firmware).
The plan is to use a different board (a smaller one) for implementing this Random Access Memory, since I want it thurley tested before connecting it with the main board, which will be done through a slot of some sort, so that if I fail at implementing it, I don't mess up my main board too much.
So if everything will go as planned, I will have a S-RAM module done by monday.
-
TDP Data-bus
01/29/2015 at 09:08 • 0 commentsTDP databus is a custom developed protocol (tripping data protocol), that uses 4 data lines for a stabile communication. These lines are:
- S_DO (Data out)
- S_DI (Data in)
- S_OKO (Data ok out)
- S_OKI (Data ok in)
Note that, a master and slave are connected in the following way: (cross-over)
MASTER = SLAVE
S_DO = S_DI
S_DI = S_DO
S_OKO = S_OKI
S_OKI = S_OKO
The following image represents how a Master and a Slave are connected to a Data Bus. The purple line connecting Master and Slave is a selection line, that selects which Slave reads/writes data (in case of more than one slave).
Every communication is initiated by the Master.
The protocol is not time sensitive, since it uses S_OKO and S_OKI pin to drive data transfer. A new bit will not be sent until S_OKI data says that the previous bit was successfully received.
HERE's the code, if it can help you in any way, you are free to use it:
/* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ********************************************************************** #include <16F627A.h> #device ADC=16 #FUSES NOWDT #FUSES NOMCLR #FUSES NOBROWNOUT #FUSES NOLVP #FUSES NOCPD, NOPROTECT, NOPUT, INTRC_IO #use delay(internal=4MHz) #use STANDARD_IO( A,B ) #define S_OKO PIN_A0 #define S_OKI PIN_A7 #define S_DI PIN_A6 #define S_DO PIN_B7 int16 precalc_val[15] = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384 }; void ___outbit(int1 val) { output_high(S_OKO); if(val == 1) output_high(S_DO); while(!input(S_OKI)); output_low(S_OKO); while(!input(S_OKI)); while(input(S_OKI)); output_low(S_DO); } int1 ___inbit() { int1 r = 0; if(!input(S_OKI)) while(!input(S_OKI)); delay_us(100); output_high(S_OKO); while(input(S_OKI)); if(input(S_DI)) r = 1; delay_us(100); output_low(S_OKO); delay_us(100); return r; } void TDP_init() { output_low(S_OKO); output_low(S_DO); input(S_DI); input(S_OKI); } void TDP_Write(int16 data) { int16 k, c; for (c = 14; c >= 0; c--) { k = data >> c; if (k & 1) ___outbit(0x01); else ___outbit(0x00); if (c == 0) break; } } int16 TDP_Read() { int16 data = 0; int1 val = 0; for(int i = 14; i>= 0; i--) { val = ___inbit(); if(val == 1) data += precalc_val[i]; if (i == 0) break; } return data; }