PSoC 6 UART functions

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

cross mob
Anonymous
Not applicable

Hi

I appreciate all the discussions and doc's on enabling serial terminal behavior between PC and PSoC 6 Pioneer Kits. 

I am having issues in following the suggested sample project in KitProg2 User Guide, Doc. # 002-10738 Rev. *I and am wondering if I am missing anything.

The User guide project is based on PSoC 4 and there are some differences with the behavior for PSoC 6 Pioneer Kit programmed via  (PSoC Creator  4.2 (4.2.0.641).

First is the configuration menus for the USB-UART now handles interrupts differently than shown in the user guide and I can not see that it offers a "none" setting.  At first I assumed that "internal" would take care of the interrupt.  Then I read information in the datasheet  that suggested the "external" option with the pin unconnected might be right way to go. I was able to successfully build and program with either interrupt setting, but so far there is no sign of communication via this channel. I have a suspicion that I am not properly handling the interrupt and cm0p properly.  

I let the Creator select the UART-RX and UART-TX pins automatically on generation of the application- it selected RX on pin P0[2] and TX on pin P0[3] for the PSoC 6 Pioneer Kits.  All seems well there.

When I tried to use the KitProg2 User Guide code example in my  main_cm0p.c I got warnings that UART_1_UartGetChar(); was not declared (see sample below).  I looked in the UART_1.h and found UART_1_Get(); which built without issue.  You can see both in the code below.  I tried to include <stdlib.h> in case that was the source for missing definition, but had no luck.

pastedImage_5.png

With line 35 commented out the project builds and programs, but I do not get any text back from the PSoC 6 kit.  I also do not get the red text string above when I hit reset.  

  • Additional info:
    • I loaded PuTTY terminal and do get the local echo.
    • Device Manager does see the KitProg2 USB-UART on COM5, so I opened a terminal session to it.

I infer that the USB-UART is specific and sufficient to connect the cm0p to the USB port without further connection on my part.

I guess my questions are :

  1. Why am I having trouble with the suggested code UART_1_UartGetChar(); and its cousins in my PSoC 6 project?  (Was looking at UART_1.h, the right place to expect the headers?)
  2. Are the UART configuration differences are specific to PSoC 6 or PSoC Creator 4.2 ?
  3. What is the best way to set up the UART Configuration of interrupts relative to my PSoC 6 project?
  4. Should I be targeting mc0p or mc4p? (Actually I an unclear on why/when to use either or how to use both.)

Advice on any of these points would be helpful.

Thanks,

Chris

0 Likes
1 Solution
Anonymous
Not applicable


Hello and Thanks to you user_342122993

Your encouragement was very helpful and I am now up and running on the USB-UART Bridge with PSoC 4 Pioneer Kit.

In following up on both of your suggestions I did find another error of my-own making which I am sure was the root issue.

I am now confident that I have the PC and terminal end of things working and will turn toward the PSoC 6 Pioneer Kit to get the UART-USB bridge working there.

I am still unsure on how to configure the UART since the PSoC 6 UART configuration menu does not match the User Guide which was based on PSoC 4.  I will work that through further and start a new thread if I need more help.  In the mean time lets consider this thread closed.

Many Thanks

View solution in original post

0 Likes
6 Replies
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Please post your code by clicking on File and the create_work_space_bundle and attach the zip file created to a new comment. 

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello:

Thank you for the opportunity to submit the workspace file for review.  Please see the attached.

I am having difficulty with the project UART-101.

I am trying to follow the USB_Bridge example from the KitProg2 UserGuide.

I am looking to use a terminal program to inspect operations from the PC.

I get a warning when using the code in line 32 of main_cm4.c

I am wondering why the suggested code of line 32 does not build.

If I comment out  line 32, as shown, substituting the code of line 30 the compiler allows a build and programming.

However it does not run as expected.

Running the PuTTY terminal program does not seem to connect.

I do not get the text of line 24 on "reset"

I do not get any echo of the characters sent via the PC terminal

I suspect I am not using the UART configuration correctly.

There is no option for "no interrupt" as suggested int eh UserGuide example (based on PSoC 4).

I much appreciate any insight.

Thanks,

0 Likes

I recommend to add a delay on line 28 ( between UART_Start and _PutString), UART needs some initialization time.

e.g. CyDelay(100);

Anonymous
Not applicable

Hello and Thanks to you and user_78878863

Your encouragement was very helpful and I am now up and running on the USB-UART Bridge with PSoC 4 Pioneer Kit.

In following up on both of your suggestions I did find another error of my-own making which I am sure was the root issue.

I am now confident that I have the PC and terminal end of things working and will turn toward the PSoC 6 Pioneer Kit to get teh UART-USB bridge working there.

I am still unsure on how to configure the UART since the PSoC 6 UART configuration menu does not match the User Guide which was based on PSoC 4.  I will work that through further and start a new thread if I need more help.  In the mean time lets consider this thread closed.

Many Thanks,

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

The user guide states that P5.0 is the KitProg UART TX (so it needs to be PSoC6 RX), and P5.1 is the KitProg RX (so it needs to be PSoC6 TX). P0.1 and P0.2 are used otherwise.

Anonymous
Not applicable


Hello and Thanks to you user_342122993

Your encouragement was very helpful and I am now up and running on the USB-UART Bridge with PSoC 4 Pioneer Kit.

In following up on both of your suggestions I did find another error of my-own making which I am sure was the root issue.

I am now confident that I have the PC and terminal end of things working and will turn toward the PSoC 6 Pioneer Kit to get the UART-USB bridge working there.

I am still unsure on how to configure the UART since the PSoC 6 UART configuration menu does not match the User Guide which was based on PSoC 4.  I will work that through further and start a new thread if I need more help.  In the mean time lets consider this thread closed.

Many Thanks

0 Likes