Well, I moved to ADSL from this week. It is the first time that I configured ADSL router. Here is my experience with it. My router is DLink DSL 2540T.
1. Connect the router using Ethernet cable.
2. Type IP address 192.168.1.1 on the web browser.
3. Enter default user name and password as "admin".
4. Then you will get to the router configuration page. In this set-up page, go on following configurations.
-> Router type = PPPoE
-> Virtual Path Identifier(VPI) = 8
-> Virtual Circuit Identifier(VCI) = 35
5. Enter your ADSL user name and password.
6. Applu "FInish" and wait until router get restart.
7. That's all !
සිතක ඇතිවන සිතුවිලි ධාරා බ්ලොග් අවකාශයේ මෙලෙස අකුරු කරන්නට, සභාවෙන් අවසරයි !
Sunday, October 31, 2010
Monday, October 25, 2010
The value of the "tick"
Do you ever believe that the simple "tick" mark costs Rs: 577/= ? Yes. It is...... :-(
I made a request to take new ADSL connection to our home last saturday @ Kurunegala Teleshop. Because, now I'm using dialup connection and tired enough.
In the ADSL application form, there is a field for asking "Instrument installation by SLT" and under that, with small letters "If SLT surpport is not required, tick here". So I simply leave the box without "tick" it.
In such forms, "not" logic is not preferred as much. I can remember, one such case with "not" logic went to court to asking for legal action. Here my tourt of nigligence is there, but anyway it will make me to pay 577/= as labour cost ! I can install ADSL routher by my self.
Today morning, I called to Telecom regional office and ask to not taking this surpport. I'm lucky and thanks for the slowness of work in telecom, my ADSL request is not process yet ! Oh..... Thanks GOD ..... :-)
I made a request to take new ADSL connection to our home last saturday @ Kurunegala Teleshop. Because, now I'm using dialup connection and tired enough.
In the ADSL application form, there is a field for asking "Instrument installation by SLT" and under that, with small letters "If SLT surpport is not required, tick here". So I simply leave the box without "tick" it.
In such forms, "not" logic is not preferred as much. I can remember, one such case with "not" logic went to court to asking for legal action. Here my tourt of nigligence is there, but anyway it will make me to pay 577/= as labour cost ! I can install ADSL routher by my self.
Today morning, I called to Telecom regional office and ask to not taking this surpport. I'm lucky and thanks for the slowness of work in telecom, my ADSL request is not process yet ! Oh..... Thanks GOD ..... :-)
Sunday, October 17, 2010
Emacs - Keyboard functions
Emacs is one of the best software system that can use for text based operations. More details can be found here.
Anyway, I was summarized control keys for my use.
Note:
"M" for ALT key and "C" for CTRL key in the key board.
---------------------------------------------
C-v = move forward by page
M-V = move backward by page
C-l = Center the cursor
--------------------------------------------
C-p = previous line
C-n = next line
C-f = forword by character
C-b = backword by charactor
--------------------------------------------
M-f = forword move by word
M-b = Backword move by word
--------------------------------------------
C-a = Move to begining of line
C-e = Move to end of line
M-a = Move to begining of sentence
M-e = Move to end of sentence
--------------------------------------------
M-< = To bigining of the document
M-> = To end of the document
--------------------------------------------
C-u 8 C-f = Move by 8 charactors
C-u 8 C-v = Move by 8 lines
--------------------------------------------
C-g = cancel previous commands
--------------------------------------------
C-x 1 = Maximize current window
--------------------------------------------
C-u 8 * = Insert 8 "*" marks
--------------------------------------------
C-d = delete char after the curser
M- = Kill the word before curser
M-d = Kill the word after cursor
C-k = kill by the end of line
M-k = Kill by the end of Sentence
--------------------------------------------
C- --> Move to other end --> C-w = kill the marked area
--------------------------------------------
C-y = paste the last killed text in current curser position
M-y = replace the pasted text with before last kill
--------------------------------------------
C-x u = Undo. Can use repititive way
C-_ = Same as undo
--------------------------------------------
C-x C-f = Find a file
C-x C-s = Save the file
C-x C-c = Save changes and kill Emacs
C-z = Suspend Emacs temparaly and go to Shell. Resume by "fg"
--------------------------------------------
C-x C-b = List all buffers
C-x b = switch between buffers
C-x s = save buffers (Ask)
--------------------------------------------
M-x = Run commands
Ex: Replace String:
M-x repl s
--------------------------------------------
M-x recover file
--------------------------------------------
M-x text mode --->> Mode change commands
--------------------------------------------
C-s = search -> type word -> When again press C-s -> Goto Next
--------------------------------------------
C-x 2 = split window by 2
C-M-v = Scroll the second window
C-x o = Move cursor to sencon window wise visa
C-x 4 C-f = open different file in second window
--------------------------------------------
= Recursive mode escape
--------------------------------------------
Anyway, I was summarized control keys for my use.
Note:
"M" for ALT key and "C" for CTRL key in the key board.
---------------------------------------------
C-v = move forward by page
M-V = move backward by page
C-l = Center the cursor
--------------------------------------------
C-p = previous line
C-n = next line
C-f = forword by character
C-b = backword by charactor
--------------------------------------------
M-f = forword move by word
M-b = Backword move by word
--------------------------------------------
C-a = Move to begining of line
C-e = Move to end of line
M-a = Move to begining of sentence
M-e = Move to end of sentence
--------------------------------------------
M-< = To bigining of the document
M-> = To end of the document
--------------------------------------------
C-u 8 C-f = Move by 8 charactors
C-u 8 C-v = Move by 8 lines
--------------------------------------------
C-g = cancel previous commands
--------------------------------------------
C-x 1 = Maximize current window
--------------------------------------------
C-u 8 * = Insert 8 "*" marks
--------------------------------------------
C-d = delete char after the curser
M-
M-d = Kill the word after cursor
C-k = kill by the end of line
M-k = Kill by the end of Sentence
--------------------------------------------
C-
--------------------------------------------
C-y = paste the last killed text in current curser position
M-y = replace the pasted text with before last kill
--------------------------------------------
C-x u = Undo. Can use repititive way
C-_ = Same as undo
--------------------------------------------
C-x C-f = Find a file
C-x C-s = Save the file
C-x C-c = Save changes and kill Emacs
C-z = Suspend Emacs temparaly and go to Shell. Resume by "fg"
--------------------------------------------
C-x C-b = List all buffers
C-x b = switch between buffers
C-x s = save buffers (Ask)
--------------------------------------------
M-x = Run commands
Ex: Replace String:
M-x repl s
--------------------------------------------
M-x recover file
--------------------------------------------
M-x text mode
--------------------------------------------
C-s = search -> type word -> When again press C-s -> Goto Next
--------------------------------------------
C-x 2 = split window by 2
C-M-v = Scroll the second window
C-x o = Move cursor to sencon window wise visa
C-x 4 C-f = open different file in second window
--------------------------------------------
--------------------------------------------
Monday, November 23, 2009
Interfacing with DS 18 B 20 Digital Thermometer

DS18B20PAR is 3 pin digital thermometer with all necessary features to measure temperature upto 12 bit resolution. This use one wire protocol, so it is easy to wire. But, bit difficult to interface. This IC operates with Parasite-Power(bus powered) and so we need only two wires. For more information and free samples, refer
http://www.maxim-ic.com/quick_view2.cfm?qv_pk=2813
This is the mcu code to read and write data from this chip.
Hardware over view.....
** Use PIC18F452 with 12MHz oscillator.
** Refer the top image for hardware connections
** Use Mikro Electronika C compiler
----------------------------------------------------------------------------------
#define set_A(var,bitnum) (var)|=(1<<(bitnum))
#define res_A(var,bitnum) (var)&=~(1<<(bitnum))
short reset_ow()
{
short r;
set_A(TRISA,5); // pull up disable
res_A(TRISA,4); // data pin as o/p
res_A(PORTA,4); // put bus to low
Delay_us(500);
set_A(TRISA,4); // i/p
Delay_us(70); // wait for response
if(PORTA & 0x10) // if bus is still high,
{
r=0;
}
else
{
r=1;
}
Delay_us(500);
return r;
}
/////////////////////////////////////////////////////////////////////////////////////
void write_ow(unsigned short data)
{
short x;
set_A(TRISA,5); // pull up disable
//set_A(TRISA,4); // pull up disable
res_A(TRISA,4); // data pin as o/p
for(x=0;x<8;x++)
{
if(data & 0x01) // write 1 time slot
{
res_A(PORTA,4); // put bus to low
Delay_us(10);
set_A(PORTA,4); //release the bus to high
Delay_us(60);
}
else // write 0 time slot
{
res_A(PORTA,4); // put bus to low
Delay_us(70);
set_A(PORTA,4);
}
Delay_us(2); // recovery time
data=data>>1; // next data bit
}
}
/////////////////////////////////////////////////////////////////////////////////////
unsigned short read_ow()
{
unsigned short res=0,x=0,y=0;
set_A(TRISA,5); // pull up disable
for(x=0;x<8;x++)
{
res_A(PORTA,4); // put bus to low
res_A(TRISA,4); // data pin as o/p
Delay_us(2);
set_A(TRISA,4); //release the bus to high & data pin as i/p
Delay_us(10);
if(PORTA & 0x10) // if bus is high,
{
y=1<
else
{
y=0;
}
res=res | y;
Delay_us(50);
}
return res;
}
/////////////////////////////////////////////////////////////////////////////////////
void pullup()
{
set_A(PORTA,5);
res_A(TRISA,5); // RA 5 as o/p
}
////////////////////////////////////////////////////////////////////////////////////
void main()
{
unsigned short j=0;
unsigned int temp=0,f=0;
ADCON1 = 0xFF;
while(1)
{
reset_ow();
write_ow(0xCC); //skip ROM
write_ow(0x44); // convert
pullup();
Delay_ms(800);
reset_ow();
write_ow(0xCC); //skip ROM
write_ow(0xBE); // read search pad
j=read_ow();
temp=read_ow();
temp <<= 8;
temp = temp + j; // Form the result you can get this as temparature
Delay_ms(200);
}
}
/////////////////////////////////////////////////////////////////////////////////////
Thursday, November 19, 2009
Browser Compatibility Problem Solved !!
In some web sites need to enter the password to log in. And when you type the password, it will display as dots.(Instead of showing the password characters). This password mask will done by the changing input field type.
------------------------------------------------------------------------------
<input name="pw" value="" type="passowrd"/>
------------------------------------------------------------------------------
This will appear normal input field in a html page. But, when you type something on it, it will show as dots.
But, we need to display the text "Password" inside this box and when user click on this, the text should clear. Clearing stuff can be done by java script easily. But problem is this.
If we need to display the text inside the text box, we can do this.
--------------------------------------------------------------------------------
<input name="pw" value="Password" type="passowrd" />
--------------------------------------------------------------------------------
ohhhh... Then it will display as dots !!!
Then what can I do ? One option is change the type from "text" to "password" from java script..
Yes. It works on Firefox. But on internet explorer ???
What a ugly browser is ? IE doesn't support on this dynamic field change !!! Then try to clone nodes and replace parent. It works, but reverse is not !!!
This is the simplest solutioncc to over come in such problems... Use dummy field !!!
----------------------------------------------------------------------------
<input name="pwd_dummyfield1" style="width: 140px;" id="pwd_dummyfield1" value="Password" onfocus="changePassword(true,'passWord_-3','pwd_dummyfield1');" type="text">
<input name="passWord_-3" style="width: 140px; display: none;" id="passWord_-3" onblur="changePassword(false,'passWord_-3','pwd_dummyfield1');" type="password">
<script type="text/javascript">
function changePassword(change,id,dummyid)
{
var dummy = document.getElementById(dummyid);
var actual = document.getElementById(id);
if(change)
{
dummy.style.display = 'none';
actual.style.display = 'block';
actual.focus();
}
else
{
if(actual.value.length == 0)
{
dummy.style.display = 'block';
actual.style.display = 'none';
}
}
}
</script>
-------------------------------------------------------------------------------------
Subscribe to:
Posts (Atom)