Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

AVR8 ADC - Conversion Time

2 posters

Go down  Message [Page 1 of 1]

1AVR8 ADC - Conversion Time Empty AVR8 ADC - Conversion Time Sun May 28, 2023 4:05 am

KerimF

KerimF

In SimulIDE_1.0.0-R1182_Win32, AVR ADC conversion time (free running 13 cycles) was fixed. For example, at 8MHz and prescaler 1/64, time=104us (ATmega8).

In SimulIDE-R1677_Win32, the ADC conversion time is doubled.



Last edited by arcachofo on Sun May 28, 2023 4:38 pm; edited 1 time in total (Reason for editing : Mark as solved (green color))

2AVR8 ADC - Conversion Time Empty Re: AVR8 ADC - Conversion Time Sun May 28, 2023 7:12 am

arcachofo

arcachofo

I can't reproduce the issue.

In both versions I get 832 cycles = 104 us.
Indeed both implementations are identical.

3AVR8 ADC - Conversion Time Empty Re: AVR8 ADC - Conversion Time Sun May 28, 2023 10:59 am

KerimF

KerimF

arcachofo wrote:I can't reproduce the issue.

In both versions I get 832 cycles = 104 us.
Indeed both implementations are identical.

I will re-check it.

I didn't attach the code because it is somehow big.
When I run it with SimulIDE-R1677_Win32, I noticed the time was about 208us between two ADC readings.

So, I run the same code again but by using the old version, SimulIDE_1.0.1-R1386_Win32 (which is obsolete now), and the conversion time became 104us as expected.

Sorry, when I said:
"In SimulIDE_1.0.0-R1182_Win32, AVR ADC conversion time was fixed", I just took it from your fixed bugs list of that version. I didn't test the code by using it.

So, in case I will be able to reproduce it with a smaller code (made for this check), I will attach the necessary files as usual.

arcachofo likes this post

4AVR8 ADC - Conversion Time Empty Re: AVR8 ADC - Conversion Time Sun May 28, 2023 12:37 pm

KerimF

KerimF

On the attached code ‘ADCtime_v1.asm’, I set a breakpoint at line 631:

   SBI   b_ADIF                ; cleared by 1

The time between two readings is 208 us.

AVR8 ADC - Conversion Time Adctim10
Attachments
AVR8 ADC - Conversion Time AttachmentADCtime_v1.zip
You don't have permission to download attachments.
(47 Kb) Downloaded 2 times

5AVR8 ADC - Conversion Time Empty Re: AVR8 ADC - Conversion Time Sun May 28, 2023 1:55 pm

arcachofo

arcachofo

Thanks.
The problem is not about ADC conversion time, is about Interrupts.
Solved at Rev 1680.

You can fix it yourself:
Edit file resources/data/AVR/mega8/mega8_int.xml line 17.
From this:
Code:
<interrupt name="ADC" enable="ADIE" flag="ADIF" priority="5" vector="0x00E"/>
To this:
Code:
<interrupt name="ADC" enable="ADIE" flag="ADIF" priority="5" vector="0x00E" clear="1"/>

6AVR8 ADC - Conversion Time Empty Re: AVR8 ADC - Conversion Time Sun May 28, 2023 2:46 pm

KerimF

KerimF

Fixed, thank you.

arcachofo likes this post

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum