|
A failure in embedded system can be due to software and hardware.
In your case, The problem can be
The pin is not connected,
The pin is in wrong I/O type
The pin is dead
The UART is not wire to the correct pin in the designer
The UART is not started
The UART is set with wrong clock
The UART is set with wrong baud rate
The UART is set with wrong data bit rate
The UART is set with wrong stop bits
The UART clock source is not the right sync type
The UART digital block is faulty
The RS232 chip is faulty.
The data send from the PC is not what your think it is
API used is wrong type
….
….
You need to isolate the problem one at a time, as there can be multiple failure. You have to build your project one bit at a time from the bottom up.
Without a known working hardware, there is no way to check if your software works or not .
Since you can send an ‘a’ to the PC means that your baud rate, the data bit and the stop bit most likely to be correct.
So it is the receiving side you have to work on.
I didn’t give you the exact C code because you need to know what to use by studying the data sheet and from C manual, and that should give you an idea what it is expected to do. And that is what embedded designer needs to learn.
I would use a CRO to check the input to the psoc pin but as you don’t have one, we just need to do it in a different way.
If you use a loop in receiving only. You should be able to receive something, if it doesn’t I would check the wiring and the signal to the PSOC input pin and the configuration of the UART.
PSoC is a good chip to use once your master it.
|