CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Auto increment/decrement of value in DAC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
aaronik19



Joined: 25 Apr 2011
Posts: 297

View user's profile Send private message

Auto increment/decrement of value in DAC
PostPosted: Tue Jul 02, 2013 3:53 pm     Reply with quote

Do someone know about an i2c DAC which accepts command to start decrease the value automatically and just after reached the needed value, another command will stop the process ? The same process will be done to increase the value?

Thanks
Ttelmah



Joined: 11 Mar 2010
Posts: 19350

View user's profile Send private message

PostPosted: Wed Jul 03, 2013 2:58 am     Reply with quote

Just use a PIC......

I doubt if anyone would have done something so special and 'odd'. A lot depends on what you actually 'want' from the DAC. You could (for instance), use one of the basic 8pin PIC's with internal clock, I2C, and PWM, and synthesise a DAC with the latter (assuming reasonable output filtering). However if you require a genuine 'resistive' DAC, without the noise problems associated with PWM, then you have to go a little more 'up market', on the PIC. PIC16F1782, gives MSSP, DAC, and internal oscillator, so can do this easily.

Best Wishes
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Wed Jul 03, 2013 3:55 am     Reply with quote

I agree with Ttelmah.

Think about it.
With your scheme you have to monitor the DAC to know when to tell it to stop ramping.

You have to send two commands anyway, so why not send:-

1) End value you want ramp to stop at.
2) Rate at which to ramp.

Using a PIC, the target works out which way to ramp, then gets on with it.

Mike
Ttelmah



Joined: 11 Mar 2010
Posts: 19350

View user's profile Send private message

PostPosted: Wed Jul 03, 2013 7:15 am     Reply with quote

Even better, you could upload a table of output values, and a speed, and leave it to synthesise a waveform for you.... Smile

Best Wishes
oxo



Joined: 13 Nov 2012
Posts: 219
Location: France

View user's profile Send private message

PostPosted: Wed Jul 03, 2013 9:32 am     Reply with quote

Ttelmah wrote:
Even better, you could upload a table of output values, and a speed, and leave it to synthesise a waveform for you.... Smile

Best Wishes


Or do it in hardware.

A oscillator, a binary counter, an R-2R network, a buffer amp. Et voila!
Ttelmah



Joined: 11 Mar 2010
Posts: 19350

View user's profile Send private message

PostPosted: Wed Jul 03, 2013 12:31 pm     Reply with quote

A counter generally costs more than a PIC these days....
Thing is you can add so much extra if you want. Auto stop at a programmed level, variable rate, etc., much cheaper with the processor.
It's terrible, but a simple CMOS divider costs more than a processor.

Best Wishes
aaronik19



Joined: 25 Apr 2011
Posts: 297

View user's profile Send private message

PostPosted: Wed Jul 03, 2013 3:24 pm     Reply with quote

in one of the forums I read about a PCA9685 16 channel PWM. Infact at the end I need about 8-10 channels of PWM. But following your comments I can have one PWM and a multiplexer to feed those channels. Right?

I think that the problem is that the PIC must handle other operations in parallel with PWM. It is going to have also RTC and RS485 where the latter one will be busy very frequently. That's why I am looking for a DAC which the PIC must give one start and stop commands. I had already made PWM where I have a counter looping and on every overflow, it will adjust the PWM accordingly. But these will compromised the RTC and RS485
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Wed Jul 03, 2013 5:38 pm     Reply with quote

Quote:
I can have one PWM and a multiplexer to feed those channels. Right?


NO NO NO!!
If you believe that, you are in way over your head logically

NOT TRUE unless you are cool with only modulating ONE channel at a time and then having all the other channels with NO PWM drive at all.
--------------------------
all i see in the OP is TALK and wishful thinking to get somewhere ,
BUT there is more needed from YOU!

got a design schematic , at ANY level of function?

got any CODE to begin the core of the project?

got ANYTHING to SHOW, beyond your partially defined goals?


There is just not enough effort on your part exhibited yet
to get started with a framework for what you seek.

Honestly, without more of a sense of how to go about this project
( which is so loosely described as to be incoherent)
how is anybody going to know where to start?
( when you don't seem to know yourself)
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Fri Jul 05, 2013 2:10 pm     Reply with quote

aaronik19 wrote:
I can have one PWM and a multiplexer to feed those channels. Right?

asmboy is mostly right. It depends on what you want the channels to do when they are not selected. If you just use a digital multiplexer the non-selected channels will all go to zero or to full depending on how you wire things. That might be what you want. Or you could use analog track-and-hold circuits to hold the non-selected channels at stable voltages but the cost and complexity will be high.

We really don't know enough about your application to help you further. You have to give us more to work with.
_________________
The search for better is endless. Instead simply find very good and get the job done.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group