23
AT Command dan PDU SIEMENS type C/M/S 35 AT Command bertugas mengirim atau menerima data ke atau dari SMS- Center. AT Command tiap-tiap SMS device biasanya berbeda-beda, tetapi pada dasarnya sama. Beberapa AT Command yang penting untuk SMS yaitu : • AT+CMGS : untuk mengirim SMS • AT+CMGL : untuk memeriksa SMS • AT+CMGD : untuk menghapus SMS AT Command untuk SMS, biasanya diikuti oleh data I/O yang diwakili oleh unit-unit PDU. PDU Sebagai Bahasa SMS dan Bagian – Bagiannya Data yang mengalir ke atau dari SMS-Center harus berbentuk PDU (Protocol Data Unit). PDU berisi bilangan-bilangan heksadesimal yang mencerminkan bahasa I/O. PDU terdiri atas beberapa Header. Header untuk kirim SMS ke SMS-Center berbeda dengan SMS yang diterima dari SMS-Center. Maksud dari bilangan heksadesimal adalah bilangan yang terdiri atas 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F. PDU untuk mengirim SMS terdiri atas : 1. Nomor SMS-Center Header pertama ini terbagi atas tiga subheader, yaitu : Jumlah pasangan heksadesimal SMS-Center dalam bilangan heksa. Daftar SMS Center yang ada di Indonesia diperlihatkan dalam tabel dibawah ini. National/International Code a. Untuk National, kode subheader-nya yaitu 81 b. Untuk International, kode subheader-nya yaitu 91 No SMS-Centernya sendiri, dalam pasangan heksa dibalikbalik. Jika tertinggal satu angka heksa yang tidak memiliki pasangan, angka tersebut akan dipasangkan dengan huruf F didepannya. Tabel Nomor SMS-Center Operator Seluler Di IndonesiaNo Operator Seluller SMS-Center Kode PDU 1 Telkomsel 62811000000 07912618010000F 2 Satelindo 62816125 059126181652

At Command

Embed Size (px)

DESCRIPTION

Perintah untuk HP

Citation preview

AT Command dan PDU SIEMENS type C/M/S 35

AT Command bertugas mengirim atau menerima data ke atau dari SMS-Center. AT Command tiap-tiap SMS device biasanya berbeda-beda, tetapi pada dasarnya sama. Beberapa AT Command yang penting untuk SMS yaitu :

AT+CMGS : untuk mengirim SMS AT+CMGL : untuk memeriksa SMS AT+CMGD : untuk menghapus SMSAT Command untuk SMS, biasanya diikuti oleh data I/O yang diwakili oleh unit-unit PDU.

PDU Sebagai Bahasa SMS dan Bagian BagiannyaData yang mengalir ke atau dari SMS-Center harus berbentuk PDU (Protocol Data Unit). PDU berisi bilangan-bilangan heksadesimal yang mencerminkan bahasa I/O. PDU terdiri atas beberapa Header. Header untuk kirim SMS ke SMS-Center berbeda dengan SMS yang diterima dari SMS-Center. Maksud dari bilangan heksadesimal adalah bilangan yang terdiri atas 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.

PDU untuk mengirim SMS terdiri atas :

1. Nomor SMS-CenterHeader pertama ini terbagi atas tiga subheader, yaitu :Jumlah pasangan heksadesimal SMS-Center dalam bilangan heksa. Daftar SMS Center yang ada di Indonesia diperlihatkan dalam tabel dibawah ini.National/International Code

a. Untuk National, kode subheader-nya yaitu 81

b. Untuk International, kode subheader-nya yaitu 91No SMS-Centernya sendiri, dalam pasangan heksa dibalikbalik. Jika tertinggal satu angka heksa yang tidak memiliki pasangan, angka tersebut akan dipasangkan dengan huruf F didepannya.

Tabel Nomor SMS-Center Operator Seluler Di IndonesiaNoOperator SelullerSMS-CenterKode PDU1Telkomsel6281100000007912618010000F2Satelindo628161250591261816523Exelcom621844500907912618485400F4Indosat-M36285500000007912658050000F5Starone62811000000079126180100

2. Tipe SMS

Untuk SEND tipe SMS = 1. Jadi bilangan heksanya adalah 01

