Splitting up the call and receive?
Posted: Fri Jul 01, 2016 12:31 pm
I'm using the OBDII UART adapter in an application, hooked up to an Arduino Mega, where i want to read OBDII data, in addition to reading 16 analog inputs off the Mega (and other things)
The problem comes in that i can process the 16 channels of analog WAY faster than i can read from the OBDII port. I can read and process the 16 channels of analog data at like 80HZ. The OBDII data, depending on how many requests i send, can maybe be read at 2-10HZ. the more requests i send, the slower the loop.
So, my goal is that I don't want to slow down the loop, while waiting for OBDII data. I thought perhaps that i could send a "call" to the OBDII port for data, continue processing my other things, and then maybe some number of loops later (10-20), i'd read data waiting at the incoming buffer. I can't seem to figure out how to do this.
I've been trying to figure out the code posted on Github, and trying to separate it into send & receive, but no luck. Anyone try this before with any luck?
The problem comes in that i can process the 16 channels of analog WAY faster than i can read from the OBDII port. I can read and process the 16 channels of analog data at like 80HZ. The OBDII data, depending on how many requests i send, can maybe be read at 2-10HZ. the more requests i send, the slower the loop.
So, my goal is that I don't want to slow down the loop, while waiting for OBDII data. I thought perhaps that i could send a "call" to the OBDII port for data, continue processing my other things, and then maybe some number of loops later (10-20), i'd read data waiting at the incoming buffer. I can't seem to figure out how to do this.
I've been trying to figure out the code posted on Github, and trying to separate it into send & receive, but no luck. Anyone try this before with any luck?