CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Modbus not compiling "INT_RDA2 - RCV_OFF()"

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
webgiorgio



Joined: 02 Oct 2009
Posts: 123
Location: Denmark

View user's profile Send private message

Modbus not compiling "INT_RDA2 - RCV_OFF()"
PostPosted: Sun Apr 14, 2019 2:52 pm     Reply with quote

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
temtronic



Joined: 01 Jul 2010
Posts: 9102
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Apr 14, 2019 4:05 pm     Reply with quote

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
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: Modbus not compiling "INT_RDA2 - RCV_OFF()"
PostPosted: Sun Apr 14, 2019 5:52 pm     Reply with quote

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



Joined: 02 Oct 2009
Posts: 123
Location: Denmark

View user's profile Send private message

PostPosted: Mon Apr 15, 2019 3:39 am     Reply with quote

All right I understand.

In my code I had
Code:

#define MODBUS_SERIAL_INT_SOURCE MODBUS_INT_RDA2

Rolling Eyes
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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group