3. Nomor Referensi SMS

Nomor referensi ini dibiarkan dulu 0, jadi bilangan heksanya adalah 00. Nanti akan diberikan sebuah nomor referensi otomatis oleh ponsel/alat SMS-gateway.

4. Nomor Ponsel Penerima

Sama seperti cara menulis PDU Header untuk SMS Center, header ini juga terbagi atas tiga bagian, sebagai berikut :

Jumlah bilangan desimal nomor ponsel yang dituju dalam bilangan heksa.

National/International Code.

- Untuk Nasional, kode subheader-nya 81

- Untuk Internasional, kode subheader-nya 91

Nomor ponsel yang dituju, dalam pasangan heksa dibalik-balik.

Jika tertinggal satu angka heksa yang tidak memilikipasangan, angka tersebut dipasangkan dengan huruf F didepannya.

Contoh :

Untuk nomor ponsel yang dituju = 628x32x7333x dapat ditulis dengan cara sebagai berikut :

628132x7333x diubah menjadi :

1. 0C : ada 12 angka

2. 91

3. 26-18-23-7x-33-x3

Digabung menjadi : 0C9126x8237x33x3 (x ialah samaran nomer)

Bentuk SMS, antara lain :00 : dikirim sebagai SMS01 : dikirim sebagai telex02 : dikirim sebagai fax

Dalam hal ini, untuk mengirim dalam bentuk SMS tentu saja dipakai 00

5. Skema Encoding Data I/O

Ada dua skema, yaitu :

1. Skema 7 bit : ditandai dengan angka 00

2. Skema 8 bit : ditandai dengan angka lebih besar dari 0

Kebanyakan ponsel/SMS Gateway yang ada dipasaran sekarang menggunakan skema 7 bit sehingga digunakan 00.

6. Jangka Waktu Sebelum SMS Expired

Agar SMS pasti terkirim sampai ke ponsel penerima, sebaiknya tidak diberi batasan waktu validnya.

Isi SMS

Header ini terdiri atas dua subheader, yaitu :

a. Panjang isi (jumlah huruf dari isi)

Misalnya untuk kata hello : ada 5 huruf : 05

b. Isi SMS berupa pasangan bilangan heksa

Untuk ponsel/SMS Gateway berskema encoding 7 bit, jika mengetikan suatu huruf dari keypad-nya, berarti kita telah membuat 7 angka I/O berturutan.

Ada dua langkah untuk mengkonversikan isi SMS, yaitu :Mengubahnya menjadi kode 7 bit.Langkah kedua: mengubah kode 7 bit menjadi 8 bit yang diwakili oleh pasangan heksa.

Contoh : untuk kata hello

Oleh karena total 7 bit x 5 huruf = 35 bit, sedangkan yang kita perlukan adalah 8 bit x 5 huruf = 40 bit, maka diperlukan 5 bit dummy yang diisi dengan bilangan 0. Setiap 8 bit mewakili suatu pasangan heksa. Tiap 4 bit

mewakili satu angka heksa, tentu saja karena secara logika 24 = 16. Dengan demikian kata hello hasil konversinya menjadi E8329BFD06

Ke delapan header diatas digabungkan agar membentuk suatu format PDU yang siap dikirim. Misal untuk mengirimkan kata hello ke ponsel nomor 628129573337 lewat SMS-Center Exelcom, tanpa membatasi jangka waktu valid, maka header PDU lengkapnya :

07912618485400F901000C9126x8237x33x3000005E8329BFD06

07912618485400F 90100 0C9126x8237x33x3 000005 E8329BFD06

07912618485400F : ok dimengerti90100 : ini darimana maz????0C9126x8237x33x3 : ok dimengerti000005 : ini darimana maz???E8329BFD06 : ok dimengerti

Penjelasan:000005:Bentuk SMS, antara lain :00 : dikirim sebagai SMS01 : dikirim sebagai telex02 : dikirim sebagai faxDalam hal ini, untuk mengirim dalam bentuk SMS tentu saja dipakai 00

Skema Encoding Data I/OAda dua skema, yaitu :1. Skema 7 bit : ditandai dengan angka 2. Skema 8 bit : ditandai dengan angka lebih besar dari 0Kebanyakan ponsel/SMS Gateway yang ada dipasaran sekarang menggunakan skema 7 bit sehingga digunakan 00

