Ttelmah Guest
|
|
Posted: Fri Sep 07, 2007 4:15 am |
|
|
Of course it is.
You would need to take the MODBUS driver, select using the hardware UART, and add the second interrupt driver (with different name), using INT_RDA2. Then all the routines, will need to be modified to also have a 'channel' address as a variable, wih the I/O arrays etc., using an extra diension indexed by this.
You will also need to switch to using interrupt driven transmission (adding the buffering from EX_STISR, but duplicated for the two UARTs), or one transmission will stop the transactions on the other bus.
Perhaps 80% of the work is already done in the MODBUS driver, since it handles the transactions etc., and the rest you will have to write for yourself.
I'd suggest doing it in three parts. First, simply modify the existing modbus driver to handle the second UART (changes to the interrupt selected, and the UART setup). Once this is working, then add using interrupt driven transmission. Finally, ad the second dimension to the arrays, and selection of the channel involved to the functions.
I'd allow a couple of days to generate a program to handle this.
Best Wishes |
|