HELP! PSoC 3 on Custom PCB Interfacing with Ultrasonic Sensor (ADC), UART, and Putty

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

cross mob
Anonymous
Not applicable

Hi, 

   

I am a complete newbie to PSoC 3, so I apologize in advance for my ignorance and if I have no provided the necessary information. I have successfully created a custom printed circuit board for the PSoC 3 AXI-040 for a course that I am taking. I would like to figure out how to display the ADC readings from an Ultrasonic sensor (that is hardwired to my custom PCB) and display these readings to Putty (or something else?) through UART so that I can interpret/debug my ultrasonic sensor code while connected to my PCB.

   

I did something similar last semester using the PSoC 4 Dev Kit, where the flex sensor readings from the ADC were sent via UART to a Putty window. But again, this was on the dev kit and not a custom PCB. Still, it made my life so much easier for debugging/tuning the code so that I could send accurate information to the actuators. I need to do something very similar again this semester, but I have no idea where to start since I am using a custom printed circuit board and MiniProg3. 

   

I already wrote the ultrasonic sensor code using the PSOC 3 dev kit and had it display the ADC values to the LCD so that I could verify that the sensor is working correctly. My next step is to move to my custom printed circuit board and make sure that the ultrasonic sensor is working on it. The best way for me to do this is to have it display the values from the ADC through a terminal window like Putty. Using the MiniProg3 and the PSoC Programmer IDE, I have managed to successfully program the chip using the code for the sensor. Or at least it says it was successful. I have also programmed the chip on my PCB using PSoC Creator. It also said it was successful. The problem is, I have no idea if it is actually working on my custom PCB since I cannot see any sort of output from the sensor (custom PCB does not have LCD connections, so I can't use that). Additionally, I have no way of further debugging my code (when I incorporate the sensor with machine vision and actuators) since I cannot see what the ADC readings are for the sensor.

   

So, how can I display the values from the ultrasonic sensor (ADC) to Putty or something else through UART? Or is there some other way that this can be achieved that I don't know about? I am getting concerned because I have read a lot online that states that it is not possible to do this since the COM port for Putty is using the MiniProg 3 already. Is this true? Is there no work around?

   

Thank you all for your time and assistance. 

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

I think you cannot run UART over the Miniprog3, at least niot when you want to use it for debugging at the same time. Best is to have two additional IOs that you can connect to a UART-to-USB converter (e.g. a FT232 one).

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The MiniProg3 can act as an I2C to USB bridge, not as an UART - to USB. This mode is commonly used when using CapSense Tuning. Since the PSoC3 is very friendly concerning the routing capabilities you should tahe Hli's advice and use any two pins for UART and use a voltage-shifter (ie. MAX232) for adjusting the PSoC voltage to RS232 (+-12V).

   

An alternate solution could be to use the USBUART component which may use an emulated com-port on the PC-side to which you may connect PuTTY. No voltage driver needed for this, clock adjustment might be required to tun USB.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks to the both of you for your valuable feedback. Can you provide any resources with more information regarding how to use the usbuart. It sounds like it might be the better option since it does not require additional hardware.

   

Thanks!

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

On Creator, Start Page, "Find Example Projects", there is an example

   

project you can look at.

   

 

   

    

   

          

   

http://www.element14.com/community/docs/DOC-48266/l/cypress-ce60246--application-note-on-usbuart-for...     USBUART

   

 

   

 

   

    

   

          

   

http://www.cypress.com/?rID=70131     AN82072 - PSoC® 3 and PSoC 5LP USB General Data Transfer with Standard HID Drivers

   

http://www.cypress.com/?rID=39553     AN56377 - PSoC® 3 and PSoC 5LP - Introduction to Implementing USB Data Transfers

   

http://www.cypress.com/?rID=39404     AN57473 - USB HID Basics with PSoC® 3 and PSoC 5LP

   

http://www.cypress.com/?rID=39327     AN57294 - USB 101: An Introduction to Universal Serial Bus 2.0

   

http://www.cypress.com/?rID=40103     AN58726 - PSoC® 3 / PSoC 5LP USB HID Intermediate (with Keyboard and Composite Device)

   

 

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 Thank you so much! I will read through the documentation and hopefully I can get this working. Thanks again!

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Hopefully that will help, glad to have been of assistance.

   

 

   

Regards, Dana.

0 Likes