No funciona la comunicacion RS485, ni salidas digitales

Use this section to discuss your embedded Flowcode projects.
Post Reply
Carmelo
Posts: 132
http://meble-kuchenne.info.pl
Joined: Thu Oct 14, 2021 10:04 am
Has thanked: 53 times
Been thanked: 4 times

No funciona la comunicacion RS485, ni salidas digitales

Post by Carmelo »

Hello,
I have a problem with the development of a project to communicate 2 pic16F886 through the RS485 bus.
It seems that in the simulation it works perfectly.
I record the pics and physically test them and absolutely nothing works.

To rule out any errors, I have created a second program so that I read the keys pressed and act on an output accordingly. In simulation it works perfectly, but in physics nothing is still working.

Since the test does not work, that's why I assume that communication will not work either 485

I have reviewed the entire assembly, according to the attached diagrams, and it is OK.
I suspect it could be due to poor bit configuration, but I'm not sure.
I also attach the two flowcode files. Both the communications one and the input/output test one, in case you can give me some help.

If all of the above is fine, I only have to verify that it is the microcontrollers that are wrong.

C.
Attachments
electrical diagram, output test section
electrical diagram, output test section
Salidas.png (63.55 KiB) Viewed 701 times
COM485_16F886_04.fcfx
Communication between 2 pics via RS485
(101.64 KiB) Downloaded 42 times
T1.fcfx
Input/output test
(79.61 KiB) Downloaded 44 times

Carmelo
Posts: 132
Joined: Thu Oct 14, 2021 10:04 am
Has thanked: 53 times
Been thanked: 4 times

Re: No funciona la comunicacion RS485, ni salidas digitales

Post by Carmelo »

Faltaba por adjuntar la parte del esquema de la sección del micro.

C.
Attachments
micro.png
micro.png (62.89 KiB) Viewed 698 times

chipfryer27
Valued Contributor
Posts: 1684
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 374 times
Been thanked: 583 times

Re: No funciona la comunicacion RS485, ni salidas digitales

Post by chipfryer27 »

Hi

Not had a chance to properly look at your chart but in "Main" I don't see you using a Rx_Int. How do you know that there is data to be read? If you are relying on timers it would be pure luck if you received anything. Have a look in the WiKi for Rx interrupt and possibly the use of the Circular Buffer too as they make comms a lot easier.

Briefly, when data appears on your Rx pin the PIC then branches to deal with it. As with all interrupts this should be short so consider populating a Circular Buffer with incoming values to be examined later, possibly back in Main or other Macro.

I'll try and look in more detail later.

Regards

Carmelo
Posts: 132
Joined: Thu Oct 14, 2021 10:04 am
Has thanked: 53 times
Been thanked: 4 times

Re: No funciona la comunicacion RS485, ni salidas digitales

Post by Carmelo »

Thanks for the quick response and explanation.

But for now, I want to see why the test program does not work when recording the microcontroller.
If this program doesn't work at all, obviously the communications program won't work.

C.

Post Reply