No more ADC Free Running Mode @ ATTINY1614/16/17 ?

Go To Last Post
15 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, 

There is no note for that mode in ADC-Section of Datasheet (only Single conversion by hand or event-controlled).

But in Errata they write something from ADC Free Running mode... Who knows more about that missing feature?

 

Franz

This topic has a solution.
Last Edited: Sat. Mar 3, 2018 - 09:22 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Free running mode - RIP

Never used it or needed it...

 

Jim

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@Jim, do you know for sure that they dropped it?

 

@OP, I cant answer your question for sure, but iotn1616.h has this;

/* ADC - Analog to Digital Converter */
/* ADC.CTRLA  bit masks and bit positions */
#define ADC_ENABLE_bm  0x01  /* ADC Enable bit mask. */
#define ADC_ENABLE_bp  0  /* ADC Enable bit position. */
#define ADC_FREERUN_bm  0x02  /* ADC Freerun mode bit mask. */
#define ADC_FREERUN_bp  1  /* ADC Freerun mode bit position. */
#define ADC_RESSEL_bm  0x04  /* ADC Resolution bit mask. */
#define ADC_RESSEL_bp  2  /* ADC Resolution bit position. */
#define ADC_RUNSTBY_bm  0x80  /* Run standby mode bit mask. */
#define ADC_RUNSTBY_bp  7  /* Run standby mode bit position. */

and Start generated this in adc_basic.c;

	ADC0.CTRLA = 1 << ADC_ENABLE_bp     /* ADC Enable: enabled */
	             | 0 << ADC_FREERUN_bp  /* ADC Freerun mode: disabled */
	             | ADC_RESSEL_10BIT_gc  /* 10-bit mode */
	             | 0 << ADC_RUNSTBY_bp; /* Run standby mode: disabled */

but, the Start configurator does not even have a way to select Free Running mode.

 

Per the Errata, Free Running mode exists with the caveats noted.  Go for it, set bit 1 in the ADC CTRLA register and see if it works!

 

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Tue. Feb 27, 2018 - 09:58 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

larryvc wrote:
@Jim, do you know for sure that they dropped it?

No, just commenting on what OP said.

 

Jim

 

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Being really old and such, I'm not well versed in e.g. Xmega-style event systems.  For this question, I scanned the ADC register descriptions for this model family.  In AVR8, free-running was one of the auto-trigger ADATE choices.  Here all I can find is

But what event on which peripheral?  Hmmm--does every event on every peripheral have an associated flag "when I fire also start an ADC conversion"?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

EVSYS - The Event System, chapter 14 in the datasheet, has all the information on setting which event generator feeds which event trigger.  It's more complicated than that, just summarizing.

 

14. EVSYS - Event System

 

14.1 Features

• System for direct peripheral-to-peripheral signaling
• Peripherals can directly produce, use, and react to peripheral events
• Short and guaranteed response time
• Up to six parallel Event channels available; 4 asynchronous- and 2 synchronous
• Channels can be configured to have one triggering peripheral action and multiple peripheral users
• Peripherals can directly trigger and react to Events from other peripherals
• Events can be sent and/or received by most peripherals, and by software
• Works in active mode and standby sleep mode

 

14.2 Overview
The Event System (EVSYS) enables direct peripheral-to-peripheral signaling. It allows a change in one
peripheral (the Event Generator) to trigger actions in other peripherals (the Event Users) through Event
channels, without using the CPU. It is designed to provide short and predictable response times between
peripherals, allowing for autonomous peripheral control and interaction, and also for synchronized timing
of actions in several peripheral modules. It is thus a powerful tool for reducing the complexity, size, and
execution time of the software.

 

A change of the Event Generator's state is referred to as an Event, and usually corresponds to one of the
peripheral's interrupt conditions. Events can be directly forwarded to other peripherals using the
dedicated Event routing network. The routing of each channel is configured in software, including event
generation and use.

 

Only one trigger from an Event generator peripheral can be routed on each channel, but multiple
channels can use the same generator source. Multiple peripherals can use events from the same
channel.

 

A channel path can be either asynchronous or synchronous to the main clock. The mode must be
selected based on the requirements of the application.

 

The Event System can directly connect analog and digital converters, analog comparators, I/O port pins,
the real-time counter, timer/counters, and the configurable custom logic peripheral. Events can also be
generated from software and the peripheral clock.

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Tue. Feb 27, 2018 - 10:47 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just an observation:

The ADC doesn't generate events, it only accepts them (and starts a conversion). So it's not possible to simulate free running mode using the event system.

If the ADC generated a conversion complete event, we could connect it to itself through the event system.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Once again a topic is result of  faulty, incomplete datasheet...

Of course, Free Running Mode is supported!

All explanations to this mode as described for ATTiny2/4/814

have been deleted in 1614 datasheet, incomprehensibly.

My code using Free Running Mode and including nice new sample accumulation

works perfectly :)

 

El Tangas wrote:

Just an observation:

The ADC doesn't generate events, it only accepts them (and starts a conversion). So it's not possible to simulate free running mode using the event system.

If the ADC generated a conversion complete event, we could connect it to itself through the event system.

 

As shown in datasheet's event system section ADC doesn't generate events.

But "simulation" of free running mode is possible if periodic timer events are used to trigger ADC conversions.

Luckily that is unnecessary...

Last Edited: Sat. Mar 3, 2018 - 06:35 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yup, it seems the Ministry of Truth at Atmel decided that there never was a free running modeindecision

 

 

In fact they went so far that they removed the usual information present in reserved bits...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So, how does one trigger the ADC in software? Is setting STARTEI in EVCTRL sufficient (assuming that it is enabled, has a clock, and such)? How does software detect that a new conversion is ready?

 

Thanks

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Sat. Mar 3, 2018 - 08:08 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

El Tangas wrote:
Yup, it seems the Ministry of Truth at Atmel decided that there never was a free running modeindecision
Did you try to set the freerun bit to one and see if it worked, see post #3.  I may get to that later in the weekend.

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It seems the OP already confirmed that it works. See the post marked as solution.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

El Tangas wrote:

It seems the OP already confirmed that it works. See the post marked as solution.

Yeah, that's great, I did miss that post!

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is setting STARTEI in EVCTRL sufficient

I've not worked with this chip yet, but it sounds a lot like the Xmegas.

 

I think, however, you are getting ahead of yourself.

 

Think of the Event System as an optional system that allows some peripherals to pass data in the background, without direct core-micro intervention/processing.

 

One would, I think, first write a test program or two for the peripheral using the "usual" method, where the micro reads, processes, and writes data based upon an interrupt trigger, (or directly, without even using interrupts).

 

Once that works, then one could experiment with assigning peripherals to an Event channel, and letting the Event System process the data transfers in the background.

 

JC 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

Is setting STARTEI in EVCTRL sufficient

One would, I think, first write a test program or two for the peripheral using the "usual" method, where the micro reads, processes, and writes data based upon an interrupt trigger, (or directly, without even using interrupts).

 

Once that works, then one could experiment with assigning peripherals to an Event channel, and letting the Event System process the data transfers in the background.

Good advice!  I haven't done any ADC testing, with or without the event system, on the ATtiny1616 yet, think I'll give it a shot.  I have used EVSYS with other peripherals and think it's capabilities are awesome.

 

Jim will have his ATmega4809 soon, he can play with EVSYS on it.

 

 

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius