Porting ADC driver for MAX78000

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

Porting ADC driver for MAX78000

Postby Nico Zorbach » Mon Jul 01, 2024 9:09 am

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: 14496
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1090 times
Been thanked: 932 times
Contact:

Re: Porting ADC driver for MAX78000

Postby Giovanni » Mon Jul 01, 2024 5:17 pm

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

Postby Nico Zorbach » Tue Jul 02, 2024 9:50 am

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: 14496
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1090 times
Been thanked: 932 times
Contact:

Re: Porting ADC driver for MAX78000

Postby Giovanni » Wed Jul 10, 2024 7:24 pm

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

Giovanni


Return to “ChibiOS/HAL”

Who is online

Users browsing this forum: No registered users and 2 guests