|
|||||||
| Home | Forums | Rules | Articles | Store | Gallery | Blogs | Register | Donations | FAQ | Calendar | Search | Today's Posts | Mark Forums Read | Search |
| Chip Amps Amplifiers based on integrated circuits |
|
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 |
|
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
diyAudio Member
Join Date: Mar 2010
|
Hi,
there are some threads on controlling DS1802 with IR or Rotary encoders. I Plan to command the DS1802 with RS232 commands (out of a linn Player). Now , the ATmega has an SPI out , that could Control the 3wire Serial Input of the DS1802 (RST, CLK, D Inputs). Can anyone help me, how to generate the Serial commands in the ATmega32, that the DS needs to see? Thanks a Lot, Frank |
|
|
|
#2 |
|
diyAudio Member
Join Date: Dec 2007
Location: Sibiu, Romania
|
You can simply send raw hex values over serial communication, copy the two bytes in some local variables and then send them over SPI. Be carefull with DS1802, since it has the chip select line active on high level and the bytes are sent with LSB first.
__________________
Any solution is a compromise. |
|
|
|
#3 |
|
diyAudio Member
Join Date: Mar 2010
|
Thanks,
as it´s my first uC project, I just wonder if I have to take care, that RST is "high" while the hexcode is sent and so on. In the datasheet of the DS1802 the serial controlling seems sooo complicated with the tcc, tch .... timing and the clocksynchronisation. Is it that simple, just connecting the clock out of the ATmega (XCK pin#1) to the CLK (pin#3) of the DS1802? Furthermore I would connect SCK on the ATmega (pin#7) to D(pin#4) on DS1802, SS on the ATmega (pin#4) to RST(pin#5) on DS1802 GND to GND. ...or am I missing something? Frank |
|
|
|
#4 |
|
diyAudio Member
Join Date: Jul 2004
Location: Göteborg, Sweden
|
You might get more help on avrfreaks.net, a site dedicated to AVR programming.
|
|
|
|
#5 |
|
diyAudio Member
Join Date: Feb 2004
Location: Anonymityville
|
Just curious, why the DS1802? It will need an additional buffer circuit and the signal will be limited by the 5V supply.
It's a novel circuit to play with if your just going to use push buttons, but if you plan to put the effort into using a uC then there are better IC's available.
__________________
"If you don't like funerals don't kick sand in Ninja's face." - Ninja |
|
|
|
#6 |
|
diyAudio Member
Join Date: Mar 2010
|
DS1802 because it´s used on the VCCS board for the Lightspeed attenuator, that I build.
The uC would translate the ASCII strings, that come out of the networkplayer, into commands for volume setting (and poweramp control by 12V toggle) My Ipod with PlugPlayer is an upnp controlpoint of the networkplayer and it uses a slider for Volume setting. So, when I move the slider to 87% volume, the networkplayer sends a command $Volume=87$ (the value is between 0 and 100) as ASCII code to the uC (UART RX). The uC would recognise the volume command and the value after the "=" and multiply the value by 0,64 (as the DS1802 pointer has 64 steps). Then the uC would somehow?? generate the serial commands for the RST , D and CLK inputs of the DS1802. Last edited by fbee; 15th April 2010 at 06:35 PM. |
|
|
|
#7 |
|
diyAudio Member
Join Date: Feb 2004
Location: Anonymityville
|
Ah, ok. So the signal won't be passing through the DS1802, it's just used to control the optocouplers.
Makes sense now.
__________________
"If you don't like funerals don't kick sand in Ninja's face." - Ninja |
|
|
|
#8 |
|
diyAudio Member
|
first you need to look at ATMEL documentation for TWI interface, there is an AVR document for ..how to's of TWI.
You can also have a look at the documentation of IC's like TDA7449 that use the TWI inteface for controlling. The datasheet of TDA 7449 in fact carries a lot of information regarding how to send signals over TWI and how to send address etc. Have a look at this also www.atmel.com/dyn/resources/prod_documents/doc2564.pdf |
|
|
|
#9 | |
|
diyAudio Member
Join Date: Dec 2007
Location: Sibiu, Romania
|
Quote:
D (pin 4) goes to MOSI (pin 6) CLK (pin 3) goes to SCK (pin 8) RST (pin 5) goes to SS (pin 5) or any other port pin you like to use as chip select line. The power supply can be the same for both ATmega and DS. Flow of the code: - register initialization (system clock, ports, USART, SPI); - infinite loop in which data is received over USART and sent over SPI. I think this thread can be placed better in Digital Line Level section of the forums.
__________________
Any solution is a compromise. |
|
|
|
|
#10 |
|
diyAudio Member
Join Date: Mar 2010
|
Ratza,
thanks this was very helpful. I´ll try that route. Cheers, Frank |
|
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help! Encoder for DS1802 | tifosi_f1 | Solid State | 3 | 16th January 2007 12:10 PM |
| WTB: DS1802 digital pot or similar | Moose | Swap Meet | 0 | 8th July 2005 10:11 PM |
| DS1666 vs. DS1802 | dalli | Chip Amps | 0 | 10th March 2005 08:05 AM |
| DS1802 with LM3875 | soundNERD | Chip Amps | 11 | 26th February 2005 08:10 AM |
| Controlling TDA7448 with DS1802 Help Wanted | abid_rehan | Digital Source | 2 | 6th September 2004 04:55 PM |
| New To Site? | Need Help? |