Any general discussion around the firmware, what is does, how it does it etc.
By FoxUnpopuli
#65832
I'm trying desperately to figure out why each injection and ignition channel needs a separate timer-counter-compare... but it may be due to the more advanced capabilities (and higher clock speeds) of newer microprocessors compared to the Mega2560.

I am not an experienced enough with embedded firmware to know for sure, but interrupts on the SAMD51 (and probably the PIO functions on the RP2040) can be triggered from multiple different counts off the same timer. As the timer can be working at very high frequency/speed, I'm fairly sure any one timer could cope with all the interrupts on one cylinder, for instance. On a Dropbear, the timers don't need to associated with an IO pin either... as they drive the 33810 via SPI.

What am I missing?

Mark.
By tonyadams
#65927
The Mega2560 only has three 16-bit timers, which would be insufficient to handle the timing requirements of a multi-cylinder engine. Each timer would need to be shared between multiple channels, which could lead to timing conflicts and inaccuracies.
pokedoku
By dazq
#65928
tonyadams wrote: Thu Nov 23, 2023 6:50 am The Mega2560 only has three 16-bit timers, which would be insufficient to handle the timing requirements of a multi-cylinder engine. Each timer would need to be shared between multiple channels, which could lead to timing conflicts and inaccuracies.
pokedoku
The above is not completely true I am afraid !

Timers have multiple channels not only on the mega 2560 but on teensy and stm32 too.
The channels are triggered by the associated timer as it runs/counts thus causing the interrupts.
We do not use the timers to change pin state of outputs directly. Doing this makes the multi MCU architecture of the code possible and easier to achieve.
The mega 2560 has 9 channels in total available to the speeduino firmware to use.
I hope that helps make things clearer :-)
Snake and Speeduino

You should use single channel spark output setting[…]

At the risk of repeating myself, the different del[…]

Motorbrein.nl VW

What is it you want comments on? its not a board t[…]

the file in attached

Still can't find what you're looking for?