How do smartpin DAC modes work?
twm47099
Posts: 867
in Propeller 2
I am trying to understand the smartpin DAC mode, but have not been very successful.
Assume that I want to output a specific voltage 0.5 to 3.0V on a specific pin. I would want to use one of the DAC modes, but
What is the difference between the 3 modes? (How would I decide which to use?)
What are the values for the following commands?
wrpin
wxpin
wypin
The documentation states that %DDDDDDDD = DAC level.
How do I calculate %DDDDDDDD from the desired voltage? (for example 2.5v = ??)
An example would be appreciated.
The documentation states that %TT “for DAC smart pin modes (%MMMMM = %00001..%00011):
0x = OUT enables ADC in DAC_MODE, P[7:0] overriden
1x = OTHER enables ADC in DAC_MODE, P[7:0] overridden”
How is ADC being used in the DAC modes (I’m completely confused by this. Does it mean I can use the DAC mode to do ADC instead of using the sigma delta smartpin mode? How?)
I appreciate your help, and I know I will have more questions.
Thanks
Tom
Assume that I want to output a specific voltage 0.5 to 3.0V on a specific pin. I would want to use one of the DAC modes, but
What is the difference between the 3 modes? (How would I decide which to use?)
What are the values for the following commands?
wrpin
wxpin
wypin
The documentation states that %DDDDDDDD = DAC level.
How do I calculate %DDDDDDDD from the desired voltage? (for example 2.5v = ??)
An example would be appreciated.
The documentation states that %TT “for DAC smart pin modes (%MMMMM = %00001..%00011):
0x = OUT enables ADC in DAC_MODE, P[7:0] overriden
1x = OTHER enables ADC in DAC_MODE, P[7:0] overridden”
How is ADC being used in the DAC modes (I’m completely confused by this. Does it mean I can use the DAC mode to do ADC instead of using the sigma delta smartpin mode? How?)
I appreciate your help, and I know I will have more questions.
Thanks
Tom
Comments
http://forums.parallax.com/discussion/170060/smart-pin-dac#latest
its the wrpin and enable you need to wrangle, they aren't true smartpin modes so no wxpin nor wypin required
look forward to the other questions
- Direct setting the level in the pin config. (DAC_MODE)
- Comparator preset level. (COMP_DAC)
- OUT toggling between two levels. (BIT_DAC)
- Smartpin modes 1,2 and 3. Modes 2 and 3 extend to 16-bit with an 8-bit dither. (SMART_DAC)
- Cog SETDACS channels and streamer DAC channels. (COG_DAC)
That's eight configurable ways to chose from for each DAC.
PS: I wouldn't be surprised if I've missed one. PPS: Yes, I suspect, all the smartpin and streamer data can be used with the comparator too. So that's another five odd theoretical choices.
Regarding using the ADC at the same time as the DAC, this is a special feature that can turn on the ADC and measure the external load experienced by the DAC. It will come in handy for things like detecting connected monitors and devices, current drawn by external circuits, etc.
Thanks for the info.
Do the smart pin DAC modes 00010 (16-bit with pseudo-random dither) and 00011 (16-bit with PWM dither) have 65,535 voltage steps? Or am I not understanding the title of the modes?
Regarding the ADC with the DAC, is the ADC read on a different pin than the DAC?
The 16-bit DAC modes dither the 8-bit DAC between two adjacent levels. Actually, unique output values range from $0000..$FF00. The last 255 steps don't exist because the 8-bit DAC can't go higher than $FF. There's no 'next' level to dither to. So, there are $10000-$FF output levels possible, which amount to 65,281, yielding a step size of 50.55uV (3.3V / 65,821).
The ADC and DAC can operate simultaneously on the SAME pin.
The smartpins are somewhat loosely tied to the physical pins. Each physical pin has one ADC, one DAC and one associated smartpin. If you want to use the smartpin to control the DAC, and the ADC to also go to a smartpin then the ADC would have to be directed to a neighbouring smartpin. A streamer can run the ADC though.
Or the DAC can be run from a streamer or cog. Then the smartpin can run the ADC without using another smartpin.
It was mostly free to add the ADC summing.
Man, we need some nice way to make block diagrams.
Both Libre Office Draw and Pencil Project (https://pencil.evolus.vn/) has a nice set of features and are actively maintained by their respective communities.
If yet unknown to many, perhaps some could try one or both and report back their personal opinions about them.
Hope it helps
Henrique
As for LibreOffice Draw, perhaps you can try Mark Lautman's freely available logic gates and electrical engineering/schematic drawing shapes. I believe they'll mostly suit all the needs, without having to rely on text-derived shapes.
lautman.net/mark/coo/index.html
Hope it helps
Henrique
When I'm in a hurry and wanna only the visual results, says, to clarify some point, I tend to rely on Digikey's SchemeIt for schematics. It mostly spares me from creating/searching for a lot of shapes and package drawings and works right there in my preferred browser (Firefox).
Connector lines want to join to Connection Points on Shapes.
Pick a good font and size (8 point is good) and a good line weight and stick to that style.
The hardest part of the learning curve is to understand snap & glue and know what to turn off. Page Auto Size being the very first thing you turn off.
I am not knocking my suggestion and I think Visio is very good for block diagrams, but in the newer version the arrangement of the Ribbon makes it seem more confusing than it needs to be. Visio 2007 and 2010 was basically perfect in terms of what was shown, and what was accessible from a dropdown menu on top. It's still manageable and you can put a bunch of commonly used functions back on the "Quick Access Toolbar" instead of flipping thru ribbon tabs.
Creating blocks of any size is easy.
Duplicating sections. Draw lines or draw connections, etc.
Comes with a base library and is easy to create your own using an existing one as a base, or from scratch.
At this stage I'm on other projects again so will be some time before getting back to it.