Page 1 of 1

UART (RS232)

Posted: Tue Oct 26, 2021 12:45 pm
by samtin
Hello everybody,

I tested UART (RS232) on 12F675, 12F1822, 12F1840 and it doesn't work. I attach the flowcharts below. I also tested on 16F877A and it works. Please help me.

Thanks !
flowcharts.rar
(444.61 KiB) Downloaded 464 times

Re: UART (RS232)

Posted: Tue Oct 26, 2021 3:21 pm
by medelec35
Hi samtin.
Before creating any project, always run a 1-second flash tester on your hardware.
It will save you a lot of time, since if the pin is on for more or less than expected time then Configuration settings do not match the hardware.
What is the measured on/off time?
for the 12F1840 for example, can you confirm if you are using a crystal with the two caps connected to each crystal leg and GND?

Re: UART (RS232)

Posted: Wed Oct 27, 2021 10:49 am
by samtin
I greet you, Mr. Martin,
I'm glad you answer me, I'll try what you suggest. I must say that the tests are done with another application that proved the operation of the same flowchart on 16F877A. Also at: https://www.matrixtsl.com/mmforums/view ... 41#p102441
UART has been proven to work.

Re: UART (RS232)

Posted: Wed Oct 27, 2021 2:11 pm
by samtin
Hi Martin,
If I understood correctly, the duration of a 1 second pulse in the flowchart is 250ms on an ISIS oscilloscope.

Re: UART (RS232)

Posted: Wed Oct 27, 2021 2:34 pm
by medelec35
If you place a delay of 1 second then the duration is one second.
If it's different, then there is a mismatch.
It's better to use hardware than to rely on simulation.
In the past, I have had code not working on Proteus, but working fine on hardware and vice versa.
As there is a x4 speed difference then could be PLL is not being accounted for?

Re: UART (RS232)

Posted: Wed Oct 27, 2021 7:18 pm
by samtin
Hi Martin,
Thank you very much for the answer, I will try on a development board and I will come back with the results.

Re: UART (RS232)

Posted: Mon Nov 01, 2021 4:26 pm
by samtin
Hi Martin! Hello everybody!

PIC12F1822 does not work, displays a single character, I do not know what to do next. The same flowchart for 12F1822 works on PIC16F688, on PIC16F886. I did the tests on a PIC development board. The hex file taken from Martin for 12F1822 works, I mentioned the address above.
Please help me.

Re: UART (RS232)

Posted: Wed Nov 03, 2021 11:03 pm
by medelec35
If the flowchart worked on a different device then it suggests the code is correct.
So either the project settings are not correct.
What was the result of the 1 second flasher on your hardware?
Is the pulse width 1 second?
If so Send a Upper case U and measure the pulse width.

Re: UART (RS232)

Posted: Thu Nov 04, 2021 2:21 pm
by samtin
Hi Martin,
Sorry for the delay, I had an internet problem until the cable operators came to fix it. I will come back with results.

Thank you very much !

Re: UART (RS232)

Posted: Sun Nov 07, 2021 1:48 pm
by samtin
Hi Martin, hello everyone,
Thank you Mr. Martin very, very much for the support, the 1s test helped me a lot, indeed the settings were not done correctly, after I made the corrections it works on the development board.

Thank you very much ! :D :D :D :D :D