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,699 次查看
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,228 次查看
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,229 次查看
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,228 次查看
Monica
Senior Contributor III

Thanks for sharing with us, Chandra!

Keep up with the hard work.

Best,

Monica.