Jangka Waktu Sebelum SMS Expired

Agar SMS pasti terkirim sampai ke ponsel penerima, sebaiknya tidak diberi batasan waktu validnya.

Isi SMS

Header ini terdiri atas dua subheader, yaitu :

a. Panjang isi (jumlah huruf dari isi)

Misalnya untuk kata hello : ada 5 huruf : 05

ATOKAT+CMGS=?OKAT+CMGS=180791265805000F011000D91269836263184F70000FF05C8329BFD06ERROR

SMS and the PDU format

IntroductionThe SMS message, as specified by the Etsi organization (documents GSM 03.40 and GSM 03.38), can be up to 160 characters long, where each character is 7 bits according to the 7-bit default alphabet. Eight-bit messages (max 140 characters) are usually not viewable by the phones as text messages; instead they are used for data in e.g. smart messaging (images and ringing tones) and OTA provisioning of WAP settings. 16-bit messages (max 70 characters) are used for Unicode (UCS2) text messages, viewable by most phones. A 16-bit text message of class 0 will on some phones appear as a Flash SMS (aka blinking SMS or alert SMS).

The PDU formatThere are two ways of sending and receiving SMS messages: by text mode and by PDU (protocol description unit) mode. The text mode (unavailable on some phones) is just an encoding of the bit stream represented by the PDU mode. Alphabets may differ and there are several encoding alternatives when displaying an SMS message. The most common options are "PCCP437", "PCDN", "8859-1", "IRA" and "GSM". These are all set by the at-command AT+CSCS, when you read the message in a computer application. If you read the message on your phone, the phone will choose a proper encoding. An application capable of reading incoming SMS messages, can thus use text mode or PDU mode. If text mode is used, the application is bound to (or limited by) the set of preset encoding options. In some cases, that's just not good enough. If PDU mode is used, any encoding can be implemented. Receiving a message in the PDU modeThe PDU string contains not only the message, but also a lot of meta-information about the sender, his SMS service center, the time stamp etc. It is all in the form of hexa-decimal octets or decimal semi-octets. The following string is what I received on a Nokia 6110 when sending the message containing "hellohello" from www.mtn.co.za. 07917283010010F5040BC87238880900F10000993092516195800AE8329BFD4697D9EC37

This octet sequence consists of three parts: An initial octet indicating the length of the SMSC information ("07"), the SMSC information itself ("917283010010F5"), and the SMS_DELIVER part (specified by ETSI in GSM 03.40).

Note: on some phones (e.g. Ericssson 888?) the first three (colored) parts are omitted when showing the message in PDU mode! Octet(s)Description07Length of the SMSC information (in this case 7 octets)91Type-of-address of the SMSC. (91 means international format of the phone number)72 83 01 00 10 F5Service center number(in decimal semi-octets). The length of the phone number is odd (11), so a trailing F has been added to form proper octets. The phone number of this service center is "+27381000015". See below.04First octet of this SMS-DELIVER message.0BAddress-Length. Length of the sender number (0B hex = 11 dec)C8Type-of-address of the sender number72 38 88 09 00 F1Sender number (decimal semi-octets), with a trailing F00TP-PID. Protocol identifier.00TP-DCS Data coding scheme99 30 92 51 61 95 80TP-SCTS. Time stamp (semi-octets)0ATP-UDL. User data length, length of message. The TP-DCS field indicated 7-bit data, so the length here is the number of septets (10). If the TP-DCS field were set to indicate 8-bit data or Unicode, the length would be the number of octets (9). E8329BFD4697D9EC37TP-UD. Message "hellohello" , 8-bit octets representing 7-bit data.

All the octets above are hexa-decimal 8-bit octets, except the Service center number, the sender number and the timestamp; they are decimal semi-octets. The message part in the end of the PDU string consists of hexa-decimal 8-bit octets, but these octets represent 7-bit data (see below).

The semi-octets are decimal, and e.g. the sender number is obtained by performing internal swapping within the semi-octets from "72 38 88 09 00 F1" to "27 83 88 90 00 1F". The length of the phone number is odd, so a proper octet sequence cannot be formed by this number. This is the reason why the trailing F has been added. The time stamp, when parsed, equals "99 03 29 15 16 59 08", where the 6 first characters represent date, the following 6 represents time, and the last two represents time-zone related to GMT.

