View previous topic :: View next topic |
Author |
Message |
Guest
|
modbus.c and ex_modbus_slave.c problem |
Posted: Mon Jan 28, 2008 11:17 am |
|
|
When I try to compile the example (ex_modbus_slave.c) I get an error on line 193 (Unidentified identifier setup_uart). I've been working on it for awhile and still can't seem to find what is going on. If anyone could shed some light onto this it would be greatly appreciated. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jan 28, 2008 11:41 am |
|
|
The setup_uart() function only works with a hardware UART. If you
have the #use rs232() statement setup for a software UART, then you
will get that error message.
I did a text search for "setup_uart" for all files in the Drivers and
Examples directories, and I didn't find it in the modbus source files.
It's only in the files listed below. This is with PCM & PCH vs. 4.066:
Quote: | c:\program files\picc\examples\ex_linbus_master.c
c:\program files\picc\drivers\rs485.c
c:\program files\picc\drivers\linbus.h |
|
|
|
Guest
|
|
Posted: Mon Jan 28, 2008 12:01 pm |
|
|
It appears that the modbus files for v4.050 are different then. It is also missing modbus_kbhit() as well. Shoddy QA from CCS again. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jan 28, 2008 12:20 pm |
|
|
I did a file compare on the four Modbus files, and the only one that's
different between vs. 4.050 and 4.066 is Modbus.c
This is the new one, from vs. 4.066:
Quote: |
c:\program files\picc\drivers\modbus.c 60,622 bytes 7-13-07 |
This is the old one, from vs. 4.050:
Quote: |
c:\program files\picc\drivers\modbus.c 43,405 bytes 8-23-06 |
You could email CCS support. If you bought the compiler in the past
and have a customer Reference number, then email that information
to them and ask if they will send you the latest Modbus.c file. |
|
|
Guest
|
|
Posted: Mon Jan 28, 2008 12:38 pm |
|
|
I figured out what they did at CCS. I do have the modbus driver but it's not the one in the drivers directory. What they did was call it "ex_modbus.c" in the examples directory. I copied it over the modbus.c file in the drivers directory and all is well now. CCS needs to have some kind of errata section on their site to keep track of these problems as it would save everyone a huge amount of time in tracking this stuff down especially since no one was there to answer my call on the tech support line today. |
|
|
rfreddy
Joined: 03 Jun 2007 Posts: 7
|
Problem with 18f452 |
Posted: Thu Mar 13, 2008 5:30 pm |
|
|
Hi, I changed modbus.c for ex_modbus.c and I have this example running correctly for 2 16f877 as master and slave.
Now I tried to port slave's code to a 18f452 and my master now gets only exceptions, it seems to be that there is no data sent or received from the slave.
Does anybody have a running slave for this kind of pic or anybody could point me if I'm doing something wrong?
Thanks in advance,
Freddy |
|
|
|