Hi all, I need a configuration advice for the use of both serial 0 and 1, before I start coding. I need to know if I should use IRQ on on both serial ports, or polling is adequate in our application. In our application, we will use the serial0 for configuration such as set this variable or upload configuration file, etc.. On the serial1, we will run a slave MODBUS protocol, half-duplex, RS485. Both ports will not run simultaneously, meaning that if a user on serial0 is configuring the MSC1210, then serial1 will be disabled for the time been. Also, when the MODBUS is active, there will be data been sampled and scaled at about 1 sample per second. Also, if someone has MODBUS slave available for sale, please contact me. Best regards Michel Belanger SEIDEL inc.
I would generally recommend using interrupts for your serial comms - especially when you want a few things to be happening - a/d conversion, display update and comms (Modbus in this instance). You did not mention which variant of modbus you wish to use: ASCII or RTU. RTU is a little trickier to receive as you need a timer for the end of packet. Not a problem with some careful planning. I have Modbus slave code (RTU and ASCII) for 8051 as well as a co-operative task framework that may suit your requirements. Contact me at rusbull@ozemail.com.au with the word MODBUS in the title so I don't accidently delete it (I get a lot of spam).