Guest
|
picc/driver/modbus.c |
Posted: Thu Jun 21, 2007 7:43 am |
|
|
Hello all,
I tried to use Modbus.C provided in the driver folder.
I used the wizard, to create A master and a slave project.
I encountered many problems , i wonder if as there is no example of using this library, it is or not good ?
minor problem ! :
for exemple the wizard generates some
fprintf(PC," text");
that means that you have to declare another useRS232 using other pins than the ones used for rs485 . but in modbus .c the rs485 is delcared like this
#use rs232(baud=MODBUS_SERIAL_BAUD, xmit=MODBUS_SERIAL_TX_PIN, rcv=MODBUS_SERIAL_RX_PIN, parity=N , force_sw , stream=MODBUS_SERIAL)
and the force_sw flag cannot allow you to declare another users232
Major Problem
for my slave i do not use the Int Interrupts.
By llookng the modbus.c looks like SLave check for incoming messages in int_timer2.
but i cannot find anywhere an enable_interrupts( timers2)
so i wonder if this code libary has een tested , or i simply should not be in the directory?
( by the way i guess the master works fine , i sends something on the RS485 bus, ( i check with an oscilloscope ) ) |
|