<?xml version="1.0" encoding="utf-8"?>
				<!-- generator="e107" -->
				<!-- content type="Forum / topic" -->
				<rss  version="2.0">
				<channel>
				<title>8051 Microcontroller Projects AVR PIC Projects Tutorials Ebooks Libraries codes : Forum / topic</title>
				<link>http://www.8051projects.net/</link>
				<description>Learn to make simple microcontroller projects, pic, 8051, avr and arm projects. download 8051 projects, tutorials, libraries, sample codes. join the microcontroller discussion forum and ask doubts regarding electronics. the best source for 8051 over internet.</description>

<language>en-gb</language>
				<copyright>2008 Rickey's World</copyright>
				<managingEditor>contact@nospam.com (Ajay Bhargav)</managingEditor>
				<webMaster>contact@nospam.com (Ajay Bhargav)</webMaster>
				<pubDate>Wed, 07 Jan 2009 14:09:15 -0800</pubDate>
				<lastBuildDate>Wed, 07 Jan 2009 14:09:15 -0800</lastBuildDate>
				<docs>http://backend.userland.com/rss</docs>
				<generator>e107 (http://e107.org)</generator>
				<ttl>60</ttl>
				<textInput>
				<title>Search</title>
				<description>Search 8051 Microcontroller Projects AVR PIC Projects Tutorials Ebooks Libraries codes</description>
				<name>query</name>
				<link>http://www.8051projects.net/search.php</link>
				</textInput>
						<item>
						<title>Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[i would like to ask some help..<br />please help me on my project..my project is automatically sending of SMS via Nokia 3310 .. how do i interface nokia 3310 to the serial port of my PC.. <br /><br />Ii dont know how to program it..<br />im noob in interfacing..<br />what programming language should i use? is Visual Basic possible to use?<br />how? <br />please help me..<br />thanks..<br />]]></description>
