cancel
Showing results for 
Search instead for 
Did you mean: 

USART2 problem

yogee00
Associate II
Posted on May 02, 2013 at 19:16

The original post was too long to process during our migration. Please click on the attachment to read the original post.
16 REPLIES 16
Posted on May 03, 2013 at 13:53

This is probably one of the libraries where you need to contact ST directly, via rep or FAE, and request it.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
xtian
Associate II
Posted on May 06, 2013 at 14:46

Hi you may try somethings like this...

this may not yet be so efficient.. im still in a stage of embracing C.. I accept corrections and tweaks suggestions on the code below..

char SendMessageTO[23] = ''AT+CMGS=�?+6329425718276�?;

char SendMessageMESSAGE[150] = '' THIS IS A SAMPLE MESSAGE '';

uint8 DATA[173];

#define CR 13

#define LF 10

sendMessage(SendMessageTO, SendMessageMESSAGE);

void sendMessage(char header[23], char message[150])

{

for (int ctr=0;ctr<23;ctr++)

{

USART_SendData(USART1,(int)header[ctr] );  Delay(10); 

}

USART_SendData(USART1,CR); Delay(10);

USART_SendData(USART1,LF);  Delay(10);

Delay(1000);

for (int ctr=0;ctr<150;ctr++)

{

USART_SendData(USART1,(int) message[ctr] );

}

USART_SendData(USART1,CR);

USART_SendData(USART1,LF);

}

void Delay(__IO uint32_t nCount) //in millisecond

{

nCount = nCount * 5940 *2;//381;

while(nCount--)

{

}

}

xtian
Associate II
Posted on May 06, 2013 at 14:55

www.simcom.us/act_admin/supportfile/SIM340_ATC_V1.00.pdf

+CMTI:�?SM�?,7

messaged arrived at index 7 of sim. you can read it by

AT+CMGR=7

Posted on May 06, 2013 at 15:37

Yeah, I'd probably look to using strlen(), and waiting on TXE before sending each byte, arbitrary delays are something you want to avoid.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
xtian
Associate II
Posted on May 06, 2013 at 15:46

That's Clive... I'll work on that next time:) thanks

lakhe
Associate
Posted on September 27, 2013 at 09:31

Where can we contact ST for requesting this library?

Posted on September 27, 2013 at 13:55

Where can we contact ST for requesting this library?

Try your local ST rep or FAE, or the support request page on the web site.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..