UART Problems

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi

   

I'm new programming relative in the microcontroller, the PSOC 5LP I have quite recently discovered and exploited. He seems to be perfect for our tasks. Now I come to my problem. We try to transfer it via simple amplitude modulation data between two PSOC. It comes to a communication. But I have to get constant disconnects and which seem highly cyclical. The program is equal to the transmitter and receiver. Only the Create a logical 1 at Pin8 makes it to the transmitter.

   

The program flow is relatively simple. I will send 4 bytes and wait for the answer. Has the slave received the request it an answering itself with 4 bytes.

   

The failures in the communication are at regular intervals so that I think it on my program is located.

   

I have a lot of things tried but I had no success so had. I hope that a sober view of experienced programmers can help me here on.

   

best regards

   

viktor

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

I would  update to  PSoC Creator  3.3 CP3 (3.3.0.9604) . I would also change the while to forever instead of while(1).

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

Your interrupts are all at the same level I would change them as your program requires. I would also increase the Heap size from 0x080 to 0x200.

0 Likes
Anonymous
Not applicable

dear bob,

   

Thank you for the fast answer. Update has been made, heap size is now 200. While changes to for (;;). There is still the same problem.

   

Does anyone have an idea what could be.

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

It is more than just uncommon to use an UART the way you do. What is with start and stop bits, do they when not correct create a Tx???

   

When only the functionality is needed, why don't you use a shift register?

   

Your logic design is a bit (or Byte? 😉 complicated to follow, I would suggest to bring out to some pins the intermediate signals and check everything with a logic analyzer, a 2 channel scope wil not help you much.

   

 

   

Bob (another one)

   

 

   

PS: BTW Where in Germany are you located, I live near Bremen

0 Likes
Anonymous
Not applicable

Hello Bob(another one)

   

The signal actually looks good I have it set me on specially Pinns and studied them.The phenomenon is this, at the beginning of the communication the slave also answered correctly. But if you  observed signal on the osziliskope. You can see, that the response time is always shorter until the communication collapses. With the shift register, it is a good idea, I try to be mixed as to incorporate. But in really I want use the UART, because of all the functionalities. The packages are byte-oriented.

   

PS: I live in the Sauerland in Menden.(Schöne Grüße aus dem verregneten Sauerland)

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

Did you already consider to program your own component to maintain your signals as wanted? There are some (24) UDBs within a PSoC5 chip, each consisting of some PLD area, an (programmable) ALU, a few registers, 2 FIFOs (each 4 bit deep) and a HDL programming language to define what your component shall perform.

   

Yes, I admit, difficult to test, easy to make errors, but lastly unbeatable (except by FPGAs).

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hello Bob,
My problem with the uart is solved. The problem lay on the internal crystal or clock generator. With a Textronic and the signal analyzer module I could identify framing errors. Unfortunately, the internal quartz is not accurate enough, so that here the error in baudrate is already more than 4%. If you still makes a bit signal synthesis, the communication breaks down. Meanwhile the communication works fine. So a tip at all, if you want to build uart data communication with PSOC, first give them an external precision quartz.

   

regard's viktor

0 Likes