UART Tx example program not working

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

cross mob
Anonymous
Not applicable

Hi developers,

   

                          I am trying out the UART TX example program given in the creator 3.0 on the PSoC 5 device mounted in CY8CKIT-001 DVK board. Though as per the program I can see the LCD output, I am not able to see any response in the UART. I am monitoring the UART data through a hyperterminal. I have checked the RS 232 connector and port and found every thing to be correct and in working condition. Can some one help me get out of this.

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

Check the serial cable (cross-over vs. straight connection). make sure the TX line of the 001 kit is indeed connected to the RX line of your PC. (or the other way round: when you send something via Hyperterminal, you should see this on the RX line of the kit - check with a scope)

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

When connecting UART to a PC directly you have to observe the correct level. There is a level-shifter for Tx and Rx on the kit-001 board that has to be configured with a jumper. DO NOT BYPASS the receive-line, it has a +-12V level which will damage your board when not level-shifted to 5V.

   

Additionally observe the voltages of your signals to detect the Tx lines which must be crossed over as said in the prior post. Do not use hardware flow control yet.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

dear bob and hli,

   

as I have already mentioned, I have completely checked the cable. I did an RS 232 loop back test to check the cable integrity and found it working good. My jumper settings on the board are in default condition. I beleive that the only jumper affecting the RS232 port on the CY8CKIT-001 is  jumper J-10 (RS232-PWR) and I find it correctly in place. still there is no response.

   

one more observation is the TX line produces waveforms during data transmission (verified through DSO). and I even tried with a standalone levelshifter circuit board (powered separately and grounds connected to DVK board). Even after all this there is no response.

   

I am planning to burn the PSoC 5 self test.hex file with a hope that it will test the RS232 and say whether it is OK or NOT ok. but here too I face a difficulty burning the hex file to the PSoC 5 LP IC on the board. The programmer application does'nt list the 5868 series of the PSoC 5 IC at all. please get me out of this.

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

Jumper J8 powers the level-shifter for the RS232, but you still have to connect your Rx and Tx pins to the connector P16. Keep in mind that a PSoC5 does not have any dedicated UART pins, so you are completely free of using any appropiate pin for RTx and Tx which then you'll have to route/wire to P16.

   

 

   

Bob

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

Where dou you observe the TX line? on the PSoC GPIO pin, on the RS232 level shifter output, or on the other end of the cable?

   

(My guess till is that the RS232 cable you have is connecting TXpsoc to TXpc, and RX likewise, instead of being cross-over)

0 Likes
Anonymous
Not applicable

Dear hli ,

   

 I had observed the signal at the PSoC output pin when it was connected to the levelshifter TX input and found the 5 V TTL like serial signals. The output TX pin of the levelshifter has a sawtooth like waveform in the normal state and whenever data is transmitted the differential 12 V signal seems to be added up with this 500 mV sawtooth would this be an issue. This is the first time I'm observing an RS 232 line signal.

   

and moreover I have checked the RS 232 cable also it IS a crossover cable. I don't know what is going wrong...

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

If the signal at the PSoC output is ok, then check it

   
        
  • at the output of the level shifter
  •     
  • at the other end of the cable
  •    
   

If you use a cross-over cable. did you try a 1:1 cable too?

0 Likes
Anonymous
Not applicable

Does the TX output of the level shifter have a small sawtooth like waveform by default. I can observe a 2kHz 1V sawtooth on that line.? Is this a malfunction ?

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

No, it should no, there should be a flat level (of about 12V positive or negative). Did you measure this with the cable attached to the PC (if yes, try without)? Are the 1V peak-to-peak, is there an offset to GND on it?

0 Likes
Anonymous
Not applicable

Dear hli,

   

                   The problem got solved !!!. I used a straight through cable instead of a cross over cable. Now I can observe the data in the hyperterminal. But still I  see the 1 V sawtooth on the TX pin. And by the way I would like to know why only the straight cable works? are there any cross over at PCB trace level in the DVK board? Please clarify. This would be really useful for everyone.

   

thanks a lot

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

The use of 1.1 vs. cross-over cable is always confusing. I'll try to explain:

   
        
  • for a serial communication you need to connect RX and TX on the ends of the line (and TX with RX)
  •     
  • the definition to which pins RX and TX belong on a device depends on what the device is
  •     
  • there is data terminals equipment and data circuit-termiating equipment (DTA and DCE - see http://en.wikipedia.org/wiki/Data_terminal_equipment )
  •     
  • on a 9-pin port, DTE has RX on pin 2 and DCE has RX on pin 3
  •     
  • so if you connect devices of the same type together you need a crossover cable (to switch pins 2 and three)
  •     
  • but if you connect DTE with DCE you need a 1:1 cable
  •    
   

Regarding the 1V sawtooth: the level shifter has a charge-pump in it to generate the voltages needed for the RS232 communication. So you see the artifacts of that generation.

0 Likes
Anonymous
Not applicable

So what type is the PSoC DVK . Is it a DTE or a DCE?

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

In the "good old times" when the only interfaces a computer had were Centronix and RS232 I used to verify the RS232 connections with a voltmeter. An input showed nothing meaningful, while an output showed RS232 level which is about +-12V.

   

Avoiding strictly connecting two inputs or two outputs together I usually got my peripherals to work. Only few of those used the controls RTS-CTS and DTR, so I enabled them only when really neede.

   

 

   

Bob

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

Since your PC is a DTE, and a 1.1 cable works, the Cypress kit is a DCE. (Using a 1:1 cable is the normal use-case, a cross-over cable is normally only needed when connecting two PCs together).

0 Likes