Interpreting 8-bit octets as 7-bit messagesThis transformation is described in detail in GSM 03.38, and an example of the "hellohello" transformation is shown here. The transformation is based on the 7 bit default alphabet , but an application built on the PDU mode can use any character encoding.

Sending a message in the PDU modeThe following example shows how to send the message "hellohello" in the PDU mode from a Nokia 6110.

AT+CMGF=0 //Set PDU mode AT+CSMS=0 //Check if modem supports SMS commands AT+CMGS=23 //Send message, 23 octets (excluding the two initial zeros) >0011000B916407281553F80000AA0AE8329BFD4697D9EC37 There are 23 octets in this message (46 'characters'). The first octet ("00") doesn't count, it is only an indicator of the length of the SMSC information supplied (0). The PDU string consists of the following:Octet(s)Description 00 Length of SMSC information. Here the length is 0, which means that the SMSC stored in the phone should be used. Note: This octet is optional. On some phones this octet should be omitted! (Using the SMSC stored in phone is thus implicit) 11 First octet of the SMS-SUBMIT message. 00 TP-Message-Reference. The "00" value here lets the phone set the message reference number itself. 0B Address-Length. Length of phone number (11) 91 Type-of-Address. (91 indicates international format of the phone number). 6407281553F8 The phone number in semi octets (46708251358). The length of the phone number is odd (11), therefore a trailing F has been added, as if the phone number were "46708251358F". Using the unknown format (i.e. the Type-of-Address 81 instead of 91) would yield the phone number octet sequence 7080523185 (0708251358). Note that this has the length 10 (A), which is even. 00 TP-PID. Protocol identifier 00 TP-DCS. Data coding scheme.This message is coded according to the 7bit default alphabet. Having "04" instead of "00" here, would indicate that the TP-User-Data field of this message should be interpreted as 8bit rather than 7bit (used in e.g. smart messaging, OTA provisioning etc). AA TP-Validity-Period. "AA" means 4 days. Note: This octet is optional, see bits 4 and 3 of the first octet 0A TP-User-Data-Length. Length of message. The TP-DCS field indicated 7-bit data, so the length here is the number of septets (10). If the TP-DCS field were set to 8-bit data or Unicode, the length would be the number of octets. E8329BFD4697D9EC37 TP-User-Data. These octets represent the message "hellohello". How to do the transformation from 7bit septets into octets is shown here

The following table lists the AT commands that are related to the writing and sending of SMS messages:AT commandMeaning+CMGS Send message+CMSS Send message from storage+CMGW Write message to memory+CMGD Delete message+CMGC Send command+CMMS More messages to sendOne way to send AT commands to a mobile phone or GSM/GPRS modem is to use a terminal program. A terminal program's function is like this: It sends the characters you typed to the mobile phone or GSM/GPRS modem. It then displays the response it receives from the mobile phone or GSM/GPRS modem on the screen. The terminal program on Microsoft Windows is called HyperTerminal. More details about the use of Microsoft HyperTerminal can be found in the "How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem" section of this SMS tutorial.Below shows a simple example that demonstrates how to use AT commands and the HyperTerminal program of Microsoft Windows to send an SMS text message. The lines in bold type are the command lines that should be entered in HyperTerminal. The other lines are responses returned from the GSM / GPRS modem or mobile phone.ATOKAT+CMGF=1OKAT+CMGW="+85291234567"> A simple demo of SMS text messaging.+CMGW: 1

OKAT+CMSS=1+CMSS: 20

OK

Here is a description of what is done in the above example:

Line 1: "AT" is sent to the GSM / GPRS modem to test the connection. The GSM / GPRS modem sends back the result code "OK" (line 2), which means the connection between the HyperTerminal program and the GSM / GPRS modem works fine.

Line 3: The AT command +CMGF is used to instruct the GSM / GPRS modem to operate in SMS text mode. The result code "OK" is returned (line 4), which indicates the command line "AT+CMGF=1" has been executed successfully. If the result code "ERROR" is returned, it is likely that the GSM / GPRS modem does not support the SMS text mode. To confirm, type "AT+CMGF=?" in the HyperTerminal program. If the response is "+CMGF: (0,1)" (0=PDU mode and 1=text mode), then SMS text mode is supported. If the response is "+CMGF: (0)", then SMS text mode is not supported.

