Skip to main content
cyril2399
Associate III
August 17, 2011
Question

Usart send more than one character

  • August 17, 2011
  • 14 replies
  • 3407 views
Posted on August 17, 2011 at 10:39

Hello,

I saw that in usart.c there is the function   USART_SendData(USART2, 'a');

but this is for only one character (here 'a').

I want to send more than one character but I can't find how.

I think that USART_SendData(USART2, 'hello'); won't work.

Coud anyone help me please?

Thanks
    This topic has been closed for replies.

    14 replies

    trevor23
    Associate III
    March 25, 2014
    Posted on March 25, 2014 at 11:38

    No, no, no. x is passed by value (not by reference) and so is local and therefore will not change the origional x.

    raissateke
    Associate
    September 29, 2014
    Posted on September 29, 2014 at 17:20

    Hello ther

    SendData (USART, �? AT�?); and i receive OK on my hyperterminal, but when i send 2 commands i only receive 1 OK instead of 2, eventhough my delay is long.

    do you know why?

    secondly, why do i have to to press the reset button to print the sent data on the hyperterminal? is it not better if it prints automatically?

    and lastly, how do i enable the ouput pins of my stm32F4 with Sms?

    thank you. Im looking forward to read you

    Sorry i didnt managed to create a new thread

    Tesla DeLorean
    Guru
    September 29, 2014
    Posted on September 29, 2014 at 18:19

    Perhaps because the modem expects a CR,LF pair (Carriage Return, Line Feed)?

    Yeah, I have no real idea what you're doing or how.

    I guess you'd talk to the modem using it's documented command set, extract and parse the SMS message data, and act upon it using functionality you program? This would require a reasonable mastery of C programming.
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    megahercas6
    Associate III
    September 29, 2014
    Posted on September 29, 2014 at 23:26

    in stm32f4xx.h set correcr hse value, same apply for system_config.c

    If in stm32f4xx.h hse is incorrect, you will get bad boud rate