I’m working with an ELM327 OBD to USART Interpreter (communicates with 1996+ automotive ECUs). It initializes at 38400 Baud. It has faster options, which I want to capitalize upon. Once a faster option is programmed, it will always communicate at that faster Baud rate from that point onward. I tried DEFINE-ing HSER1_BAUD at 115200 in the upper portion of my code, and then reDEFINE-ing it at the 38400 rate in the subroutine that initializes the ELM327. The Compiler gave me an error for DEFINE-ing the same thing more than once.

I see only one option; use SPRG1H/SPRG1/Sync/BRGH/BRG to define baud rate in both instances. I worked out the math, but I haven’t breadboarded it yet. Will the HSERIN/OUT Commands work without the appropriate HSER1_BAUD DEFINE since I can’t declare it twice? Ideally I’d like to structure the Header DEFINE for the 115200 and change it in the “used only once” subroutine to the 38400. Experienced thoughts appreciated.