Modular dac project with micro controller and lcd - diyAudio
Go Back   Home > Forums > Source & Line > Digital Source

Digital Source Digital Players and Recorders: CD , SACD , Tape, Memory Card, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 21st December 2006, 03:21 PM   #1
cviller is offline cviller  Denmark
diyAudio Member
 
cviller's Avatar
 
Join Date: Dec 2005
Location: Copenhagen
Blog Entries: 2
Default Modular dac project with micro controller and lcd

Time for a new project and a change of course for me. I have implemented a few dacs, but I have too many ideas so the only way to try everything is to make it more modular.
At some point I would like to make my own pll circuit and insert it between receiver and dac, so separate boards will make this much easier to test. But for now I will just have some fun with different chips.

I plan to use cs8416 and perhaps dix4192 as receiver.

My current list of dacs I plan to try out:
pcm1738
ad1955
I might try pcm1796 and ad1853 too, but I have high hopes for the ad1955 chip so I might stop there.

The chips will be controlled with a micro controller and I have selected at89s51 because it is cheap an has many io ports. It needs to control the chips but besides that it will control a lcd display, attenuator and input selector (I plan to make it compatible to the twistedpairaudio relay boards).

I have attached a draft schematics for the micro controller board. I hope some people in here would be interested in my project and give me comments and suggestions.
Attached Files
File Type: pdf atmelboard.pdf (35.9 KB, 193 views)
  Reply With Quote
Old 24th December 2006, 08:51 AM   #2
cviller is offline cviller  Denmark
diyAudio Member
 
cviller's Avatar
 
Join Date: Dec 2005
Location: Copenhagen
Blog Entries: 2
I have changed the schematics slightly and made the layout 160x100 mm single sided.

The board should be very useful as a development board because the atmel chip supports "in system programming". In order to program the chip on board, the only thing you need is an old printer cable. I use an at89s51, but at89s52 or at89s53 should also work just fine (they have more flash memory).
Attached Files
File Type: pdf atmelboard.pdf (36.9 KB, 95 views)
  Reply With Quote
Old 24th December 2006, 09:44 AM   #3
diyAudio Member
 
gbyleveldt's Avatar
 
Join Date: Jun 2006
Hi Cvillier,

If I may, can I make a couple of suggestions?

1. Why are you using the serial to parallel shift register followed by a 8 way flip flop? You don't need the flip flop afterwards. What I normally use is a 74HC595. With this you can string multiple shift registers together in daisy chain fashion without using more ports on your CPU. This will save you a lot of board space.

2. Instead of using discrete transistors, why don't you use a ULN2803 for driving the relays? Again, quite a saving in board space.

3. I cannot remember if the at89S51 has ADC on board, but what I would do is use a 4051 8 way analogue switch to cycle through your 8 analogue inputs, reading one value after another quite quickly. These values are fed to the on board ADC of the CPU. This will save you some money.

Again, these are only suggestions. What will you use to program the CPU with? C?

Cheers

Gert
__________________
The walls between art and engineering exist only in our minds - Theo Jansen
  Reply With Quote
Old 24th December 2006, 10:01 AM   #4
cviller is offline cviller  Denmark
diyAudio Member
 
cviller's Avatar
 
Join Date: Dec 2005
Location: Copenhagen
Blog Entries: 2
Thank you very much for your suggestions!

1. Because I don't know all the 74 family...
I just searched my local suppliers website and found 167 the first.

2. Not sure here - it might be nice to have the options of inserting larger transistors. But I'll definitely consider it! Is it capable of 500mA on all pairs at the same time? (That would be sufficient I think)

3. at89s51 does not have ADC on board. I don't actually need 8 analog inputs, but I could come in handy to measure temperatures and stuff...
Do you think I'll spend too much cpu time fetching results from the adc?

Forgot to say that I intend to use C for programming.
  Reply With Quote
Old 24th December 2006, 11:01 AM   #5
cviller is offline cviller  Denmark
diyAudio Member
 
cviller's Avatar
 
Join Date: Dec 2005
Location: Copenhagen
Blog Entries: 2
I found the parts for your suggestions 1 and 2. I think that will make the layout a lot nicer - thanks!
Attached Files
File Type: pdf atmelboard.pdf (27.6 KB, 80 views)
  Reply With Quote
Old 24th December 2006, 12:01 PM   #6
diyAudio Member
 
gbyleveldt's Avatar
 
Join Date: Jun 2006
Hi,

Yup, that does look a lot sleeker now!

1. On the 74HC595's you should route your serial data line from pin 9 on U1 to pin 14 on U3, then pin 9 on U3 to pin 14 on U5, resulting in a daisy chained configuration. You will stream a 24bit word when talking to them in your code. Also, I would take all the pin 10's to a port on the CPU, just for in-case you need to do a master reset.

2. Pin 10 on the ULN's need to go to VCC, as these are the common lines for the internal back emf diodes. You will be sinking current for your relays, so the other ends of the relays should also go to VCC.

3. You should be able to sink 500mA on the ULN's, but I doubt you will get that for all channels driven.

