Tc275 asclin uart

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

cross mob
User18735
Level 2
Level 2
10 replies posted 5 replies posted First reply posted
Hi all!

Does anyone has knowledge that how we can implement Aurix code examples for TC298 to TC275 applications.
https://github.com/Infineon/AURIX_code_examples/tree/master/code_examples

I am using ASCLIN_UART_1, UART_VCOM_1 examplesfor TC298 in TC275 to test but I don't get any errors as well as results.
I also modify the external device using pin mapping for my shield buddy.

Thanking you!!

Regards,
Neeraj
0 Likes
18 Replies
User18504
Level 3
Level 3
Try to use AURIX Development IDE, import the Example, then make a new project for your specific board, then copy the source files from the Example to your project.
Worked for me to run examples that are made for TC299 to my TC277 Eval Board.
0 Likes
User18735
Level 2
Level 2
10 replies posted 5 replies posted First reply posted
Hi bbogdanmircea,

Thanks for the reply. I did the exact same thing that worked for an GPIO_Button_1 example i.e. to switch on/off LED using a button.
But now, I am using ASCLIN module. The program is not giving any error and it doesn't provide anything i.e. in UART_VCOM_1 example. I do the same as above mentioned importing example and making new project for TC275 and copying *.c and *.h and modifying cpu0_main.c file.
As a result, it build successfully without errors but in run it doesn't write in my serial monitor with the specified baudrate for the example
Do you know how to implement UART in TC275 or TC277 Eval Board?

Regards,
Neeraj
0 Likes
User18504
Level 3
Level 3
Maybe the example does not actually write anything to serial, just using some type of loopback?
Which example are you using, there are more USART examples, I can try on my Evaluation Board to see what it does exactly.
I don't know the details of implementation, but all the examples that I run on my board worked ok, so I guess this should also work, only that probably it is more
difficult to see exactly what it does.

Did you check with oscilloscope according to the pdf: https://www.infineon.com/aurix-expert-training/Infineon-AURIX_ASCLIN_UART_1-TR-v01_00_00-EN.pdf

Now I see you are using UART_VCOM_1 Example, maybe you have some connection problem, this worked on my TFT board also.
The example prints Hello World only once, so you must first open PUTTY and then press PORST and the message will appear everytime you press it.
0 Likes
User18735
Level 2
Level 2
10 replies posted 5 replies posted First reply posted
Hi bbogdanmircea,

The example should write "Hello World!" on the serial monitor - Hterm/Putty as mentioned in the application notes. https://www.infineon.com/dgdl/Infineon-AURIX_UART_VCOM_1-Training-v01_00-EN.pdf?fileId=5546d4626e41e...
I am using UART_VCOM_! example is here https://github.com/Infineon/AURIX_code_examples/tree/master/code_examples/UART_VCOM_1.

The program structure is easy to understand:-
1. Defining RX/TX PIN of the board.
2. Providing constants SERIAL_BAUDRATE, IFX_INTPRIO_ASCLIN0_TX(TX int priority) and TX_BUFFER_SIZE.
3. IfxAsclin_Asc_initModuleConfig will set UART with default parameters.
4. Modify UART with user values.
5. IfxAsclin_Asc_initModule initialise UART for functioning.
6. Last, when there is data to transmit interrupt occurs and it transmits "Hello World!".

It would be helpful if you can have a look or try on your Eval Board. As example will remain same.

Regards,
Neeraj
0 Likes
User18504
Level 3
Level 3
I just tried it and it works on my TC277 TFT board.
I even moved the send UART to the endless loop so it prints every 1s and it works.

while(1)
{
send_UART_message(); /* Send the message "Hello World!" */
waitTime(TimeConst_100ms);
waitTime(TimeConst_100ms);
waitTime(TimeConst_100ms);
waitTime(TimeConst_100ms);
waitTime(TimeConst_100ms);
waitTime(TimeConst_100ms);
waitTime(TimeConst_100ms);
waitTime(TimeConst_100ms);
waitTime(TimeConst_100ms);
waitTime(TimeConst_100ms);
}
return (1);

