HTD MC-66 Multi-Zone Controller

From LinuxMCE
Jump to: navigation, search

Sold by Home Theater Direct (http://www.htdirect.com).

Provides matrix switching 6 input: 6 ouput. Any source to any/all outputs. Party mode where all sources link to one input. Volume, treble, bass adjustments handled in-line.

Serial Interface

RS-232 Serial Interface
MC66 & MCA66 Controller Interface Hardware Specification
Protocol:
Baud rate:	38400 bps
Data Bit: 8 Bits
Stop Bit: 1 Bits
Parity: None
Flow Control:No
Connectors & Pins Defined:
Controller Connector: 9-pin female
DB PC Connector:      9-pin male DB
PC Connector          Controller Connector
Pin 2 RxD  <--------  TxD Pin 2
Pin 3 TxD  -------->  TxD Pin 3
Pin 5 Gnd  ---------  Gnd Pin 5
Interface Software Specification
Tx Format (Controller Internal Status)
Flow Control : No
Tx Format :
Head Code + Reserved Byte + Zone  Address + Command + Data1 + Data2 + Data3 + Data4 + Data5 + Data6 + Data7 + Data8 + Data9 + CheckSum
Checksum = Head Code + Reserved Byte + Zone Address + Command + Data1 + Data2 + Data3 + Data4 + Data5 + Data6 + Data7 + Data8 + Data9



Example Control Code provided by manufacturer

Example of C Code written to turn the Volume Up in one Zone of the MCA66 Controller through the RS232 Serial Port

This particular example was written for use in a Lantronix Network-to-RS232 Controller, but it should still be helpful.

Note: Although this was written to send commands to the MC66 & MCA66 Controllers, aside from specific differences in the calls, it should also be useful in understanding how to write a similar C program for the Lync systems.

void sendVolUpToHW(BYTE zoneNum) 
{
sendCMD_0x04(zoneNum, 0x09);
} 
void sendCMD_0x04(BYTE zoneNum, BYTE data) 
{
BYTE cmd[6];
cmd[0] = 0x02;
cmd[1] = 0x00;
cmd[2] = zoneNum + 1; // hardware is one-based index
cmd[3] = 0x04;
cmd[4] = data; 
cmd[5] = cmd[0]+cmd[1]+cmd[2]+cmd[3]+cmd[4]; 
serialSend(0, cmd, 6); 
nice();
} 
static int serialSend(int chan, BYTE *buf, int len) {
TCB save; 
CCB *saveCCB;
BYTE *ptr;
int i;
/* Save the current associated stream */
memcpy(&save, ActPro, sizeof(TCB));
saveCCB = ActCCB;
/* Set to new channel and send data */
ActPro->CCB_Ptr = &AllCCB[chan];
ActPro->Chan_Nr = chan;
ActPro->IO_Ptr = AllCCB[chan].IOPtrs;
ActCCB = &AllCCB[chan];
FlushIn();
sendblk(buf, len);
/* Restore old stream */
memcpy(ActPro, &save, sizeof(TCB));
ActCCB = saveCCB;
return(len);
}