i use pic18f252 to send sms with sim 508, i use MicroC Pro, hopefully help your project:
//===================================================== send sms
void Send_sms()
{
unsigned char sms_send_ok;
RCSTA.CREN=1;
putst_sim548("AT+CMGF=1"); //send sms with text mode
Delay_ms(50);
putst_sim548("AT+CSCS=\"GSM\""); //text mode = GSM alphabet
Delay_ms(50);
putst_sim548("AT+CMGD=1"); //clear sms in sim store
Delay_ms(50);
SendString_NoCR("AT+CMGS=\""); //type phone number send data withuot CR
SendString_NoCR(str_number); //your phone number
SendString_NoCR("\"");
putch_232(0x0D);
if (sim548_buf[0]==0x0A);SendString_NoCR_WithLengh(tx_buf,TX_SIZE); //send data without CR and the lengh is determined
putch_232(0x1A); //ctrl+Z
//putch_232(0x1B); //ESC
Delay_ms(50);
}