Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
RaBa_2451646
Level 2
Level 2
10 sign-ins 5 sign-ins 5 replies posted

Hello,

I am working on Cypress CY8CKIT-059, I want to use UART for serial communication with my laptop and want to use it to write AT commands to my Modem simultaneously. Is it possible to do that? as in pin configuration it shows only Pin 20 and 21 for UART(RX-TX).

Is there any other UART pair also available so that I can communicate the kit with my laptop as well as with the modem?

Or some other way for the debugging possible.?

Thanks & Regards,

Rajat bandejiya

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

We can have multiple UART modules in a project.

So I entered one for UART (to PC) and another for Modem, which I set the baud rate to 9600 just to be different.

002-schematic.JPG

I assigned pins like

003-Pin.JPG

Instead of a modem, which I don't have, I connected a USB-Serial interface to the P1[7], P1[6] and GND.

IMG_3376.JPG

With the following program

=================

#include "project.h"

#include <stdio.h>

char str[128] ; /* print buffer */

int main(void)

{

    int count = 0 ;

    int uart_count = 0 ;

    int modem_count = 0 ;

  

    CyGlobalIntEnable; /* Enable global interrupts. */

    UART_Start() ;

    MODEM_Start() ;

  

    sprintf(str, "UART/Modem Test (%s %s)\r\n", __DATE__, __TIME__) ;

    UART_PutString(str) ;

    CyDelay(10) ;

  

    sprintf(str, "MODEM: I'm a modem!\r\n") ;

    MODEM_PutString(str) ;

    CyDelay(10) ;

    for(;;)

    {

        if ((count % 4) == 0) {

            sprintf(str, "UART %d\r\n", uart_count++) ;

            UART_PutString(str) ;

            CyDelay(10) ;

        }

        if ((count % 3) == 0) {

            sprintf(str, "Modem %d\r\n", modem_count++) ;

            MODEM_PutString(str) ;

            CyDelay(10) ;

        }

        CyDelay(1000) ;

    }

}

=================

On my PC TeraTerms showed

TeraTerm 1 (115200 baud)

000-UART.JPG

TeraTerm 2 (9600 baud)

001-MODEM.JPG

So, I hope that you can control modem with similar configuration.

moto

View solution in original post

0 Likes
2 Replies
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello Rajat,

You can use pins 20 and 21 (P12_6 and P12_7) of the CY8CKIT-059 for communication with the laptop. In this case the KitProg on the PsoC 5 kit acts as USB-UART Bridge. For communication with modem you can use any other pin and then connect the rx and tx of modem to those pins.

Thanks

Ekta

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

We can have multiple UART modules in a project.

So I entered one for UART (to PC) and another for Modem, which I set the baud rate to 9600 just to be different.

002-schematic.JPG

I assigned pins like

003-Pin.JPG

Instead of a modem, which I don't have, I connected a USB-Serial interface to the P1[7], P1[6] and GND.

IMG_3376.JPG

With the following program

=================

#include "project.h"

#include <stdio.h>

char str[128] ; /* print buffer */

int main(void)

{

    int count = 0 ;

    int uart_count = 0 ;

    int modem_count = 0 ;

  

    CyGlobalIntEnable; /* Enable global interrupts. */

    UART_Start() ;

    MODEM_Start() ;

  

    sprintf(str, "UART/Modem Test (%s %s)\r\n", __DATE__, __TIME__) ;

    UART_PutString(str) ;

    CyDelay(10) ;

  

    sprintf(str, "MODEM: I'm a modem!\r\n") ;

    MODEM_PutString(str) ;

    CyDelay(10) ;

    for(;;)

    {

        if ((count % 4) == 0) {

            sprintf(str, "UART %d\r\n", uart_count++) ;

            UART_PutString(str) ;

            CyDelay(10) ;

        }

        if ((count % 3) == 0) {

            sprintf(str, "Modem %d\r\n", modem_count++) ;

            MODEM_PutString(str) ;

            CyDelay(10) ;

        }

        CyDelay(1000) ;

    }

}

=================

On my PC TeraTerms showed

TeraTerm 1 (115200 baud)

000-UART.JPG

TeraTerm 2 (9600 baud)

001-MODEM.JPG

So, I hope that you can control modem with similar configuration.

moto

0 Likes