This looks very good to me. I also want to build an ignition system. I have an old Briggs and Stratton generator. I want to be able to control the ignition timing. You told us about the Arduino, Hall switch, and ASIC coil drivers. That tells me a lot. But I would still be interested in in any more information you can tell us.
here is link to code, it is far from optimal, i guess, because i just took solar tracker control program i wrote earlier as base.
it was convenient, because tracker program contained sort of user interface using rotary encoder and OLED display and provided easy way to change all sorts of parameters.
the hall sensor is latching type and there are two magnets embedded in aluminum fan on the crankshaft,
one magnet at TDC turns hall sensor output to high state, second magnet which is placed 90 degrees prior to TDC turns hall sensor output to low state.
for driving the coils, i did use MOSFETS first, but they did not last long, because coils are creating terrible voltage spikes of all sorts in primary windings, IGBTs can handle them, but then again they need gate drivers to operate properly and that gate driver died when i tried to use IGBT. ))
the ASIC i use now is called VB525SP-E, it can be driven by arduino pin directly though 1k resistor, but i drive it through an optoisolator, because of voltage spikes mentioned above.
if you have more specific questions, i will be glad to answer ))
the raspberry pi is an applications processor, the Pi Pico is a microcontroller. You are best served to use the microcontroller for timing specific applications. It is basically all about scheduling.
The .ino files he has posted are from the arduino IDE which are C/C++ and you can use the arduino IDE with the Pi Pico as well as many other microcontrollers. `
That being said you might be able to get away with it on a newer pi and dedicate a single core to the application. Then the scheduler isn’t bumping the process to time share with something else. There is also real-time linux kernel, that you can use.
I would change that to ‘MAY result in faster code’. Optimizers have improved considerably over the last decade. I don’t know if that has all filtered back to arduino, which uses an older version of the gnu compiler. but I suspect a lot of it has.
Most microcontrollers, including the Arduino, have hardware timers with interrupts. An interrupt allows you to “interrupt” the main program loop and run specific subroutines with precise timing. This is exactly what you would want for engine control. Programming an MCU is close to “bare metal” so you have the advantage of directing things exactly but at the cost of having to know exactly what should happen and how.
Raspberry pi is much easier to program but generally speaking, software timing is less precise especially with an operating system like linux doing its own work in the background. That said, an ARM chip like the rpi has is a beast compared with a typical micro controller. The overhead from Linux may be low enough it doesn’t matter.
I think the pico and pico H are essentially the same except the soldered on male pins on the H. They mention something about the debugging port but that is a hardware debugger so it is really low-level debugger to the point it is irrelevant for 99% of the pico audience. the W adds wireless networking.
How are you going to add a knock sensor or are you looking at a larger engine in the future? Are you looking at adding CANBus like ODB2 has as well? you can buy boards with the canbus chip on them, and they will connect either via spi or i2c buses to the chip. There are some development boards that have the canbus chip already on them which is why I asked.
I am asking in part because the arduino had issues with multiple cylinder engines, and the pico is faster but the m0+ series isn’t the fastest series of arm microcontrollers either. It is about the lowest budget controller with the current ARM designs. It is a good one for small projects and good to get your feet wet with. It isn’t really that hard to jump to a faster chip either even low level stuff should work on the m4 or m7/h7 series arm microcontrollers. They just add features like FPUs and faster/more clocks.