2 separate and independent Modbus/RS485 Communication with Atmega328PB

Hi Everbody, I am using Atmega328PB and I have to use 2 communication ports. Both should be Modbus/RS485. 1st port is for 3rd party communication and this will be a SLAVE, 2nd port is for internal needs, for communication with another Atmega328PB in our project, so this one can be either SLAVE or MASTER, I have no problem for SINGLE Modbus Port with Atmega328PB, Modbus Library, electronics etc. But I could not make 2 independent communication. Can anybody help me for this?

Which 328pb core do you use? You cannot use the additional features of the 328pb if you use the standard Arduino AVR core. The Pololu offered core simply defines Serial and Serial1 which you can use as you'd do on a Mega2560.