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

ADC in SimulIde 1.0.0 without Aref pin as reference?

3 posters

Go down  Message [Page 1 of 1]

Fabian I.



Hello,

We are wondering if it is possible in SimulIde 1.0.0 to simulate the AD conversion on the atmega328 without using the Aref pin as the reference voltage. We are using both great SimulIde as well as real hardware and everything it setup to use AVcc as the reference voltage.

With the 0.4.x-series, everything worked 1:1 regarding ADC. Our goal is to still be able to simulate our real-life scenario with SimulIde. Is there a way to achieve this in version 1.0.0?

Thank you, a lot, for your great tool again, happy to hear from you.



Last edited by Fabian I. on Tue Sep 13, 2022 7:39 pm; edited 2 times in total

arcachofo

arcachofo

Hi.
In SimulIde 1.0.0 you can use ADC with any reference voltage.
If using Aref, you need to connect Aref pin to a voltage source.
Same with AVcc, you need to connect it to a voltage source.

Fabian I.



Wow that was an easy sollution Smile.
Thanks a lot!

arcachofo likes this post

Popopo

Popopo

arcachofo wrote:Hi.
In SimulIde 1.0.0 you can use ADC with any reference voltage.
If using Aref, you need to connect Aref pin to a voltage source.
Same with AVcc, you need to connect it to a voltage source.

Hi,
1. Trying to implement it, when I connect in Nano 328 its +5v pin with Aref, the circuit stop working.

Also 2 more bugs...
2. The screen (already is a feature requested) cannot be setted to another column/row size what cause some bugs.

3. Electrical lines activated when they are open and not power on them

I add some photos to show better what I mean:
ADC in SimulIde 1.0.0 without Aref pin as reference? Bug-1 ADC in SimulIde 1.0.0 without Aref pin as reference? Bug-2

ADC in SimulIde 1.0.0 without Aref pin as reference? Bug-open-lines

arcachofo

arcachofo

1. Trying to implement it, when I connect in Nano 328 its +5v pin with Aref, the circuit stop working.
You are not connecting Aref to +5v, you are connecting to a zener diode.

The source of +5v is the Arduino "5v" pin.
Adding that zener diode is an error.

If you want to use +5v as voltage reference you don't need Aref.

2. The screen (already is a feature requested) cannot be setted to another column/row size what cause some bugs.
That is not a bug, the size of that screen is 128x64.


3. Electrical lines activated when they are open and not power on them
An unconnected wire can have any voltage respect to ground.
In any case I can't reproduce the issue, if you share your circuit I can have a look.

Popopo likes this post

Popopo

Popopo

arcachofo wrote:
An unconnected wire can have any voltage respect to ground.
In any case I can't reproduce the issue, if you share your circuit I can have a look.

Good morning, I have taped a video to explain and show some "issues" and explain some requests.

Also here I have attached the files to test the issues.

The video is ready: https://youtu.be/BR8qiPFJv_Q

Note: in the type of files allowed to attach... Sim1 is not included. Rolling Eyes
Note2: The circuit was developed in previous versions and now modified and ran into the last release.

Thank you for your work
Attachments
ADC in SimulIde 1.0.0 without Aref pin as reference? AttachmentTester.zip
Archivos tomados de la versión SR0
You don't have permission to download attachments.
(41 Kb) Downloaded 1 times

arcachofo

arcachofo

Hi.
The first problem I see is about +5 V.
I'm not sure what do you expect, just in case I explain a few things:
This is a Tunnel, it doesn't provide you 5V, it just connect different parts of the circuit.

ADC in SimulIde 1.0.0 without Aref pin as reference? Kk16

To get a voltage source you can use a Rail component (or 5V Pin in Arduino Nano).

The 5V Pin in Arduino Nano is an output, not an input.
You can get 5 V from this Pin.
Arduinos are powered "internally".

If you remove that zener diode and connect "+5V" Tunnel directly to 5V Pin in Arduino Nano, voltages should be Ok.


About Voltage Regulators:
You need a higher voltage in the input to get some voltage at the output.
You can't get 12 V from 5 V.


About Tunnels "Rotated":
Seems that there is a problem opening circuits from previous releases.
Solved at Rev 1352.


About SSD1306:
In this version of Simulide display size is always 128x64 pixels.
In development version you ca resize it.

I think you can use it with your code, but you need to reset the address by software.


At around 2:00 you talk about certain lines "activated":
Red and blue colors indicate logic states: >2.5 V or <2.5V.

Popopo likes this post

Popopo

Popopo

arcachofo wrote:Hi.
The first problem I see is about +5 V.
I'm not sure what do you expect, just in case I explain a few things:
This is a Tunnel, it doesn't provide you 5V, it just connect different parts of the circuit.
...

Good morning,
I have recorded another video where I explain and show (this time with a pointer) the different parts of your answer and what I meant in my first message.

Hope it will be useful for understanding.
There are some concepts that I didn't get due to lack of experience.

https://youtu.be/yr0zp1049o0

arcachofo

arcachofo

Thank for the video, now I understand better the circuit.

As a general rule and specially if you are testing the firmware, it is better to keep the circuit as simple as posible and don't add components unless it is really needed.

- SSD1306:
You can try the development version: https://simulide.forumotion.com/t550-simulide-trunk-tester-builds
In that version you can resize the display.


- Diode:
The diode in the original circuit (SB140) seems to be an Schottky diode, not a Zener.
Removing it solves the weird voltage issue, but this is a problem in Simulide.
This issue seems to be solved in development version, but I will try to fix it in 1.0.0.

You don't need to protect the Arduino Nano in the simulation.
So if it is not really needed then better don't use it.
If you really need it, there are ways to fix the problem, but maybe better to just use the development version.


- Voltage regulators:
What you are using in the circuit are voltage regulators (like 7805), not voltage converters.
If you need 12 V and -5 V, you can just use Rails.

Popopo

Popopo

arcachofo wrote:
- SSD1306:
You can ... can resize the display.
Thank you Smile I will try it.

arcachofo wrote:
- Diode:
The diode in the original circuit (SB140) seems to be an Schottky diode, not a Zener.
Removing it solves the weird voltage issue, but this is a problem in Simulide.
This issue seems to be solved in development version, but I will try to fix it in 1.0.0.
You are right, sorry for mistake naming it Zener instead Schottky.
I would like to test the circuit as close to the real one as possible.
So again, thank you, I will try your last version.


arcachofo wrote:
You don't need to protect the Arduino Nano in the simulation.
...but maybe better to just use the development version.
Same like last point & again, thank you Smile


arcachofo wrote:
- Voltage regulators:
What you are using in the circuit are voltage regulators (like 7805), not voltage converters.
If you need 12 V and -5 V, you can just use Rails.
Oh! really? sorry for my mistake. Voltage converters sometimes (almost always) put some noise into the circuit, I wanted to get it as closed as possible but not important. I will change them to Rails then.
One more time, thank you Smile

arcachofo

arcachofo

The error with weird voltages was caused by the Voltage Regulator.
Solved at Rev 1353.

Also another minor issue with switches solved at Rev 1354.

Popopo 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