Two things, I use the similar processor - PIC32MZ2064DAS176.
1. You can't just write random frequencies. There is a formula by which it is calculated. You have to get a minimal error, otherwise there will just be permanent errors. I use almost all the hardware modules in the processor /UART, SPI, I2S, I2C, Timers, DMA, GPU, SDcard ../, and I have taken this into account. Just choose something that works for you. For me, for example, it works at 192MHz, PBCLK2=96MHz, UART=38400b/s. But no problem with other UART speeds.
2. For me, everything works in ISR, and there is no problem. The bytes are glued, FIFO does its job perfectly. For the CPU, the transmission is practically transparent, and does not loaded it. BRGH=0! RS485 pin (RX/TX) for 65176 chip is switching from ISR (last byte).
post edited by Stefiff - 2021/03/09 14:49:12