Line 5 and 6: The AT command +CMGW is used to write an SMS text message to the message storage of the GSM / GPRS modem. "+85291234567" is the recipient mobile phone number. After typing the recipient mobile phone number, you should press the Enter button of the keyboard. The GSM / GPRS modem will then return a prompt "> " and you can start typing the SMS text message "A simple demo of SMS text messaging.". When finished, press Ctrl+z of the keyboard.

Line 7: "+CMGW: 1" tells us that the index assigned to the SMS text message is 1. It indicates the location of the SMS text message in the message storage.

Line 9: The result code "OK" indicates the execution of the AT command +CMGW is successful.

Line 10: The AT command +CMSS is used to send the SMS text message from the message storage of the GSM / GPRS modem. "1" is the index of the SMS text message obtained from line 7.

Line 11: "+CMSS: 20" tells us that the reference number assigned to the SMS text message is 20.

Line 13: The result code "OK" indicates the execution of the AT command +CMSS is successfulSEND SMS:ketik AT+CMGS=081802003868lalu muncul >ketik pesennyadiselesaikan dengan ctrl+z

Check if your GSM phone or modem supports SMS text mode

To check if your modem supports this text mode, you can try the following command: AT+CMGF=1

If the modem reponds with "OK" this mode is supported. Please note that using this mode it is onluy possible to send simple text messages. It is not possible to send multipart, Unicode, data and other types of messages. Setting up the modem

If the modem contains a SIM card with is secured with a PIN code, we have to enter this pin code first: AT+CPIN="0000" (replace 0000 with your PIN code).

Please not that in most cases you have only 3 attemps to set the correct PIN code. After setting the PIN code, wait some seconds before issueing the next command to give the modem some time to register with the GSM network.

In order to send a SMS, the modem has to be put in SMS text mode first using the following command: AT+CMGF=1

In text mode there are some additional parameters that can be set. Using the following command we can read the current values: AT+CSMP?

The modem will reponse with a string like this: +CSMP: 1,169,0,0OK

The first value is a combination of some option bits: bit 7RPReply path, not used in text modebit 6UDHIUser Data Header Informationbit 5SRRSet this bit to request a delivery reportbit 3,4VPFValidity Period, set b4=1 if a VP value is presentbit 2RDReject Duplicates, do not return a message ID when a message with the same destination and ID is still pendingbit 0,1MTIMessage Type Indicatorb1=0 & b0=0 -> SMS-DELIVERb1=0 & b0=1 -> SMS-SUBMIT

Bit 0 of the message is always set when sending messages (SMS-SUBMIT). So the first value should be 1 or higher. The second parameter sets the Validity Period of the message. This value is encoded as follows: 0 - 143(VP + 1) x 5 minutes144 - 16712 Hours + ((VP-143) x 30 minutes)168 - 196(VP-166) x 1 day197 - 255(VP-192) x 1 week

The third parameter contains the PID (Protocol Identifier). This parameter is only used for advanced messaging. The fourth parameter contains the DCS (Data Coding Scheme). This parameter is used to select the characterset/messagetype. When setting the DCS parameter to '0' standard 7 bit text is send. When setting this parameter to '16' the message is sent as a flash message.

To send a message with a validity period of 1 day, the parameters have to be set like this:

Bit 0 and 4 of the first field has to be set, so the first value will become 1 + 16 = 17.

Send the following command to the modem to set this parameters: AT+CSMP=17,167,0,16

If the modem responds with "OK" ,the modem is ready to send (flash) text messages with a validity period of 1 day. Sending the message

To send the SMS message, type the following command: AT+CMGS="+31638740161"

Replace the above phone number with your own cell phone number. The modem will respond with: >

You can now type the message text and send the message using the - key combination: Hello World !

After some seconds the modem will respond with the message ID of the message, indicating that the message was sent correctly: +CMGS: 62

The message will arrive on the mobile phone shortly. Sending an Unicode SMS message

