setting uart baud rate... to connect to a modem and get PPP connection using K60

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

setting uart baud rate... to connect to a modem and get PPP connection using K60

ソリューションへジャンプ
2,692件の閲覧回数
chandrasekarkan
Contributor III

Hi ....

            I have a custom K60 board, UART2 has been interfaced to a GSM modem. I have enabled "ttyc:" in the user config so the device has got installed in the queue.

I want it to operate in "NON_BLOCKING" mode with no ECHO.  When I try to write a string Eg: "AT" on the port it only sends the First byte 'A'.


Also my  ioctl "GET_BAUD" gives me "536845072" as baud rate... what should I do to correct this...

User Config:

#define BSPCFG_ENABLE_TTYC  1

here is my code

MQX_FILE_PTR  

modemPortFp=NULL;

modemPortFp = fopen(MODEM_PORT, NULL);

    if( modemPortFp != NULL)

    {

   printf("\nUART 2 Init success !\n");

    }

    else

   printf("\nUART 2 Init Failed !\n");
uartParams = 0;

    if(ioctl(modemPortFp, IO_IOCTL_SERIAL_GET_BAUD, &uartParams) != 0)

   printf("\nIoctl call to Get Baud failed!");

    else

   printf("\nDefault Baud = %i", &uartParams);

************************************************************************************************************************

on console I see "Default Baud = 536845072"

ラベル(1)
タグ(4)
1 解決策
2,221件の閲覧回数
chandrasekarkan
Contributor III

Enabled "ITTYC" in user_config.h and changed fopen("ttyc:", NULL) to fopen("ittyc", NULL)... this did the trick for me...

Now I am able to communicate with modem and get valid response for AT commands

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
2,222件の閲覧回数
chandrasekarkan
Contributor III

Enabled "ITTYC" in user_config.h and changed fopen("ttyc:", NULL) to fopen("ittyc", NULL)... this did the trick for me...

Now I am able to communicate with modem and get valid response for AT commands

0 件の賞賛
返信
2,221件の閲覧回数
Monica
Senior Contributor III

Thanks for sharing with us, Chandra!

Keep up with the hard work.

Best,

Monica.