UART (RS232)

For general Flowcode discussion that does not belong in the other sections.
Post Reply
samtin
Posts: 28
http://meble-kuchenne.info.pl
Joined: Sat Jul 10, 2021 2:43 pm
Has thanked: 4 times
Been thanked: 2 times

UART (RS232)

Post 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 121 times

medelec35
Matrix Staff
Posts: 1491
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 536 times
Been thanked: 485 times

Re: UART (RS232)

Post 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?
Martin

samtin
Posts: 28
Joined: Sat Jul 10, 2021 2:43 pm
Has thanked: 4 times
Been thanked: 2 times

Re: UART (RS232)

Post 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.

samtin
Posts: 28
Joined: Sat Jul 10, 2021 2:43 pm
Has thanked: 4 times
Been thanked: 2 times

Re: UART (RS232)

Post by samtin »

Hi Martin,
If I understood correctly, the duration of a 1 second pulse in the flowchart is 250ms on an ISIS oscilloscope.
Attachments
flash.png
flash.png (75.95 KiB) Viewed 3785 times

medelec35
Matrix Staff
Posts: 1491
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 536 times
Been thanked: 485 times

Re: UART (RS232)

Post 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?
Martin

samtin
Posts: 28
Joined: Sat Jul 10, 2021 2:43 pm
Has thanked: 4 times
Been thanked: 2 times

Re: UART (RS232)

Post 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.

samtin
Posts: 28
Joined: Sat Jul 10, 2021 2:43 pm
Has thanked: 4 times
Been thanked: 2 times

Re: UART (RS232)

Post 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.

medelec35
Matrix Staff
Posts: 1491
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 536 times
Been thanked: 485 times

Re: UART (RS232)

Post 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.
Martin

samtin
Posts: 28
Joined: Sat Jul 10, 2021 2:43 pm
Has thanked: 4 times
Been thanked: 2 times

Re: UART (RS232)

Post 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 !

samtin
Posts: 28
Joined: Sat Jul 10, 2021 2:43 pm
Has thanked: 4 times
Been thanked: 2 times

Re: UART (RS232)

Post 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

Post Reply