cancel
Showing results for 
Search instead for 
Did you mean: 

UART1 setting breakpoint problem

gnyturan
Associate II
Posted on June 25, 2013 at 11:00

Hello all,

I am trying to make the chip to communicate with the PC. My code did not work and I want to debug the code. But I cannot control what happens when data is received. In the debug mode, the code never enters in the interrupt handler. 

How can I see what does the program do when it receives data from the PC?

Thanks a lot in advance.

Best regards,

Gunay

#usart #debug #interrupt #iar
17 REPLIES 17
gnyturan
Associate II
Posted on June 25, 2013 at 14:08

this is the part of the schematic which shows RS422 connections of the board. 

-- I removed the schematic to prevent any trouble. I think clive1 and fm have seen it and found no problems (:

I do not think there is a problem with these because it is a part of a well working board, at least it used to work well (: 

Is it possible to damage it with the code?

frankmeyer9
Associate II
Posted on June 25, 2013 at 15:38

this is the part of the schematic which shows RS422 connections of the board. 

In theory, there is no problem, since PA8 and PA9 are denotes as 5V tolerant (assuming a F407).

But I still don't get how you connect, for instance, RX+ and RX- on RS422 side to RX and GND on UART side.

RS422 is differential, that means, RX+ to RX- is max. 10V.

That would be too much for a GPIO input ...

gnyturan
Associate II
Posted on June 25, 2013 at 16:02

I think the transreceiver IC does that part. I mean I do not connect GPIO pins of the chip directly to the Rx+ and Rx- but there is this IC between them. It's a TI component written ''05C8L6K VP1793 G4'' on top of it but I could find no datasheet available on the internet. 

frankmeyer9
Associate II
Posted on June 25, 2013 at 16:22

Finally, the RX pin of the STM32 needs to see a signal according to the RS232 standard (on CMOS level), and according to the configuration parameters (baudrate, databits, stopbits, etc.) to receive anything.

I deem it rather essential that this is the case - and a scope is the best tool to check this.

gnyturan
Associate II
Posted on June 25, 2013 at 16:41

OK, I will test it with a scope tomorrow and post the results. But do you mean STM requires RS232, and its RS422 incompatible?

frankmeyer9
Associate II
Posted on June 25, 2013 at 17:02

But do you mean STM requires RS232, and its RS422 incompatible?

 

The physical layer differs, i.e. the voltage levels on the line.

Assuming otherwise identical parameters (baudrate, polarity, character settings), they are compatible. With proper level shifting, it should work.

gnyturan
Associate II
Posted on June 26, 2013 at 17:24

Hello guys,

Today I used a scope and found out that the problem is a really silly one. Connector cable was connected wrong, after changing it, problem disappeared. 

I apologize for taking your time for such a mistake.

Thank you so much for your help.

Best regards.

Günay
frankmeyer9
Associate II
Posted on June 26, 2013 at 19:05

Never mind.

One engineering rule learned: question everything, and check everything you did.