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.
No funciona la comunicacion RS485, ni salidas digitales
-
- 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
- Attachments
-
- electrical diagram, output test section
- Salidas.png (63.55 KiB) Viewed 700 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
-
- 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
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
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
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.
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.