Page 1 of 1

No funciona la comunicacion RS485, ni salidas digitales

Posted: Fri Jul 25, 2025 1:02 pm
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.

Re: No funciona la comunicacion RS485, ni salidas digitales

Posted: Fri Jul 25, 2025 1:05 pm
by Carmelo
Faltaba por adjuntar la parte del esquema de la sección del micro.

C.

Re: No funciona la comunicacion RS485, ni salidas digitales

Posted: Fri Jul 25, 2025 1:23 pm
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

Re: No funciona la comunicacion RS485, ni salidas digitales

Posted: Fri Jul 25, 2025 2:35 pm
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.