View previous topic :: View next topic |
Author |
Message |
webgiorgio
Joined: 02 Oct 2009 Posts: 123 Location: Denmark
|
Modbus not compiling "INT_RDA2 - RCV_OFF()" |
Posted: Sun Apr 14, 2019 2:52 pm |
|
|
I want to compile the modbus slave example, but I have got several compiling errors.
I copied all the included files related to modbus into my project directory, so that I could change "TXSTA2" into "TXSTA1" in modbus_phy_layer.h.
I then changed the computer decimal separator from "," to "." to solve a problem related to #USE TIMER(TIMER=1,TICK=.1ms,BITS=16, ISR) [url]http://www.ccsinfo.com/forum/viewtopic.php?p=180955#180955 [/url]
I now get two errors in the modbus_phy_layer_rtu.c:
*** Error 12 "D:\pic\modbus\modbus_phy_layer_rtu.c" Line 291(13,14): Undefined identifier INT_RDA2
*** Error 7 "D:\pic\modbus\modbus_phy_layer_rtu.c" Line 338(0,1): Invalid Pre-Processor directive
Line 291 is RCV_OFF();
Line 338 is #int_rda2 (if I change it with #int_rda I am left with the error 12).
So, what is RCV_OFF(); doing? where is it defined? is it using INT_RDA2?
My final target is 16F1789, which gives the same errors I get by compiling the ex_modbus_slave.c
I have PCWH 5.034 |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9177 Location: Greensville,Ontario
|
|
Posted: Sun Apr 14, 2019 4:05 pm |
|
|
Hmm.. according to the 16F1789 datasheet I have, it only has one UART
if this is true, that explains the errors. You can't have an ISR for a nonexistant peripheral.
Jay |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
Re: Modbus not compiling "INT_RDA2 - RCV_OFF()" |
Posted: Sun Apr 14, 2019 5:52 pm |
|
|
webgiorgio wrote: |
So, what is RCV_OFF(); doing? where is it defined? is it using INT_RDA2?
|
RCV_OFF() is defined in this file (line numbers are shown):
Quote: | c:\program files (x86)\picc\drivers\modbus_phy_layer_rtu.c
47 #define RCV_OFF() {disable_interrupts(INT_RDA);}
56 #define RCV_OFF() {disable_interrupts(INT_RDA2);}
65 #define RCV_OFF() {disable_interrupts(INT_RDA3);}
74 #define RCV_OFF() {disable_interrupts(INT_RDA4);}
84 #define RCV_OFF() {disable_interrupts(INT_EXT0);}
86 #define RCV_OFF() {disable_interrupts(INT_EXT);}
|
The search was done with vs. 5.078, so line numbers could be different
from your compiler version. |
|
![](templates/subSilver/images/spacer.gif) |
webgiorgio
Joined: 02 Oct 2009 Posts: 123 Location: Denmark
|
|
Posted: Mon Apr 15, 2019 3:39 am |
|
|
All right I understand.
In my code I had Code: |
#define MODBUS_SERIAL_INT_SOURCE MODBUS_INT_RDA2 |
while the correct line is
Code: | #define MODBUS_SERIAL_INT_SOURCE MODBUS_INT_RDA |
Let's see now if it works with the hardware.
thanks |
|
![](templates/subSilver/images/spacer.gif) |
|