Modify TC397 Triboard ASCLIN from ASCLIN0(p14.0, p14.1) to ASCLIN1(p15.0, p15.1) TX output data endlessly?

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

cross mob
avatar
Level 3
Level 3
First like received 10 replies posted 25 sign-ins

Dear SIR,

There is a demo code "AsclinShellInterface" under package iLLD_1_0_1_12_1__TC3xx_Demos.

P14.0 is configured to ASCLIN0_TX and P14.1 is configured to ASCLIN0_RX, and it output TX data via USB connector. It is OK.

I have modified ASCLIN0 to ASCLIN1, p15.0 for ASCLIN1_TX and p15.1 for ASCLIN1_RX.

Here are what I have modified

1. Modify initModuleConfig to MODULE_ASCLIN1, IfxAsclin_Asc_initModuleConfig(&config, &MODULE_ASCLIN1);

2. Change the pin to P15.0 for TX and P15.1 for RX in structure "IfxAsclin_Asc_Pins "

3. I keep the ISR vector table same as ASCLIN0

I use a UART-to-USB board to transfer P15.0(ASCLIN1_TX) to PC, the voltage is 5V which is workable for UART-to-USB board.

But it will continuous output the data on PC terminal, refer attached picture

How to make it work normally like default UART output? Did I missing something.?

Thanks. 

 

Code diff are below

  

--- a/01-AsclinShellInterface_TC39B2/0_Src/AppSw/Tricore/Demo_Illd/AsclinShellInterface.c
+++ b/01-AsclinShellInterface_TC39B2/0_Src/AppSw/Tricore/Demo_Illd/AsclinShellInterface.c
@@ -81,6 +81,7 @@
" A command followed by a question mark '?' will"ENDL \
" show the command syntax"

+#define ADLINK_UART_PIN15 1
/******************************************************************************/
/*--------------------------------Enumerations--------------------------------*/
/******************************************************************************/
@@ -291,7 +292,11 @@ void initSerialInterface(void)
{
{ /** - Serial interface */
IfxAsclin_Asc_Config config;
+#if (ADLINK_UART_PIN15 == 1)
+ IfxAsclin_Asc_initModuleConfig(&config, &MODULE_ASCLIN1);
+#else
IfxAsclin_Asc_initModuleConfig(&config, &MODULE_ASCLIN0);
+#endif
config.baudrate.baudrate = CFG_ASC_BAUDRATE;
config.baudrate.oversampling = IfxAsclin_OversamplingFactor_16;
config.bitTiming.medianFilter = IfxAsclin_SamplesPerBit_three;
@@ -303,11 +308,19 @@ void initSerialInterface(void)
IfxAsclin_Asc_Pins ascPins = {
.cts = NULL_PTR,
.ctsMode = IfxPort_InputMode_noPullDevice,
- .rx = &IfxAsclin0_RXA_P14_1_IN,
+#if (ADLINK_UART_PIN15 == 1)
+ .rx = &IfxAsclin1_RXA_P15_1_IN,
+#else
+ .rx = &IfxAsclin0_RXA_P14_1_IN,
+#endif
.rxMode = IfxPort_InputMode_noPullDevice,
.rts = NULL_PTR,
.rtsMode = IfxPort_OutputMode_pushPull,
- .tx = &IfxAsclin0_TX_P14_0_OUT,
+#if (ADLINK_UART_PIN15 == 1)
+ .tx = &IfxAsclin1_TX_P15_0_OUT,
+#else
+ .tx = &IfxAsclin0_TX_P14_0_OUT,
+#endif
.txMode = IfxPort_OutputMode_pushPull,
.pinDriver = IfxPort_PadDriver_cmosAutomotiveSpeed1
};

0 Likes
1 Solution
avatar
Level 3
Level 3
First like received 10 replies posted 25 sign-ins

Dear SIR,

 

ASCLIN1_TX(P15.0) will output data endlessly if ASCLIN1_RX(P15.1) if floating.

It is weird that this issue vanishes if ASCLIN1_RX is connected to UART-to-USB, I do NOT know why? Can anyone help?

Thanks.

View solution in original post

0 Likes
2 Replies
avatar
Level 3
Level 3
First like received 10 replies posted 25 sign-ins

Dear SIR,

 

ASCLIN1_TX(P15.0) will output data endlessly if ASCLIN1_RX(P15.1) if floating.

It is weird that this issue vanishes if ASCLIN1_RX is connected to UART-to-USB, I do NOT know why? Can anyone help?

Thanks.

0 Likes
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

Hi, if receive a normal character, the console will output. Below is the code. Looks like the floating trigger a receive.

 

            /* If this was a normal key press (not part of an escape sequence),
             * add it to the command string */
            if (NormalKeyPress != FALSE)
            {
                /* Ensure state machine is reset */
                shell->locals.cmdState = IFX_SHELL_CMD_STATE_NORMAL;

                /* If not filled buffer, add in this character */
                if (Cmd->length < (IFX_CFG_SHELL_CMD_LINE_SIZE - 1))
                {
                    /* Command line has been modified */
                    Cmd->historyAdd = TRUE;

                    /* Copy into command line */
                    cmdStr[Cmd->cursor] = inputbuffer[i];
                    Cmd->cursor++;

                    /* Update length of buffer */
                    Cmd->length = __max(Cmd->length, Cmd->cursor);

                    if (shell->control.echo != 0)
                    {
                        /* echo character to shell output if requested */
                        shell->locals.echo[0] = inputbuffer[i];
                        IfxStdIf_DPipe_print(shell->io, shell->locals.echo);
                    }
                }