Some modems also have the capability to send Unicode or UCS2 messages without encoding a PDU. You can send Unicode messages by only converting the Unicode data to a HEX string and send this string to the modem.

To check whether your modem supports this mode, just type the following command:AT+CSCS=?

This commands displays the codepages supported by the modem. The modem will respond like this:+CSCS: ("GSM","PCCP437","CUSTOM","HEX")

If this string contains "HEX" or "UCS2", Unicode seems to be supported. To specify that you will use an HEX string to send the message, set the codepage to "HEX" or "UCS2" depending on the modem response. In our example we will set the modem to "HEX" : AT+CSCS="HEX"

Next, we have to specify the correct DCS (Data Coding Scheme) for Unicode messages, which is 0x08. We can set this value by changing the fourth parameter of the AT+CSMP command to '8': AT+CSMP=1,167,0,8

The modem is now ready to send messages as Unicode. Now is the time to send the actual message:AT+CMGS="+31638740161"

Replace the above phone number with your own cell phone number. The modem will respond with:>

The only thing you have to program by yourself, is a simple routine which converts the Unicode string to an hexidecimal string like this:

Which is 'Hello' in arabic will be converted like this:"06450631062D06280627"

You can send this hexidecimal string to the modem:06450631062D06280627

After some seconds the modem will respond with the message ID of the message, indicating that the message was sent correctly:+CMGS: 63

The message will arrive on the mobile phone shortly.

