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 CCS Technical Support

I want to use both USART of PIC18f6722 for modbus protocol!

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



Joined: 23 Aug 2007
Posts: 14

View user's profile Send private message

I want to use both USART of PIC18f6722 for modbus protocol!
PostPosted: Fri Sep 07, 2007 3:56 am     Reply with quote

I want to use both USART of PIC18f6722 for modbus protocol!
is it possible or not?
if yes will i modified driver for that or any other way?
please explain in detail
any help will be appreciated!
Ttelmah
Guest







PostPosted: Fri Sep 07, 2007 4:15 am     Reply with quote

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