4. I'm not too familiar with the ADC that you are using, so I'll have to read up a bit on that before I comment too much. As a matter of interest, I use ATMEGA CPU's, as they have all the peripherals you could ever desire. They're also pretty easy to program (in fact, a little easier than the '51s as they don't need to be 8051 compliant *my opinion of course, in C you wouldn't notice!!*) I use Mega8 and Mega16's, you might want to consider using these. They have ADC on board as well, and for 8 ADC channels I use the multiplexed switch idea that I mentioned earlier. On a Mega8 I have strung 64 AD channels and I poll them all the time, so there is more than enough horsepower.

5. What made you decide on 30pF caps on the crystal? You need to check the specs on the crystal, as I think you will be loading it too much with those big caps. I would suggest you drop those to 15pF to be safe.

I haven't gone over the circuit with a fine tooth comb, but this is what I can suggest for the moment.

Cheers

Gert
__________________
The walls between art and engineering exist only in our minds - Theo Jansen
  Reply With Quote
Old 25th December 2006, 09:04 AM   #7
cviller is offline cviller  Denmark
diyAudio Member
 
cviller's Avatar
 
Join Date: Dec 2005
Location: Copenhagen
Blog Entries: 2
Thank you again for your comments!

I will make the serial->parallell 24bit as you suggest - with the space I save I could make a 32bit version instead.

I have to admit that I just inserted the ULN without going into detail on how to connect power pins... I will go through the whole thing before I start etching. Thanks though!

Maybe I should use the mega16 instead. I bought a at89s51 because I thought I only needed digital io, but now I have to order some other parts anyways, so I could just as well pick a better microcontroller. Can mega16 be programmed "in system" using just sclk, miso, mosi, and reset?
Its many years since I programmed a mega, can you split a port to have eg. 3 outputs and 5 inputs? Or do you have to read and write the whole port each time?

According to the datasheet for at89s51, the capacitors should be 30pF +/- 10pF for crystals, so I think it should be all right.
  Reply With Quote
Old 25th December 2006, 01:30 PM   #8
diyAudio Member
 
gbyleveldt's Avatar
 
Join Date: Jun 2006
I like the Mega16. I generally use it for most of my apps. The at89s51 uses such an antiquated core that you shouldn't worry if there are things that the Mega can't do. The Mega uses JTAG with ISP and you can 'split' the port if you like. You will still be reading the whole port, but using C, you just mask off the bits you don't need. In assembler you can read the bits directly. Out of a user point of view, you will not notice any difference using C between the two micros. Except, you have WAY better peripherals. If you a real man, you will use assembler and there you will experience differences in the architecture. Nothing serious, though! For your app I suggest you stick to the free AVR studio application using the GCC C compiler. It is a very nice way to get into AVR's while saving your sanity.

I'm going on holiday on Wednesday, so if you post your schematic before then I'll gladly check it for you

Cheers

Gert
__________________
The walls between art and engineering exist only in our minds - Theo Jansen
  Reply With Quote
Old 25th December 2006, 08:22 PM   #9
cviller is offline cviller  Denmark
diyAudio Member
 
cviller's Avatar
 
Join Date: Dec 2005
Location: Copenhagen
Blog Entries: 2
I have programmed the mega before - both in C and asm, but I think I'll get the stuff working faster if I just stick to C.

I'm going on holiday too, so I won't be able to make schematics - but thanks anyways, you have been very helpful.

My plan is to change to mega16, use the analog multiplexer as you suggested and perhaps use a shift register for the display in order to save an extra io port for talking to dac chips and other interesting things.
  Reply With Quote
Old 26th December 2006, 05:30 AM   #10
diyAudio Member
 
gbyleveldt's Avatar
 
Join Date: Jun 2006
I would be careful using a serial shift register on a display, especially if you sending 32bit streams. If you are that pinched for IO, run the display in 4bit mode. It is a little more painful to get going, but shouldn't be too hard to get going. The only displays I really battled to get that working is on the Noritake VFD's. The plain Hitachi LCD's are a breeze!

Another sleek option is to use parallel registers and then you can use on 8 bit set for the display. This would use 8 IO lines for the data and one line each for every 74HT574 you use as a latch. It uses more IO than the 74HC595's, but it is quite a bit faster, especially as you are going to use Mega16's

Anyway, I suggest you sit down and make a list of all the requirements you can possibly think of and then you take the compromises that mest suit your application
__________________
The walls between art and engineering exist only in our minds - Theo Jansen
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Samsung 1602VFD For CDROM Controller & Remote Volume Controller slowgay Swap Meet 2 22nd November 2008 03:44 PM
Micro Jacks and Micro Pins for board-board connection jazzist Parts 1 12th May 2008 04:02 PM
Modular NOS DAC dsavitsk Digital Source 1 14th June 2006 04:31 PM
Project - Universal CD Controller? lgreen Car Audio 1 22nd September 2003 01:20 AM
digital filter using pic micro controller vish_zn Digital Source 16 20th March 2002 09:47 AM


New To Site? Need Help?

All times are GMT. The time now is 08:43 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2