The 7 bit default alphabetThis is the 7 bit default alphabet as specified by GSM 03.38. The corresponding ISO-8859-1 decimal codes are shown in the rightmost column. Note that the euro sign () is a member of the ISO-8859-15 character set. HexDecCharacter nameCharacterISO-8859-1 DEC0x000COMMERCIAL AT@640x011POUND SIGN1630x022DOLLAR SIGN$360x033YEN SIGN1650x044LATIN SMALL LETTER E WITH GRAVE2320x055LATIN SMALL LETTER E WITH ACUTE2330x066LATIN SMALL LETTER U WITH GRAVE2490x077LATIN SMALL LETTER I WITH GRAVE2360x088LATIN SMALL LETTER O WITH GRAVE2420x099LATIN CAPITAL LETTER C WITH CEDILLA1990x0A10LINE FEED100x0B11LATIN CAPITAL LETTER O WITH STROKE2160x0C12LATIN SMALL LETTER O WITH STROKE2480x0D13CARRIAGE RETURN130x0E14LATIN CAPITAL LETTER A WITH RING ABOVE1970x0F15LATIN SMALL LETTER A WITH RING ABOVE2290x1016GREEK CAPITAL LETTER DELTA0x1117LOW LINE_950x1218GREEK CAPITAL LETTER PHI0x1319GREEK CAPITAL LETTER GAMMA0x1420GREEK CAPITAL LETTER LAMBDA0x1521GREEK CAPITAL LETTER OMEGA0x1622GREEK CAPITAL LETTER PI0x1723GREEK CAPITAL LETTER PSI0x1824GREEK CAPITAL LETTER SIGMA0x1925GREEK CAPITAL LETTER THETA0x1A26GREEK CAPITAL LETTER XI0x1B27ESCAPE TO EXTENSION TABLE 0x1B0A27 10FORM FEED120x1B1427 20CIRCUMFLEX ACCENT^940x1B2827 40LEFT CURLY BRACKET{1230x1B2927 41RIGHT CURLY BRACKET}1250x1B2F27 47REVERSE SOLIDUS (BACKSLASH)\920x1B3C27 60LEFT SQUARE BRACKET[910x1B3D27 61TILDE~1260x1B3E27 62RIGHT SQUARE BRACKET]930x1B4027 64VERTICAL BAR|1240x1B6527 101EURO SIGN164 (ISO-8859-15)0x1C28LATIN CAPITAL LETTER AE1980x1D29LATIN SMALL LETTER AE2300x1E30LATIN SMALL LETTER SHARP S (German)2230x1F31LATIN CAPITAL LETTER E WITH ACUTE2010x2032SPACE320x2133EXCLAMATION MARK!330x2234QUOTATION MARK"340x2335NUMBER SIGN#350x2436CURRENCY SIGN164 (ISO-8859-1)0x2537PERCENT SIGN%370x2638AMPERSAND&380x2739APOSTROPHE'390x2840LEFT PARENTHESIS(400x2941RIGHT PARENTHESIS)410x2A42ASTERISK*420x2B43PLUS SIGN+430x2C44COMMA,440x2D45HYPHEN-MINUS-450x2E46FULL STOP.460x2F47SOLIDUS (SLASH)/470x3048DIGIT ZERO0480x3149DIGIT ONE1490x3250DIGIT TWO2500x3351DIGIT THREE3510x3452DIGIT FOUR4520x3553DIGIT FIVE5530x3654DIGIT SIX6540x3755DIGIT SEVEN7550x3856DIGIT EIGHT8560x3957DIGIT NINE9570x3A58COLON:580x3B59SEMICOLON;590x3C60LESS-THAN SIGN620x3F63QUESTION MARK?630x4064INVERTED EXCLAMATION MARK1610x4165LATIN CAPITAL LETTER AA650x4266LATIN CAPITAL LETTER BB660x4367LATIN CAPITAL LETTER CC670x4468LATIN CAPITAL LETTER DD680x4569LATIN CAPITAL LETTER EE690x4670LATIN CAPITAL LETTER FF700x4771LATIN CAPITAL LETTER GG710x4872LATIN CAPITAL LETTER HH720x4973LATIN CAPITAL LETTER II730x4A74LATIN CAPITAL LETTER JJ740x4B75LATIN CAPITAL LETTER KK750x4C76LATIN CAPITAL LETTER LL760x4D77LATIN CAPITAL LETTER MM770x4E78LATIN CAPITAL LETTER NN780x4F79LATIN CAPITAL LETTER OO790x5080LATIN CAPITAL LETTER PP800x5181LATIN CAPITAL LETTER QQ810x5282LATIN CAPITAL LETTER RR820x5383LATIN CAPITAL LETTER SS830x5484LATIN CAPITAL LETTER TT840x5585LATIN CAPITAL LETTER UU850x5686LATIN CAPITAL LETTER VV860x5787LATIN CAPITAL LETTER WW870x5888LATIN CAPITAL LETTER XX880x5989LATIN CAPITAL LETTER YY890x5A90LATIN CAPITAL LETTER ZZ900x5B91LATIN CAPITAL LETTER A WITH DIAERESIS1960x5C92LATIN CAPITAL LETTER O WITH DIAERESIS2140x5D93LATIN CAPITAL LETTER N WITH TILDE2090x5E94LATIN CAPITAL LETTER U WITH DIAERESIS2200x5F95SECTION SIGN1670x6096INVERTED QUESTION MARK1910x6197LATIN SMALL LETTER Aa970x6298LATIN SMALL LETTER Bb980x6399LATIN SMALL LETTER Cc990x64100LATIN SMALL LETTER Dd1000x65101LATIN SMALL LETTER Ee1010x66102LATIN SMALL LETTER Ff1020x67103LATIN SMALL LETTER Gg1030x68104LATIN SMALL LETTER Hh1040x69105LATIN SMALL LETTER Ii1050x6A106LATIN SMALL LETTER Jj1060x6B107LATIN SMALL LETTER Kk1070x6C108LATIN SMALL LETTER Ll1080x6D109LATIN SMALL LETTER Mm1090x6E110LATIN SMALL LETTER Nn1100x6F111LATIN SMALL LETTER Oo1110x70112LATIN SMALL LETTER Pp1120x71113LATIN SMALL LETTER Qq1130x72114LATIN SMALL LETTER Rr1140x73115LATIN SMALL LETTER Ss1150x74116LATIN SMALL LETTER Tt1160x75117LATIN SMALL LETTER Uu1170x76118LATIN SMALL LETTER Vv1180x77119LATIN SMALL LETTER Ww1190x78120LATIN SMALL LETTER Xx1200x79121LATIN SMALL LETTER Yy1210x7A122LATIN SMALL LETTER Zz1220x7B123LATIN SMALL LETTER A WITH DIAERESIS2280x7C124LATIN SMALL LETTER O WITH DIAERESIS2460x7D125LATIN SMALL LETTER N WITH TILDE2410x7E126LATIN SMALL LETTER U WITH DIAERESIS2520x7F127LATIN SMALL LETTER A WITH GRAVE224

