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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
1,550 Views
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"

Labels (1)
Tags (4)
1 Solution
1,079 Views
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

View solution in original post

0 Kudos
2 Replies
1,080 Views
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 Kudos
1,079 Views
Monica
Senior Contributor III

Thanks for sharing with us, Chandra!

Keep up with the hard work.

Best,

Monica.