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

cross mob
mi6kata
Level 1
Level 1
5 sign-ins First reply posted First question asked

Hello! I just purchased a TC375 Shieldbuddy and I am pleased with the Aurix development studio and the debugging system. However I tried to the ADC_SingleChannel example code from  https://github.com/Infineon/AURIX_code_examples/tree/master/code_examples/ADC_Single_Channel_1_KIT_T... and used the example meant for TC375 Lite Kit, because there isn't one specified for the ShieldBuddy and without changing anything, except printing the result using printf, the results that i receive the number "-2147479555" or a number close to it as "-2147479556", even when i am applying voltage to the A0 analog pin on the shiledbuddy. Can anyone help with this problem. Thank you for your time!

0 Likes
1 Solution
Meet_T
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

Hi,

Can you please let us know what variable are you printing to see the result, because if you are printing g_result then it doesn't only contain bits for actual conversion result but also has some additional bits which make up the entire variable. Hence when printing the signed value of the g_result might be something like -2147479556. If you are interested in just conversion value then you should only refer to first 16-bit of hexadecimal value of g_result, for example -2147479556 in hexadecimal would be FFFF FFFF 8000 0FFC, so the last 16-bit meaning 0x0FFC would be the actual conversion value.

You can try to print g_result.B.RESULT for printing the conversion result.

Best Regards,
Meet.‬

View solution in original post

0 Likes
1 Reply
Meet_T
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

Hi,

Can you please let us know what variable are you printing to see the result, because if you are printing g_result then it doesn't only contain bits for actual conversion result but also has some additional bits which make up the entire variable. Hence when printing the signed value of the g_result might be something like -2147479556. If you are interested in just conversion value then you should only refer to first 16-bit of hexadecimal value of g_result, for example -2147479556 in hexadecimal would be FFFF FFFF 8000 0FFC, so the last 16-bit meaning 0x0FFC would be the actual conversion value.

You can try to print g_result.B.RESULT for printing the conversion result.

Best Regards,
Meet.‬

0 Likes