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 CCS Technical Support

How to do 10 channels analog output?

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



Joined: 19 Jul 2004
Posts: 42
Location: Malaysia, PJ

View user's profile Send private message Send e-mail

How to do 10 channels analog output?
PostPosted: Sun Oct 02, 2005 8:28 pm     Reply with quote

I am using PIC 16F876, PCM compiler 2.7

I need to output 10 channels of analog signal simultaneously. Each sampling rate is 250Hz, and 8-bit resolution.

Any suggestion how I can do that? Thanks in advance.
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Sun Oct 02, 2005 8:58 pm     Reply with quote

How much delay can between the outputs can you tolerate? Do you want all the outputs to update one the same edge?

Analog Devices, Linear Technology, Maxim and Texas Instruments makes a bunch of serial DACs, which will fit your spec. I would recomment I2C or SPI.

Nick

P.S. Unfortunately DigiKey's parametric search doesn't allow to filter by the number of channels.
Joshua Lai



Joined: 19 Jul 2004
Posts: 42
Location: Malaysia, PJ

View user's profile Send private message Send e-mail

PostPosted: Sun Oct 02, 2005 9:19 pm     Reply with quote

I am thinking of using multiplexer on one DAC output, then multiplex the output to the 10 channels one.

Possible to update 10 channels together? You mean using 10 channels DAC? Update 10 channels together using an edge trigger? Is it very expensive?

I am doing student project, so cost is limited.
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Sun Oct 02, 2005 9:44 pm     Reply with quote

Joshua Lai wrote:
I am thinking of using multiplexer on one DAC output, then multiplex the output to the 10 channels one.

Confused I am... Confused But I guess, that you are talking about multiplexin an output of a single DAC. If you want the DAC voltage to hold on all of the 10 outputs between the updates, then multiplexor alone will not work - you need sample&hold or track&hold.

Joshua Lai wrote:
You mean using 10 channels DAC?

Yes, that's what I thought of initially - 10-ch DAC or several smaller DACs. There are many different types of DACs. The cheapest multichannel DACs are really single-channel DACs with multiplexors and sample&holds [EDIT: on one DAC chip].

By the way, what's your project?


Last edited by kender on Mon Oct 03, 2005 12:41 am; edited 1 time in total
Joshua Lai



Joined: 19 Jul 2004
Posts: 42
Location: Malaysia, PJ

View user's profile Send private message Send e-mail

PostPosted: Sun Oct 02, 2005 11:41 pm     Reply with quote

My project is patient simulator. Need to output biological signals such ecg. For 12-lead ecg, I need 10 channels of different waveform signal.

Can I just put multiplexer without sample-hold? What will happen to the output? Fall immedialy after I switch to another channel?

I bought one sample-hold LF398 form National semiconductor, which cost about half price of my PIC 16F876.

If I have to use 10 sample-hold, any cheaper alternative?
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Mon Oct 03, 2005 12:35 am     Reply with quote

Joshua Lai wrote:
My project is patient simulator. Need to output biological signals such ecg. For 12-lead ecg, I need 10 channels of different waveform signal.

OK, so, I guess, there is no need to output the voltages really simultaneously.

If you think that parts cost you too much, you can try to order samples. Maxim, Microchip (which, by the way ships from Malasia), Analog and TI are particularly good for getting samples (at least in the US). I'm in the medical device field myself, and getting parts is often the longest part of the project.

Joshua Lai wrote:
Can I just put multiplexer without sample-hold? What will happen to the output? Fall immedialy after I switch to another channel?

Exactly.

Joshua Lai wrote:
If I have to use 10 sample-hold, any cheaper alternative?

Use multi-channel DAC(s). Since you have I2C in your system already, check out these I2C DACs:

- MAX519 (2-ch), MAX521 (8-ch), Maxim, DIP package available
- DAC5573 (4-ch), Texas Instruments, TSSOP, although quite a bit cheaper.

In general DACs cost on the order of a PIC. At least I haven't found my favorite cheap DAC yet.
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Mon Oct 03, 2005 1:20 am     Reply with quote

If you want a really cheap DAC, although not a very accurate one, you can build one for $0.20 per channel. Smile Check out these:

http://www.ccsinfo.com/forum/viewtopic.php?t=22946&highlight=dac
http://centauri.ezy.net.au/~fastvid/picsound.htm
Joshua Lai



Joined: 19 Jul 2004
Posts: 42
Location: Malaysia, PJ

View user's profile Send private message Send e-mail

PostPosted: Mon Oct 03, 2005 11:23 pm     Reply with quote

Oh! That cute 1-bit picsound. Very Happy

I already gave up about it, because his free encoder software not work on Windows XP. Then I also don't know how to copy his code into C program. For instant, RETLW '01010101' ??

I got a simple method, connecting 8 resistors on a port. Now i am doing that. But one channels use up a whole port already.
Joshua Lai



Joined: 19 Jul 2004
Posts: 42
Location: Malaysia, PJ

View user's profile Send private message Send e-mail

PostPosted: Mon Oct 03, 2005 11:36 pm     Reply with quote

I tried multiplexer CD4015 from national semiconductor.

www.national.com/pf/CD/CD4051BC.html#Datasheet

I multiplex a sinewave and a triangular wave in my program then output on PIC. I use another pin to trigger the CD4015.

I tried to trigger manually and it works well. Maybe CD4015 cannot support fast switching? The datasheet stated the on/off time is less than 1us.

I output high to channel select pin A, delay 100 us.
Then output analog signal to common in/out, dalay 100 us.

I found that the mixed signals at channel 1 of CD4015, but nothing on channel 2.
Joshua Lai



Joined: 19 Jul 2004
Posts: 42
Location: Malaysia, PJ

View user's profile Send private message Send e-mail

PostPosted: Mon Oct 03, 2005 11:46 pm     Reply with quote

I can make a sample hold using op-amp right? I read that just put a capacitor with a voltage follower. Then what op-amp is suitable?
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Tue Oct 04, 2005 1:23 pm     Reply with quote

Joshua Lai wrote:
I can make a sample hold using op-amp right? I read that just put a capacitor with a voltage follower. Then what op-amp is suitable?

Yes, you can. I guess, for your purpose any OpAmp will do, and your choice is limited only by power supply voltages.
SherpaDoug



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

View user's profile Send private message

PostPosted: Tue Oct 04, 2005 1:55 pm     Reply with quote

Joshua Lai wrote:
I can make a sample hold using op-amp right? I read that just put a capacitor with a voltage follower. Then what op-amp is suitable?

For any decent performance it should be an op amp with low input current, something with a FET input
_________________
The search for better is endless. Instead simply find very good and get the job done.
Joshua Lai



Joined: 19 Jul 2004
Posts: 42
Location: Malaysia, PJ

View user's profile Send private message Send e-mail

PostPosted: Tue Oct 04, 2005 11:18 pm     Reply with quote

Any suggestion for what opamp?
Joshua Lai



Joined: 19 Jul 2004
Posts: 42
Location: Malaysia, PJ

View user's profile Send private message Send e-mail

PostPosted: Tue Oct 04, 2005 11:20 pm     Reply with quote

Do I need to change to any fast switching multiplexer? Any cheap example?
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