Komunikasi dengan handphone ini dilakukan melalui terminal yang ada di bagian bawah handphone seperti pada gambar diatas dan digunakan juga untuk menyambungkan charger baterai. Susunan pin pada terminal ini dapat dilihat dalam tabel dibawah ini.

Tabel Susunan pin terminal HP Siemens M35NoNamaFungsiIn/Out1GNDGround-2SELF SERVICERecognition / Battery ChargerIn/Out3LOADCharging VoltageIn4BATTERYBatteryOut5DATA OUTData SendOut6DATA INData ReceiveIn7Z_CLKRecognition / Control Accesoris-8Z_DATARecognition / Control Accesoris-9MICGGround for MicrophoneIn10MICMicrophone input-11AUDLoudspeaker outputOut12AUDGGround for Loudspeaker-

Untuk dapat berkomunikasi dengan handphone ini diperlukan koneksi serial dengan baudrate 19200 bps. Level tegangan yang digunakan adalah jenis TTL dengan logika high = + 3 Volt dan logika low = + 0 Volt. Kabel data khusus Handphone ini telah didesain khusus untuk mengubah level tegangan RS 232 ke level tegangan TTL khusus siemens M35. Tabel dibawah ini menunjukkan perbandingan level tegangan RS 232 dengan level tegangan TTL Siemens M35.

RS232 sebagai komunikasi serial mempunyai 9 pin yang memiliki fungsi masing-masing. Pin yang biasa digunakan adalah pin 2 sebagai received data, pin 3 sebagai transmited data, dan pin 5 sebagai ground signal.

Rangkaian Komunikasi Serial RS232

Rangkaian komunikasi ini berfungsi untuk menjembatani level tegangan RS232 dari kabel handphone ke level tegangan TTL pada mikrokontroler. Komponen utamanya berupa IC MAX232 yang mampu untuk mengkonversi level

Tegangan dari RS232 ke level tegangan TTL atau CMOS dengan kecepatan mencapai 30 bit/uS atau setara dengan 30 Kb per detik. Konektor yang digunakan bertipe DB9 dengan konfigurasi seperti pada gambar diatas. Pin TX dan RX pada MAX232 dihubungkan secara silang pada mikrokontroler yaitu pin TX MAX232 dengan pin RX pada mikrokontroler dan pin RX MAX232 dihubungkan dengan pin TX mikrokontroler.

KONEKSI KOMUNIKASI SERIAL DENGAN KOMPUTER

Aplikasi port serial mikrokontroller dapat diuji dengan mengkoneksikan antara sistem mikrokontroller dengan komputer atau handphone siemens melalui port serial komputer (COM1 atau COM2). Untuk berkomunikasi dengan sistem mikrokontroller, komputer membutuhkan program yang dapat dibuat sendiri atau menggunakan program yang telah ada. Program yang telah ada hanya bersifat terminal aja yaitu

Hyperterminal (yang terdapat pada Start -> All Program -> Accessories -> Communications -> Hyperterminal.)

Contoh penyetingan COM pada komputer:

Untuk cara lengkap penyetingan COM dapat didownload disini.

Dan contoh program komunikasi serial HP Siemens type M/C/S 35 menggunakan BASCOM-AVR

AVR ATMega8535 memiliki 4 buah register I/O yang berkaitan dengan komunikasi memakai UART, yaitu UART I/O Data Register (UDR), UART Baud Rate Register (UBRR), UART Status Register (USR) dan UART Control Register (UCR). Maka dari itu register- register tersebut harus di othak- athik sampe terjalin komunikasi melalui port serial. Ngga gampang lho maka kamu harus mulai berpikir gimana caranya hahahaha. Kalo dah bisa tolong hubungi no 08x xx2 x5x x0x. Dengan fasilitas ini kita bisa menjalinkan komunikasi antar dua micro, ato micro Vs komputer, ato bisa juga yang laen. Tenang saja pakde BASCOM dah ngasi solusi yang ga ribet, karena cukup satu kata yang terucap kemudian ditulis, dah bisa yang namanya komunikasi lewat port serial.

PEMROGRAMAN MENGIRIM DATA

PEMROGRAMAN TERIMA DATA