Porting ADC driver for MAX78000

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
Post Reply
Nico Zorbach
Posts: 2
Joined: Fri Jun 28, 2024 2:31 pm

Porting ADC driver for MAX78000

Post by Nico Zorbach »

Hi

I am doing the port of the ADC driver for the MAX78000. The ADC peripheral of the MAX78000 does not support DMA and also does not have a sequencer. Thus, the only way to allow for a sequence of multiple conversions in one function call, is to implement the sequencer in software. I would have to call the function out of the interrupt service routine every time one conversion is finished.
Making up for the missing hardware with this software feature might be confusing for the user. On the other hand, the asynchronous function is not very useful without this feature, as the program has to wait for all conversions in one sequence to be done, before it can continue.

What is your suggestion?
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Porting ADC driver for MAX78000

Post by Giovanni »

Hi,

It is certainly possible to implement a SW sequencer, a fairly simple state machine. The main problem is that it would have significant jitter (ISR service time and interaction with other IRQs), it could be a problem or not depending on your application.

How fast is the ADC? the SW sequencer would get one interrupt for each sample, ISR must be simple enough to not miss interrupts.

Giovanni
Nico Zorbach
Posts: 2
Joined: Fri Jun 28, 2024 2:31 pm

Re: Porting ADC driver for MAX78000

Post by Nico Zorbach »

Thank you for your quick response.

The ADC has a maximum conversion time of 164µs, so it is quite slow. At the moment the ISR just checks the interrupt flag, puts the new sample in a buffer and clears the interrupt flag again.

Nico
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Porting ADC driver for MAX78000

Post by Giovanni »

Quite slow ADC, simulating a sequence in SW should be no problem.

Giovanni
Post Reply