So either your PUTTY settings are wrong, either your board does not have the right connection between the serial line and the USB port, but as you can flash probably it is ok?
0 Likes
User18735
Level 2
Level 2
10 replies posted 5 replies posted First reply posted
Hi bbogdanmircea,

Which ports/pins are you selecting for your serial line, baudrate=19200bps, USB port for the microcontroller is only one not like 2 COM ports i.e one for UART and one for programming.
Do you also face some syntax error in program with IFX_INTERRUPT?

And How do you flash your code to microcontroller? I just build the project and start debugger and then execute it.

Regards,
Neeraj
0 Likes
User18504
Level 3
Level 3
In AURIX Development Studio:
-Build Project
-Debug as -Debug Configurations and Add new configuration under TASKING C/C++ Debugger, then Debug, it automatically flashes and then you can step through the
step through the code or just run it

Have you already tried other examples on your board that you can easier check that work correctly, like led blinking ones?
0 Likes
User18735
Level 2
Level 2
10 replies posted 5 replies posted First reply posted
Hi bbogdanmircea,

I have already tried an example for GPIO_Button_1 i.e when button pressed turn LED on/off that worked.
Okay then flashing is same.

and
Which ports/pins are you selecting for your serial line, baudrate=19200bps, USB port for the microcontroller is only one not like 2 COM ports i.e one for UART and one for programming.
Do you also face some syntax error in program with IFX_INTERRUPT?

Regards,
Neeraj
0 Likes
User18504
Level 3
Level 3
Yes there is syntax error for IFX_INTERRUPT
I did not do any modification for USB port, just Debug with the default settings.
0 Likes
User18735
Level 2
Level 2
10 replies posted 5 replies posted First reply posted
Are you changing your TX and RX pins?
0 Likes
User18735
Level 2
Level 2
10 replies posted 5 replies posted First reply posted
Are you changing your TX/RX pins
0 Likes
User18504
Level 3
Level 3
No, I did not do anything, just made a new AURIX project for my TC277 TFT STEP D board, copied the files from the UART example, Build and Debug.
Did you check the schematic of your board to see how the pins are connected?
0 Likes
User18735
Level 2
Level 2
10 replies posted 5 replies posted First reply posted
I have checked for Shield Buddy User Manual Serial connections. Also, when I check for Register in Debug TXDATA and RXDATA is 0x0.
0 Likes
User18735
Level 2
Level 2
10 replies posted 5 replies posted First reply posted
Hi bbogdanmircea,

The problem is resolved now.

My board has 4 Serial communication pairs(Rx/Tx) and one of them is connected via USB. Now, I can print "Hello World!" on the Serial Monitor.
This was the issue between serial line and USB port which I found in Shieldbuddy user manual.

Apart from this I also tested the Tx pins with oscilloscope to see, if the UART is transmitting data or not. It was also working correctly.

Thanks!!


Regards,
Neeraj
0 Likes
User18504
Level 3
Level 3
I am happy that it worked for you.
But to be honest I do not quite understand what the problem was and how you solved it.
So where the UART pins not connected to USB, so you had to see them with oscilloscope?
And it this case how were you able to see the data sent on UART?
0 Likes
User18735
Level 2
Level 2
10 replies posted 5 replies posted First reply posted
Hi bbogdanmircea,

The problem was my board has 4 Serial communication (Rx/Tx) pair and out of them one is provided with usb support.
3968.attach


Now, I initialize these pins for UART. Then, I can print "Hello World!" on the Serial Monitor.

As I was not able to see the message on Serial monitor I tried the oscilloscope example to see the transmitted signal on oscilloscope and connecting oscilloscope to other pins as external peripheral device.
https://www.infineon.com/dgdl/Infineon-AURIX_ASCLIN_UART_1-Training-v01_00-EN.pdf?fileId=5546d4626df...

Thanks!!


Regards,
Neeraj
0 Likes
User18504
Level 3
Level 3
So you reconfigured in the code the pins to P15.7 and P32.2 and then it worked?
0 Likes
User18735
Level 2
Level 2
10 replies posted 5 replies posted First reply posted
Yes! That is how it worked to check transmitted message on H-Term or PUTTY
0 Likes