Abdulmajeed
Newbie level 3
usart_read_text
hey guyz...
i'm interfacing a GSM modem (seimens gsm35) with a PIC16F877.. connected the modem to the USART bus of PIC... i need to send an sms from my gsm.. i wrote this code in microbasic but there's a couple of stuff that i'm not sure about... would you please check my code:
1- how do i send the CR character? did i handle it correctly with Chr(13)+Chr(10)??
2- in the CMGS command i'm supposed to put the destination in qoutes"" how do i send these???!!!
3- after typing the message code i'm supposed to click CTRL+Z, how do i do this serially from the PIC?!!!
4- assuming constant baud rate should i initiate the USART baud rate to the same baud rate of the GSM?? and plz help me with the AT command that initiates a constant baud rate??
i'm running out of time.. any help appreciated guyz...
regards...[/code]
hey guyz...
i'm interfacing a GSM modem (seimens gsm35) with a PIC16F877.. connected the modem to the USART bus of PIC... i need to send an sms from my gsm.. i wrote this code in microbasic but there's a couple of stuff that i'm not sure about... would you please check my code:
Code:
program USART_Test
main:
PORTC = 0 'initialize port C
TRISC = $D0 'configure port C bits
SPBRG = 25
TXSTA = $24
RCSTA = $90
Usart_Init(19200) ' Initialize USART module
Usart_Write_Text("AT+CMGF=1" + Chr(13) + Chr(10))
Usart_Write_Text("AT+CMGS="+962796626060"" + Chr(13) + Chr(10))
Usart_Write_Text("hello!!")
end.
1- how do i send the CR character? did i handle it correctly with Chr(13)+Chr(10)??
2- in the CMGS command i'm supposed to put the destination in qoutes"" how do i send these???!!!
3- after typing the message code i'm supposed to click CTRL+Z, how do i do this serially from the PIC?!!!
4- assuming constant baud rate should i initiate the USART baud rate to the same baud rate of the GSM?? and plz help me with the AT command that initiates a constant baud rate??
i'm running out of time.. any help appreciated guyz...
regards...[/code]