Hi. I'm still a relative novice with Arduino (6-9 months maybe - I used CircuitPython for a few months before I realised the limitations), and I may have to give a lot of background to the task I am trying to achieve, so apologies if this post is a bit too long...
I am creating a datalogging device for motorcycles, it has custom hardware that is essentially an ESP32-S3 Reverse TFT feather with on-board SPI microSD, SPI CANBus using the one-chip MCP25625 and serial GNSS using the CD-PA1616D module on a daughterboard.
I have several spare GPIOs that I plan to use for handlebar buttons and possibly other inputs, but I want this device to also be used as a road-legal speedometer while logging, so relying solely on the GPS for speed isn't an option (not road legal due to tunnels etc). The bikes it will be used on all have ABS, so using the pulses from the ABS sensors would be a legal way to go about it. I have the GPS speedometer working perfectly.
Currently, logging is done at 5Hz, which suits the GPS and CANBus (OBD2) perfectly - OBD2 only allows 20 requests per second to avoid overloading the vehicle systems, so four parameters five times a second is fine. However, sampling the input from an ABS sensor ring at 5Hz would be far too slow, and using a system that is triggered by the pulses from the ring rather than using a fixed sampling rate would be better. From the time between these pulses, I would be able to calculate the wheel speed which can be used to give road speed.
To achieve this, it seems I have to have a separate process that is constantly measuring the wheel speed and making this value available for the main process to access, so using the second core to run this second process seems ideal. I'm not using wifi / bluetooth etc. (the hardware isn't on my board, just using the bare microcontroller) , so the second core is largely sat doing nothing.
I've got the main logger & display functions working really well, but I have no idea how to go about creating a second process on the other core, and telling it what to do. I'm sure I'd be able to create the code for all the triggering and calculating I need, but I need to know how to wrap it up and send it to the second core, and how it would then make the values available to the first core.
Any help & suggestions, including a different approach if you think it's appropriate, would be welcome.