Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help in PDU to TEXt mode conversion

Status
Not open for further replies.

akvii

Member level 5
Joined
Nov 4, 2006
Messages
91
Helped
13
Reputation
26
Reaction score
10
Trophy points
1,288
Activity points
1,849
pdu to text

I am interfacing PIC18f458 with Siemens SL55.My aim is to send and receive SMS throuh Microcontroller,the only problem I am facing is to convert PDU to text or vice versa.I will be very greatful if someone help me by telling me algo to switch the above modes
 

pdu to text converter

Send
AT+CMGF=?
to your SL55, if the answer is
AT+CMGF=(0,1)
it mean SL55 can handle ASCII tesxt message as well as conventialnal PDU message format. At this case your don't need convert PDU to text or vice versa.
 

convert pdu to text

if you are interested in pic basic pro, shud be :

Code:
;-----CONVERSION ROUTINES-------
;---TXT2PDU--(sms_encoding)-----
TXT2PDU:
tmp(1)=char(1) << 7 
tmp(2)=char(2) << 6 
tmp(3)=char(3) << 5 
tmp(4)=char(4) << 4 
tmp(5)=char(5) << 3 
tmp(6)=char(6) << 2 
tmp(7)=char(7) << 1

ch(0)=chaR(0)                  
ch(1)=chaR(1) >> 1 
ch(2)=chaR(2) >> 2 
ch(3)=chaR(3) >> 3 
ch(4)=chaR(4) >> 4 
ch(5)=chaR(5) >> 5 
ch(6)=chaR(6) >> 6 
                      
pdu(0)=tmp(1) + ch(0)
pdu(1)=tmp(2) + ch(1)
pdu(2)=tmp(3) + ch(2)
pdu(3)=tmp(4) + ch(3)
pdu(4)=tmp(5) + ch(4)
pdu(5)=tmp(6) + ch(5)
pdu(6)=tmp(7) + ch(6)
Return

;---PDU2TXT--(sms_decoding)---
PDU2TXT:
tmp(0)=pdu(0) >> 7 
tmp(1)=pdu(1) >> 6 
tmp(2)=pdu(2) >> 5 
tmp(3)=pdu(3) >> 4 
tmp(4)=pdu(4) >> 3 
tmp(5)=pdu(5) >> 2 
tmp(6)=pdu(6) >> 1 

ch(0)=pdu(0) & $7f                  
ch(1)=pdu(1) & $3f:CH(1)=CH(1) << 1 
ch(2)=pdu(2) & $1f:CH(2)=CH(2) << 2 
ch(3)=pdu(3) & $0f:CH(3)=CH(3) << 3  
ch(4)=pdu(4) & $07:CH(4)=CH(4) << 4  
ch(5)=pdu(5) & $03:CH(5)=CH(5) << 5  
ch(6)=pdu(6) & $01:CH(6)=CH(6) << 6  

char(0)=ch(0)
char(1)=ch(1) + tmp(0)
char(2)=ch(2) + tmp(1)
char(3)=ch(3) + tmp(2)
char(4)=ch(4) + tmp(3)
char(5)=ch(5) + tmp(4)
char(6)=ch(6) + tmp(5)
char(7)=tmp(6) 
Return
End

but i'm trying to do somethin with nokia 3410 in pbp, and i didn't found someone has done it...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top