//----------------------------------------------------------------------------- // Documentation File..: CDCRemote_Description.TXT //----------------------------------------------------------------------------- // Description.........: Functional description of CDC Remote //----------------------------------------------------------------------------- // Author..............: Matthias Klumpp //----------------------------------------------------------------------------- -------------------------------------------------------------------------------- Basic Schematic: -------------------------------------------------------------------------------- Atmel AT90S2313 +----+ +-----------------+ Vcc----| R1 |-----1|!Reset (SCK) PB7|19--+ +----+ | (MISO)PB6|18 | | (MOSI)PB5|17 | GND-----||--------+--------4|XTAL2 PB4|16 | C1 | | | | --- | (OCI) PB3|15 | see note below +-+X1 | | | +-+ | | | --- | | | C2 | | | | GND-----||--------+--------5|XTAL1 PB2|14 | | (AIN1)PB1|13 | Vcc--+----+-------20|VCC (AIN0)PB0|12--+ | | +-10|GND | C3--- ---C4 | | (ICP) PD6|11 --- --- | | (T1) PD5| 9 +------ Data In | | | | (T0) PD4| 8-------+ (from CDC) | | | | (INT1)PD3| 7-------------- Clock GND GND GND | (INT0)PD2| 6-------------- Data Out | (TXD) PD1| 3-------+ (to CDC) | (RXD) PD0| 2----+ | +-----------------+ | +------ TX Data +--------- RX Data R1: 10k C1: 27p C2: 27p C3: 47u C4: 100n X1: 7.3728MHz crystal Note that X1 MUST be a 7.3728MHz crystal, because the signal timing done by the SW is tuned to that frequency. -------------------------------------------------------------------------------- Signal description: -------------------------------------------------------------------------------- Vcc...............: Positive supply voltage for uC (typically 5V) GND...............: Ground - Must be connected to "Data GND" of CDC Data In (from CDC): Data signal from CDC Clock.............: Clock signal Data Out (to CDC).: Remote control signal to CDC (5V voltage level) - This output is possibly not able to drive the line to the CDC directly, use a TTL line driver in that case. - The CDC expects a voltage of 5V at its input pin. PB0-PB7...........: - Port B is only used in case the remote is operated with push buttons (see logical table below). - If port B is not used, you should connect the pins PB0-PB7 to Vcc to prevent the SW capturing any peaks to GND. TX Data...........: Serial data back to the serial controlling device (5V voltage level in case Vcc=5V) RX Data...........: Serial data to control the CDC-Remote (5V voltage level in case Vcc=5V) Note..............: - TX/RX Data can not be connected directly to a PC - A RS232 level converter (e.g. MAX232) has to be used for that. - Any other serial device (e.g. other micro controller) can communicate with the RX/TX data lines directly, if it uses the same Vcc. -------------------------------------------------------------------------------- Connection to Panasonic CDC Colors taken from my VW Passat year 11/2002 (may be different in other cars) ----------------------------------------------------------------------------- | CDC Connector | | (solder side) | |Pin Pin| -------------------+--------------------+------------------- +--------------------+ Clock --------| 2 1 |-------- Data In |(black) (orange)| (from CDC) | | Data Out --------| 4 3 |-------- Data GND (to CDC) |(brown) (violet)| | | Power +12V --------| 6 5 |-------- nc |(yellow) nc| | | CDC Power --------| 8 7 |-------- Audio Right Control |(grey) (red)| | | Audio Left --------|10 9 |-------- Audio GND |(white) (black)| | | nc --------|12 11 |-------- nc |nc (blue)| +--------------------+ Clock.............: To be connected to: Pin 7 of uC Data In...........: " " " " : Pin 8 of uC Data Out..........: " " " " : Pin 6 of uC Data GND..........: " " " " : Pin 10 of uC Power +12V........: " " " " : The car's 12V permanent power CDC Power Control.: " " " " : A 12V source that switches on CDC Audio Left........: " " " " : Left channel input of any AUX-IN Audio Right.......: " " " " : Right " " " " " Audio GND.........: " " " " : Audio GND " " " ------------------------------------------------------------------------------- RXD Communication: External serial transmitter -> CDC Remote ------------------------------------------------------------------------------- Serial protocol parameters..: 9600 Baud 8 Data Bits 1 Stop Bit no parity LSB first Voltage level on RXD/TXD pin: Vcc ------------------------------------------------------------------------------- Serial Communication to "CDC Remote" Serial command Byte1 Byte2 (RXD) (RXD) Byte2 content Action ------------------------------------------------------------------------------- 0xFF 0x00 none uC outputs version info on serial TXD line: Byte1: 0xFF Byte2: Version info byte 1 Byte3: Version info byte 2 Byte4: Version info byte 3 -> see further notes below 0x01 0x00 none CDC: Start playing Must be given also after power on 0x02 0x00 none CDC: Stop playing 0x13 0xXX Track number BCD (1-99) CDC: Select Track XX 0x03 0x00 none CDC: Select previous track 0x04 0x00 none CDC: Select next track 0x15 0xXX CD number BCD (1-6) CDC: Select CD XX 0x05 0x00 none CDC: Select previous CD 0x06 0x00 none CDC: Select next CD 0x07 0x00 none CDC: Fast backward ON/OFF toggle with each reception of this command 0x08 0x00 none CDC: Fast forward ON/OFF toggle with each reception of this command 0x10 0x00 none CDC: Scan play the disc ON/OFF toggle with each reception of this command 0x20 0x00 none CDC: Scan play all discs ON/OFF toggle with each reception of this command 0x30 0x00 none CDC: Shuffle play the disc ON/OFF toggle with each reception of this command 0x40 0x00 none CDC: Shuffle play all discs ON/OFF toggle with each reception of this command Note: The version number can be calculated in the following way: Byte1: Not to be considered Version = (Byte2 * 0x10000) + (Byte3 * 0x100) + (Byte4) Example: Byte1 = 0xFF Byte2 = 0x01 Byte3 = 0x86 Byte4 = 0xA0 Version = (0x01 * 0x10000) + (0x86 * 0x100) + (0xA0) = ( 0x10000 ) + ( 0x8600 ) + (0xA0) = 0x186A0 = 100000d = V1.0.00.0.0 ------------------------------------------------------------------------------- Serial Communication from "CDC Remote" Serial command Byte1 Byte2 (TXD) (TXD) Byte2 content Content ------------------------------------------------------------------------------- 0xFF 0xXX see above uC outputs version info -> see further notes above 0xF1 0xXX CD# (BCD coded) CDC's current disc number 0xF2 0xXX Track # (BCD coded) CDC's current track number 0xF3 0xXX Minutes (BCD coded) CDC's current minute play position 0xF4 0xXX Seconds (BCD coded) CDC's current second play position 0xF5 0x01 CDC Mode CDC is currently playing 0xF5 0x02 CDC Mode CDC is currently stopped 0xF5 0x03 CDC Mode CDC is currently scanning disc 0xF5 0x04 CDC Mode CDC is currently shuffle playing 0xF5 0x05 CDC Mode CDC is currently scanning all discs 0xF5 0x06 CDC Mode CDC is currently shuffle playing all discs Note: The uC is not periodically sending these information, but only if it detected a changeing information from CDC. ------------------------------------------------------------------------------- Input port matrix To be used if the uC should react on push buttons instead of serial control ------------------------------------------------------------------------------- - If input pin is not activated, Vcc has to be applied to the according pin. - If input pin is activated, GND has to be applied. - The following table shows the function to pin level assignment: PB0 PB1 PB2 PB3 PB4 PB5 PB6 PB7 CDC action -------------------------------------------------------------------------- 1 0 0 0 0 0 0 0 Start playing 0 1 0 0 0 0 0 0 Stop playing 1 1 0 0 0 0 0 0 Select previous track 0 0 1 0 0 0 0 0 Select next track 1 0 1 0 0 0 0 0 Select previous CD 0 1 1 0 0 0 0 0 Select next CD 1 1 1 0 0 0 0 0 Fast backward ON/OFF toggle 0 0 0 1 0 0 0 0 Fast forward ON/OFF toggle 0 0 0 0 1 0 0 0 Scan play the disc ON/OFF toggle 0 0 0 0 0 1 0 0 Scan play all discs ON/OFF toggle 0 0 0 0 1 1 0 0 Shuffle play the disc ON/OFF toggle 0 0 0 0 0 0 1 0 Shuffle play all discs ON/OFF toggle