<pubDate>Thu, 27 Sep 2007 00:58:56 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[as i already said.. you can make use of VB to send sms...<br />here is a sample VB code.. <br /><br /><strong class='bbcode bold'>Nokia FBUS SMS and PDU Utility Code and Notes</strong><br /><div class='indent'>Private Sub Form_Unload(Cancel As Integer)<br />If MSComm1.PortOpen = True Then MSComm1.PortOpen = False<br />' This code assumes that you have a Form called SMS<br />' with the following on it:<br />' 1 x Microsoft COM Control V6.0<br />'<br />' DISCLAIMER<br />' This code and the information in it has been provided at no charge, for<br />' non commercial use and the author disclaims all liability of any kind<br />' relating to any use made of it<br />End Sub<br /><br />Private Sub PDUEncoder_Click()<br />PDU.Show<br />' For details on the Nokia FBUS format, jump on the web and check out<br />' sites such as GNOKIA. There are also other sites which talk about<br />' the electronics needed to interface a PC or microcontroller to<br />' a Nokia phone that has an FBUS interface<br />'<br />' This code assumes that you have a Form called SMS<br />' with the following on it:<br />' 1 x Command Button (which is set to run this code when it is clicked)<br />'<br />' DISCLAIMER<br />' This code and the information in it has been provided at no charge, for<br />' non commercial use and the author disclaims all liability of any kind<br />' relating to any use made of it<br />End Sub<br /><br />Private Sub SendSMS_Click()<br />' declare variables<br />Dim msg As String<br />Dim RdStr As String<br />Dim SndStr As String<br />Dim i<br />Dim FL As Integer<br /><br />' clear the send and receive text boxes<br />Sent_String.Text = "": Rcvd_String = ""<br />SMS.Refresh<br /><br />' if the COM port is closed, then open it<br />If MSComm1.PortOpen = False Then MSComm1.PortOpen = True<br /><br />' ask for the message and get the PDU version<br />msg = InputBox("Message")<br />msg_pdu = Text_To_PDU(msg)<br /><br />' get the SMSC phone number<br />' and convert it to FBUS format<br />Input_Phone = InputBox("SMSC Phone Number", , "+61411990010")<br />GoSub Convert_Phone_Number<br />SMSC_Number = Phone_Number<br /><br />' get the SMS destination phone number<br />' and convert it to FBUS format<br />Input_Phone = InputBox("SMS Destination Phone Number", , "0431867231")<br />test_flag = True<br />GoSub Convert_Phone_Number<br /><br />' set frame parameters<br />Frame_ID = Right$("0" &amp; (CStr(Hex(&H1E))), 2)<br />DestDev = Right$("0" &amp; (CStr(Hex(&H0))), 2)<br />SrcDev = Right$("0" &amp; (CStr(Hex(&HC))), 2)<br />MsgType = Right$("0" &amp; (CStr(Hex(&H2))), 2)<br />SMS_Frame_Hdr = Right$("0" &amp; (CStr(Hex(&H0))), 2) &amp; Right$("0" &amp; (CStr(Hex(&H1))), 2) &amp; Right$("0" &amp; (CStr(Hex(&H0))), 2) &amp; Right$("0" &amp; (CStr(Hex(&H1))), 2) &amp; Right$("0" &amp; (CStr(Hex(&H2))), 2) &amp; Right$("0" &amp; (CStr(Hex(&H0))), 2)<br />SMSC_Details = SMSC_Number<br />Msg_Length_For_Calc = (Len(msg_pdu) / 2)<br />Msg_Text_Length = Right$("0" &amp; CStr(Hex(Len(msg))), 2)<br />TPDU = Right$("0" &amp; (CStr(Hex(&H15))), 2) &amp; Right$("0" &amp; (CStr(Hex(&H0))), 2) &amp; Right$("0" &amp; (CStr(Hex(&H0))), 2) &amp; Right$("0" &amp; (CStr(Hex(&H0))), 2)<br />vp = Right$("0" &amp; (CStr(Hex(&HA7))), 2) &amp; Right$("0" &amp; (CStr(Hex(&H0))), 2) &amp; Right$("0" &amp; (CStr(Hex(&H0))), 2) &amp; Right$("0" &amp; (CStr(Hex(&H0))), 2) &amp; Right$("0" &amp; (CStr(Hex(&H0))), 2) &amp; Right$("0" &amp; (CStr(Hex(&H0))), 2) &amp; Right$("0" &amp; (CStr(Hex(&H0))), 2)<br />Frames_To_Go = Right$("0" &amp; (CStr(Hex(&H1))), 2)<br />Seq_No = Right$("0" &amp; (CStr(Hex(&H43))), 2)<br />Frame = Frame_ID &amp; DestDev &amp; SrcDev &amp; MsgType &amp; "00" &amp; SMS_Frame_Hdr &amp; SMSC_Details &amp; TPDU &amp; Msg_Text_Length &amp; Phone_Number &amp; vp &amp; msg_pdu &amp; Frames_To_Go &amp; Seq_No<br /><br />' Set Frame Length values<br />FL = (Len(SMS_Frame_Hdr) / 2) + (Len(SMSC_Details) / 2) + (Len(TPDU) / 2) + (Len(Msg_Text_Length) / 2) + (Len(Phone_Number) / 2) + (Len(vp) / 2) + (Len(msg_pdu) / 2) + (Len(Frames_To_Go) / 2) + (Len(Seq_No) / 2)<br />Frame_Length = FL<br /><br />' check whether pad byte is necessary and add one<br />' if it is<br />Pad_Byte = ""<br />If FL Mod 2 <> 0 Then<br />' Frame is an odd length so add Pad Byte<br />Pad_Byte = Right$("0" &amp; (CStr(Hex(&H0))), 2)<br />End If<br /><br />' create frame<br />Buf_Frame = Frame<br />Frame = Left$(Buf_Frame, 10) &amp; Right$("0" &amp; CStr(Hex(Frame_Length)), 2) &amp; Mid$(Buf_Frame, 11, Len(Buf_Frame) - 10)<br />Frame = Frame &amp; Pad_Byte<br /><br />' calculate checksums and add them to the frame<br />' there are two checksums for FBUS. The first<br />' is an exclusive or (XOR) of the characters in every<br />' odd position in the frame and the second is an<br />' exclusive or (XOR) of the characters in every even<br />' position in the frame (eg if a frame was<br />' 1E 0C 00 7F 00 02 02 03, the odd checksum value would<br />' be: 1E XOR 00 XOR 00 XOR 02 which results in a value<br />' of 1C and the even checksum byte would be:<br />' 0C XOR 7F XOR 02 XOR 03 which results in a value of 72<br />' note all values shown above are in hex<br />process_chr = ""<br />first_odd = True<br />first_even = True<br />char_pos = 0<br />For i = 1 To Len(Frame)<br />process_chr = process_chr &amp; Mid$(Frame, i, 1)<br />If Len(process_chr) = 2 Then<br />Process_Value = CSng("&H" &amp; process_chr)<br />char_pos = char_pos + 1<br />If char_pos Mod 2 <> 0 Then<br />' odd position<br />If first_odd = True Then<br />Odd_ChkSum = Process_Value<br />first_odd = False<br />Else<br />Odd_ChkSum = Odd_ChkSum Xor Process_Value<br />End If<br />Else<br />' even position<br />If first_even = True Then<br />Even_ChkSum = Process_Value<br />first_even = False<br />Else<br />Even_ChkSum = Even_ChkSum Xor Process_Value<br />End If<br />End If<br />process_chr = ""<br />End If<br />Next i<br />Odd_ChkSum = Hex(Odd_ChkSum)<br />Even_ChkSum = Hex(Even_ChkSum)<br />Frame = Frame &amp; Right("0" &amp; (CStr(Hex(CStr("&H" &amp; Odd_ChkSum)))), 2) &amp; Right("0" &amp; (CStr(Hex("&H" &amp; CStr(Even_ChkSum)))), 2)<br /><br />' create a display friendly version of the frame to be sent<br />' so that we can display it<br />For i = 1 To Len(Frame)<br />Out_Chr = Out_Chr &amp; Mid$(Frame, i, 1)<br />If Len(Out_Chr) = 2 Then<br />Output_Frame = Output_Frame &amp; Out_Chr &amp; " "<br />Out_Chr = ""<br />End If<br />Next i<br /><br />' create sms command to go to phone<br />process_chr = ""<br />Send_String = ""<br />For i = 1 To Len(Frame)<br />process_chr = process_chr &amp; Mid$(Frame, i, 1)<br />If Len(process_chr) = 2 Then<br />Send_String = Send_String &amp; Chr$(CSng("&H" &amp; process_chr))<br />process_chr = ""<br />End If<br />Next i<br /><br />' display what we are about to send<br />For i = 1 To 127: Sent_String.Text = Sent_String.Text &amp; "55 ": Next i<br />Sent_String.Text = Sent_String.Text &amp; "55" &amp; Chr$(13) &amp; Chr$(10)<br />Sent_String.Text = Sent_String.Text &amp; Chr(13) &amp; Chr(10) &amp; Output_Frame<br /><br />' refresh the form to ensure that the values are displayed<br />SMS.Refresh<br /><br />' send 128 'U's' (0x55) (55D) to start an FBUS session<br />For i = 1 To 128<br />MSComm1.Output = Chr$(85)<br />Next i<br /><br />' send the command<br />MSComm1.Output = Send_String<br /><br />' display reply by looping and displaying any characters<br />' that are received from the phone.<br />' The First_Flag value is used in the formatting logic.<br />' It ensures that a new line for each response from the<br />' phone does not occur on the first response (this avoids<br />' a blank line in your Text Box)<br />First_Flag = True<br />CheckRX:<br />If MSComm1.InBufferCount <> 0 Then<br />RdStr = MSComm1.Input<br />For i = 1 To Len(RdStr) Step 2<br />If i <> 1 Then Rcvd_String.Text = Rcvd_String.Text &amp; " "<br />If CStr(Hex(Asc(Mid$(RdStr, i, 2)))) = "1E" And First_Flag = False Then Rcvd_String.Text = Rcvd_String.Text &amp; Chr(13) &amp; Chr(10)<br />Rcvd_String.Text = Rcvd_String.Text &amp; Right$("0" &amp; CStr(Hex(Asc(Mid$(RdStr, i, 2)))), 2)<br />First_Flag = False<br />Next i<br />Rcvd_String.Refresh<br />End If<br />DoEvents<br />GoTo CheckRX<br /><br />Exit Sub<br /><br />Convert_Phone_Number:<br />If Left$(Input_Phone, 1) = "+" Then<br />Phone_Number = "91"<br />Input_Phone = Mid$(Input_Phone, 2, Len(Input_Phone) - 1)<br />Else<br />Phone_Number = "81"<br />End If<br />Process_Digit = ""<br />Pad_Digits = 10<br />For i = 1 To Len(Input_Phone)<br />Process_Digit = Process_Digit &amp; Mid$(Input_Phone, i, 1)<br />If Len(Process_Digit) = 2 Then<br />Phone_Number = Phone_Number &amp; Right$(Process_Digit, 1) &amp; Left$(Process_Digit, 1)<br />Process_Digit = ""<br />Pad_Digits = Pad_Digits - 1<br />End If<br />Next i<br />If Len(Process_Digit) = 1 Then<br />' We have an orphaned digit caused by<br />' a phone number with an odd number of<br />' digits, so create Fn where n = the<br />' orphaned digit<br />Phone_Number = Phone_Number &amp; "F" &amp; Process_Digit<br />Pad_Digits = Pad_Digits - 1<br />End If<br />Buf_Phone_Number = Phone_Number<br />If test_flag = False Then<br />Phone_Number = Right$(("0" &amp; CStr(11 - Pad_Digits)), 2) &amp; Buf_Phone_Number<br />Else<br />Phone_Number = "0A" &amp; Buf_Phone_Number<br />End If<br />For i = 1 To Pad_Digits<br />Phone_Number = Phone_Number &amp; "00"<br />Next i<br />Return<br /><br />' NOTES<br />'<br />' For details on the Nokia FBUS format, jump on the web and check out<br />' sites such as GNOKIA. There are also other sites which talk about<br />' the electronics needed to interface a PC or microcontroller to<br />' a Nokia phone that has an FBUS interface<br />'<br />' This code assumes that you have a Form called SMS<br />' with the following on it:<br />' 1 x Text Box called 'Sent_String' with Multi-Line set to True<br />' 1 x Text Box called 'Rcvd_String' with Multi-Line set to True<br />' 1 x Command Button (which is set to run this code when it is clicked)<br />' 1 x Microsoft COM Control V6.0<br /><br />' DISCLAIMER<br />' This code and the information in it has been provided at no charge, for<br />' non commercial use and the author disclaims all liability of any kind<br />' relating to any use made of it<br />End Sub<br /><br />Private Sub SMSFail_Click()<br />help_string = "If you can't get an SMS to work, here are some things to try" &amp; Chr(13) &amp; Chr(10) &amp; Chr(13) &amp; Chr(10)<br />help_string = help_string &amp; _<br />"1. Press the Test / Reset Button to test the interface (and set a different FBUS sequence number)." &amp; Chr(13) &amp; Chr(10) &amp; Chr(13) &amp; Chr(10)<br />help_string = help_string &amp; _<br />"2. Turn the phone on and off to reset it (and the FBUS sequence number)." &amp; Chr(13) &amp; Chr(10) &amp; Chr(13) &amp; Chr(10)<br />help_string = help_string &amp; _<br />"3. If you get 4 responses from the phone when you use the Send SMS option, but you don't receive anything on the destination phone, make sure that:" &amp; Chr(13) &amp; Chr(10)<br />help_string = help_string &amp; _<br />"a) the phone can send an SMS by sending one manually; and" &amp; Chr(13) &amp; Chr(10)<br />help_string = help_string &amp; _<br />"b) you are entering the correct SMSC and destination phone numbers in the correct format. "<br />help_string = help_string &amp; _<br />"SMSC phone numbers must be in international format (eg +61411990010). Destination numbers must be in international format (eg +61411990010) or their normal format (eg 0411990010) " &amp; Chr(13) &amp; Chr(10) &amp; Chr(13) &amp; Chr(10)<br />help_string = help_string &amp; _<br />"4. If you do not get any responses from the phone when you use the Send SMS option, follow (1), then (2) above." &amp; Chr(13) &amp; Chr(10) &amp; Chr(13) &amp; Chr(10)<br />help_string = help_string &amp; _<br />"5. Is your phone compatible with this Utility? It has only been tested with a Nokia 3310."<br /><br />MsgBox "" &amp; help_string<br /><br />' NOTES<br />'<br />' For details on the Nokia FBUS format, jump on the web and check out<br />' sites such as GNOKIA. There are also other sites which talk about<br />' the electronics needed to interface a PC or microcontroller to<br />' a Nokia phone that has an FBUS interface<br />'<br />' This code assumes that you have a Form called SMS<br />' with the following on it:<br />' 1 x Command Button (which is set to run this code when it is clicked)<br />'<br />' DISCLAIMER<br />' This code and the information in it has been provided at no charge, for<br />' non commercial use and the author disclaims all liability of any kind<br />' relating to any use made of it<br />End Sub<br /><br />Private Sub TestReset_Click()<br />' declare variables<br />Dim RdStr As String<br />Dim SndStr As String<br />Dim i As Single<br />Dim First_Flag As Boolean<br /><br />Sent_String.Text = "": Rcvd_String = ""<br />SMS.Refresh<br /><br />' if the COM port is closed, then open it<br />If MSComm1.PortOpen = False Then MSComm1.PortOpen = True<br /><br />' display what we are about to send<br />For i = 1 To 127: Sent_String.Text = Sent_String.Text &amp; "55 ": Next i<br />Sent_String.Text = Sent_String.Text &amp; "55" &amp; Chr$(13) &amp; Chr$(10)<br />Sent_String.Text = Sent_String.Text &amp; "1E 00 0C D1 00 07 00 01 00 03 00 01 60 00 72 D5" &amp; Chr(13) &amp; Chr(10)<br /><br />' refresh the form to ensure that the values are displayed<br />SMS.Refresh<br /><br />' create the command to send<br />SndStr = Chr$(30) &amp; Chr$(0) &amp; Chr$(12) &amp; Chr$(209) &amp; Chr$(0) &amp; Chr(7) &amp; Chr$(0) &amp; Chr$(1) &amp; Chr(0) &amp; Chr(3) &amp; Chr$(0) &amp; Chr$(1) &amp; Chr$(96) &amp; Chr$(0) &amp; Chr$(114) &amp; Chr$(213)<br /><br />' Send 128 'U's' (0x55) (55D) to start an FBUS session<br />For i = 1 To 128<br />MSComm1.Output = Chr$(85)<br />Next i<br /><br />' send the command (in this case it is the command that gets the<br />' the phone to return its hardware and software details<br />MSComm1.Output = SndStr<br /><br />' display reply by looping and displaying any characters<br />' that are received from the phone.<br />' The First_Flag value is used in the formatting logic.<br />' It ensures that a new line for each response from the<br />' phone does not occur on the first response (this avoids<br />' a blank line in your Text Box)<br />First_Flag = True<br />CheckRX:<br />If MSComm1.InBufferCount <> 0 Then<br />RdStr = MSComm1.Input<br />For i = 1 To Len(RdStr) Step 2<br />If i <> 1 Then Rcvd_String.Text = Rcvd_String.Text &amp; " "<br />If CStr(Hex(Asc(Mid$(RdStr, i, 2)))) = "1E" And First_Flag = False Then Rcvd_String.Text = Rcvd_String.Text &amp; Chr(13) &amp; Chr(10)<br />Rcvd_String.Text = Rcvd_String.Text &amp; Right$("0" &amp; CStr(Hex(Asc(Mid$(RdStr, i, 2)))), 2)<br />First_Flag = False<br />Next i<br />Rcvd_String.Refresh<br />End If<br />DoEvents<br />GoTo CheckRX<br />'<br />' NOTES<br />'<br />' This code has two functions:<br />' 1. test whether your PC - Phone Interface is working<br />' 2. resets the phone message sequence number if you<br />' just sent an SMS.<br />'<br />' Function 2 is necessary as I have not implemented any<br />' sequence increment logic in this utility. This means that<br />' once you send an SMS, you can't send another one until<br />' you run this code (which sends a different sequence number<br />' to the phone, thereby allowing you to send another SMS. This<br />' sequence issue occurs as as the SMS send code uses the same<br />' sequence number and the phone will not accept the same<br />' sequence number twice in a row.<br />'<br />' This code starts an FBUS session (ie sends 128 'U's (hex 55's)) to<br />' the phone, then sends the command to return the hardware and<br />' software details of the phone.<br />'<br />' All data sent to and received from the phone must be hex characters<br />' and the sofwtare and hardware details that come back from the phone<br />' will be in PDU format.<br />'<br />' IMPORTANT NOTE: the command has only been tested on a Nokia 3310<br />' SECOND IMPORTANT NOTE: as there can be a delay between sending<br />' a command and getting a response, this code loops endlessly looking<br />' for responses from the phone (ie it does not time out). A Nokia 3310<br />' will send 4 responses to this command (one short one acknowledging<br />' the command and 3 identical (and longer) responses containing the<br />' hardware and software details). You can add timeout code if you want.<br />' If you don't then make sure that you put a Port close command somwhere<br />' else in your code<br /><br />' For details on the Nokia FBUS format, jump on the web and check out<br />' sites such as GNOKIA. There are also other sites which talk about<br />' the electronics needed to interface a PC or microcontroller to<br />' a Nokia phone that has an FBUS interface<br />'<br />' This code assumes that you have a Form called SMS<br />' with the following on it:<br />' 1 x Text Box called 'Sent_String' with Multi-Line set to True<br />' 1 x Text Box called 'Rcvd_String' with Multi-Line set to True<br />' 1 x Command Button (which is set to run this code when it is clicked)<br />' 1 x Microsoft COM Control V6.0<br />'<br />' DISCLAIMER<br />' This code and the information in it has been provided at no charge, for<br />' non commercial use and the author disclaims all liability of any kind<br />' relating to any use made of it<br />End Sub<br /><br />Private Sub Encode_Button_Click()<br />' declare variables<br />Dim encoded_text As String<br />Dim i As Integer<br /><br />' clear any previous values<br />Encoded_Msg.Text = ""<br />ECLength.Text = ""<br />ECLength.Text = ""<br /><br />' display length of unencoded message<br />UECLength.Text = Len(Unencoded_Msg.Text)<br /><br />' refresh form<br />PDU.Refresh<br /><br />' get encoded text<br />encoded_text = Text_To_PDU(Unencoded_Msg.Text)<br /><br />' display encoded message<br />For i = 1 To Len(encoded_text) Step 2<br />If i <> 1 Then Encoded_Msg.Text = Encoded_Msg.Text &amp; " "<br />Encoded_Msg.Text = Encoded_Msg.Text &amp; Mid$(encoded_text, i, 2)<br />Next i<br /><br />' display length of encoded message<br />ECLength.Text = Len(encoded_text) / 2<br /><br />' refresh form<br />PDU.Refresh<br /><br />' NOTES<br />'<br />' This code assumes that you have a Form called PDU<br />' with the following on it:<br />' 1 x Text Box called 'Unencoded_Msg' with Multi-Line set to True<br />' 1 x Text Box called 'UECLength'<br />' 1 x Text Box called 'Encoded_Msg' with Multi-Line set to True<br />' 1 x Text Box called 'ECLength'<br />' 1 x Command Button (which is set to run this code when it is clicked)<br />'<br />' DISCLAIMER<br />' This code and the information in it has been provided at no charge, for<br />' non commercial use and the author disclaims all liability of any kind<br />' relating to any use made of it<br />End Sub<br /><br />Public Function Text_To_PDU(msg)<br />' declare variables<br />Dim bin_msg_chars(128) As String<br />Dim return_value As String<br />Dim borrow_value, i, n As Byte<br /><br />' default return value to nothing<br />Text_To_PDU = ""<br /><br />' return if there is no message to encode<br />If Len(msg) = 0 Then Exit Function<br /><br />' put the binary value of each message character<br />' into the bin_msg_chars array<br />For i = 1 To Len(msg)<br />bin_msg_chars(i) = Dec_To_Bin(Asc(Mid$(msg, i, 1)))<br />Next i<br /><br />' perform the encoding (see notes below)<br />borrow_value = 0: n = 0<br />For i = 1 To Len(msg)<br />If i <> Len(msg) Then<br />If bin_msg_chars(i) <> "!" Then<br />borrow_val = borrow_val + 1<br />If borrow_val = 8 Then borrow_val = 1<br />n = n + 1<br />return_string = return_string &amp; Right$("0" &amp; CStr(Hex(Bin_To_Dec(Right$(bin_msg_chars(i + 1), borrow_val) &amp; bin_msg_chars(i)))), 2)<br />If borrow_val = 7 Then<br />bin_msg_chars(i + 1) = "!"<br />Else<br />bin_msg_chars(i + 1) = Mid$(bin_msg_chars(i + 1), 1, Len(bin_msg_chars(i + 1)) - borrow_val)<br />End If<br />End If<br />Else<br />n = n + 1<br />return_string = return_string &amp; Right$("0" &amp; CStr(Hex(Bin_To_Dec(bin_msg_chars(i)))), 2)<br />End If<br />Next i<br /><br />' return the encoded mesage to the calling program<br />Text_To_PDU = return_string<br /><br />' NOTES<br />'<br />' PDU ENCODING BASICS<br />'<br />' PDU encoding is performed by taking each 7 bit character and packing<br />' them into 8 bit characters. If you have more than 7 characters, this results<br />' in a compressed form of encoding as every 7th character is encoded into<br />' the previous 6 characters.<br />'<br />' Encoding can be done manually by taking the characters to be encoded, writing them<br />' down back to front (eg hello would be written 'olleh'), converting them to<br />' 7 bit binary and performing the process (working left to right) set out below. In essence<br />' this process involves making 8 bit characters from 7 bit characters by taking bits from<br />' successive characters.<br />'<br />' 1. For the first character (ie the 'h'), we need 1 bit to make it an 8 bit character.<br />' We get this by taking it from the last bit of the next character (ie the 'e') and adding<br />' it to the front of the character we are processing. For this example, the bit we would<br />' take would be a '1'(as 'e' is 110 0101 in binary). This gives us a first encoded character<br />' of 1110 1000 (as 'h' is binary 110 1000) so adding the '1' we took gives us 1110 1000.<br />' 2. As we have taken the last bit from the second character (ie the 'e'), we need to take<br />' 2 characters from the following character (ie the 'l') to make an 8 bit character.<br />' The two would be '00' (as 'l' is 110 1100 in binary). If we add these two bits to the<br />' character we are processing, we get 0011 0010 (as the 'e' was 110 0101, but became 110 010<br />' after we took the last bit to encode our first character).<br />' 3. This process continues for each character until we either:<br />' (a) reach a point where we have taken all of the bits from the next character (eg where we<br />' have taken 6 bits from a character (leaving 1 bit) and then have to process that character)<br />' and have another character in front of that to process. To do this, we would need to take<br />' all 7 bits of the following character. After we do this, there is nothing left of the following<br />' character so it is skipped (ie we don't process it). It is not lost as it has been encoded into<br />' the previous character; or<br />' (b) reach the last character (ie there are no more characters ahead of it). At this point we<br />' simply leave the last character as it is (ie we do nothing to it). For our 'hello' example, the<br />' last character will be 0x06 (ie 6 Hex or 0000 0110 binary)<br />' 4. Once you have completed this process, don't forget that you have worked from right to left, but the<br />' encoded values must be entered into your phone from left to right. For our example we would (working<br />' right to left) get 0x06 0xFD 0x9B 0x32 0xE8. However, the phone would need to see E8329BFD06<br />'<br />' If you want to check a manual encoding, the working should look like this:<br />'<br />' Chr o l l e h<br />' Hex 0x6F 0x6C 0x6C 0x65 0x68<br />' Bin 110 1111 110 1100 110 1100 110 0101 110 1000<br />'<br />' Bits 110 [1111] 110 1[100] 110 11[00] 110 010[1]<br />' taken<br />'<br />' Result 110 1111 1101 1001 1011 0011 0010 1110 1000<br />' 0x06 0xFD 0x9B 0x32 0xE8<br />'<br />' reverse the order to get the form that is used to send to your phone<br />' and you get the result: E8 32 FD 06 (all hex)<br />'<br />' THIS CODE<br />'<br />' As Visual Basic does not have a bit shift function, the code manipulates<br />' the message characters by turning them into binary values and pretty much<br />' applying the encoding method described above.<br />'<br />' While you could perform encoding with few less lines of code using something<br />' like c or c++ (which has bit shift functions), there is actually not a huge<br />' difference in code size and this method may make the code easier to understand<br />' as it follows the encoding method described above.<br />'<br />' DISCLAIMER<br />' This code and the information in it has been provided at no charge, for<br />' non commercial use and the author disclaims all liability of any kind<br />' relating to any use made of it<br />'<br />End Function<br /><br />Public Function Dec_To_Bin(dec_val)<br />' declare variables<br />Dim leading_zero_flag As Boolean<br />Dim i, place_val As Byte<br />Dim pad_zeroes As String<br />' logic<br />leading_zero_flag = True<br />For i = 1 To 8<br />If i = 1 Then place_val = 128 Else place_val = place_val / 2<br />If dec_val / place_val >= 1 Then<br />Dec_To_Bin = Dec_To_Bin &amp; "1"<br />dec_val = dec_val - place_val<br />leading_zero_flag = False<br />Else<br />If leading_zero_flag = False Then<br />Dec_To_Bin = Dec_To_Bin &amp; "0"<br />End If<br />End If<br />Next i<br />pad_zeroes = ""<br />For i = 1 To 7 - Len(Dec_To_Bin)<br />pad_zeroes = pad_zeroes &amp; "0"<br />Next i<br />Dec_To_Bin = pad_zeroes &amp; Dec_To_Bin<br />'<br />' NOTES<br />' This code converts to binary by successively dividing<br />' the passed decimal value by 128, 64, 32, 16, 8, 4, 2 and 1<br />' and testing whether each result is greater than or equal to 1<br />' If it is greater than or equal to 1, then it sets the relevant<br />' bit value to a '1'. If it is not greater than or equal to 1, then<br />' it sets the relevant bit value to a '0' if the leading bit flag is set.<br />' This flag ensures that we get one leading zero for a 7 bit character<br />' that starts with a '0' (eg 011 0010) and no leading zeroes for a<br />' 7 bit character that starts with a '1' (eg 110 1000). This is critical<br />' for the bit manipulation logic in the 'Text_To_PDU' routine as it has<br />' to have 7 bit binary values<br />'<br />' DISCLAIMER<br />' This code and the information in it has been provided at no charge, for<br />' non commercial use and the author disclaims all liability of any kind<br />' relating to any use made of it<br />End Function<br /><br />Public Function Bin_To_Dec(bin_val)<br />' declare variables<br />Dim i, place_val As Byte<br /><br />' logic<br />bin_val = Right$("00000000" &amp; bin_val, 8)<br />For i = 8 To 1 Step -1<br />If i = 8 Then place_val = 1 Else place_val = place_val * 2<br />If Mid$(bin_val, i, 1) = "1" Then<br />Bin_To_Dec = Bin_To_Dec + place_val<br />End If<br />Next i<br />'<br />' NOTES<br />' This code converts the passed binary value to decimal<br />' by successively adding 1, 2, 4, 8, 16, 32, 64 and 128<br />' depending on whether the relevant binary value bit is<br />' a '1' or a '0'.<br />' The padding of preceding zeroes at the start is needed<br />' as the 'Text_To_PDU' routine works with binary values<br />' of varying sizes. The padding ensures that this logic<br />' always gets an 8 bit binary value<br />'<br />' DISCLAIMER<br />' This code and the information in it has been provided at no charge, for<br />' non commercial use and the author disclaims all liability of any kind<br />' relating to any use made of it<br />End Function</div>]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Thu, 27 Sep 2007 02:27:00 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[what kind of data cable should I use to interface to the serial port of the PC?]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Thu, 27 Sep 2007 03:58:27 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[if you want to make use of datacable then you need to clear RTS and Set DTR signal in the program..<br />This can be done as shown below..<br /><div class='code_asm'>CODE:</div><div class='code_highlight' style='unicode-bidi: embed; direction: ltr'><div class="asm" style="font-family: monospace;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MSComm1.Dtr = True<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MSComm1.Rts = False</div></div><br /><br />you can directly connect your phone with datacable to the PC's com port.]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Thu, 27 Sep 2007 09:56:33 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[what's the name of the datacable?<br /><br />thank you Ajay..]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Thu, 27 Sep 2007 15:10:09 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[Just ask for Nokia 3310 datacable.. thats all.. <br />technically i think its called <strong class='bbcode bold'>DAU9P</strong> or FBUS cable.. you need to check in your local market..]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Thu, 27 Sep 2007 20:52:46 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[ah ok.. thanks a lot Ajay..<br />great help for me.. <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Fri, 28 Sep 2007 02:22:29 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[just connect the datacable... with PC COM port... and take the above given code as reference and make your project.. If you face any problem. Ask me <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Thu, 04 Oct 2007 05:54:03 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[hi ajay..<br />i have now datacable.. how do i start to make my project?<br />please help me.. i dont know what to do  <img src='http://www.8051projects.net/e107_images/emotes/yahoo/2.gif' alt='' style='vertical-align:middle; border:0' />  .. <br />I need ur help..]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Thu, 04 Oct 2007 00:38:15 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[the code doesn't work <img src='http://www.8051projects.net/e107_images/emotes/yahoo/2.gif' alt='' style='vertical-align:middle; border:0' /> .. i transferred it to visual basic.. and i tested it but it doesnt send a SMS.. nothing happened.. help me ajay please..]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Fri, 05 Oct 2007 00:16:31 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[I don't think you've read the code properly.. did you add the components as described in the code? Like buttons, textboxes forms etc...?]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Fri, 05 Oct 2007 01:20:46 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[yes.. i did all what it said in the code.. but it doesn't work <img src='http://www.8051projects.net/e107_images/emotes/yahoo/2.gif' alt='' style='vertical-align:middle; border:0' />  what should i do?]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Fri, 05 Oct 2007 12:39:12 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[well it worked with me... <img src='http://www.8051projects.net/e107_images/emotes/yahoo/10.gif' alt='' style='vertical-align:middle; border:0' /> <br />anyways i am attaching the VB project.. check it out <img src='http://www.8051projects.net/e107_images/emotes/yahoo/4.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Fri, 05 Oct 2007 13:12:26 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[download it from here...<br /><a class='bbcode' href='http://www.8051projects.net/downloads190.html' rel='external'  target='_blank'><strong class='bbcode bold'>Nokia FBUS SMS and PDU Utility Code and Notes</strong></a>]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Fri, 05 Oct 2007 13:19:53 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[hi again ajay  <img src='http://www.8051projects.net/e107_images/emotes/yahoo/4.gif' alt='' style='vertical-align:middle; border:0' />  ..<br />what does this means?<br /><br />IMPORTANT: PLEASE CHANGE THE MSCOMM1 SETTINGS ACCORDING TO THE COM PORT AVAILABLE ON YOUR PC.<br /><br />i dont understand it.. can u explain it to me.. <br />thank u again..<br />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 06 Oct 2007 00:39:13 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[check your device manager to see the name of your serial ports....<br />in some pcs you will find lots of com ports available....<br />com1<br />com2<br />com3...etc.... mostly happens when u are using laptops with bluetooth and wi fi....<br />so do confirm the name of your com port at which the f-bus cable is to be connected...... <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' />  <br />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 06 Oct 2007 04:31:14 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[usually its either COM1 or COM2..<br />in the SMS.frm you see MSCOMM1 icon.. click on its properties and change the COM port number whichever is available on your PC.]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 06 Oct 2007 04:44:59 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[9600,n,8,1 this is the default settings on my com1.. do i have to change it?<br />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 06 Oct 2007 13:19:29 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[yes.. change it to whatever port available and 115200,n,8,1]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 06 Oct 2007 21:39:04 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[HW = hardware Version<br />and SW = software version..<br /><br />the test button send command 0xD1 which is to read the hardware and software version of Nokia Phones.<br /><br />I want to see what you get in the receive window.. there are two text boxes in the software...<br />the top one is what is being transmitted and bottom one is what is being received. So do not forget to label the data received..<br />e.g.<br />TX data:<br />........<br /><br />RX data:<br />........<br /><br />like that i want.. and whatever you sent at the top... doesn't seems to be correct....]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Tue, 09 Oct 2007 22:06:40 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[??? is that an error you are getting? or what?]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Tue, 09 Oct 2007 04:36:38 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[ajay..<br />still not working..<br />what does this means..<br /><br />set different FBUS sequence number..<br /><br />help me please..<br />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Tue, 09 Oct 2007 04:00:32 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[there's no error appeared.. but the destination number doesn't receive the SMS that i have sent..<br />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Tue, 09 Oct 2007 04:55:41 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[what reply you are getting form the phone.. can you post it?<br />also have you done the test? i mean to say.. have you tried clicking on test button..<br />you will get a ACK frame after that you will get a HW and SW version frame 3 times... tell me are u getting that or not...]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Tue, 09 Oct 2007 04:59:35 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
						<item>
						<title>Re: Automatically sending of SMS via Nokia 3310</title>
<link>http://www.8051projects.net/forum-t2590.html</link>
<description><![CDATA[hi ajay..<br />this is what i get after clicking the test button and reseting the phone:<br /><br />55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 5555 55 55 55 55 <br />1E 0C 00 00 00 00 60 72 <br />1E 00 00 D1 CF <br />1E 00 00 01 00 56 30 2E 37 30 2D 37 30 0A 48 2D 0A 63 20 4D 2E 01 3E<br />1E 00 00 01 00 56 302E 37 30 2D 37 30 0A 48 2D 0A 63 20 4D 2E 01 3E<br />1E 00 00 01 00 56 302E 37 30 2D 37 30 0A 48 2D 0A 63 20 4D 2E 01 3E<br />1E 00 00 01 00 01 <br />1E 00 00 00 00 00 00 00 00 00 00 00 FF D0 03 01 00 2D 14 F4 01 00 E1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br /><br />what is HW and SW version btw?]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Tue, 09 Oct 2007 14:05:02 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t2590.html</guid>
</item>
				</channel>
				</rss>