Actions

Difference between revisions of "CRM IV - Display data protocol"

From Zenitel Wiki

 
(20 intermediate revisions by 6 users not shown)
Line 1: Line 1:
General
+
== General ==
 
The microprocessor receives messages on the asynchronous serial input. First, the message is checked for errors in transmission using the checksum. Then the processor decides whether the message is addressed to this station. Last the data bytes in the message are sent to the display, the synchronous output, the asynchronous output or as digits back to the exchange, depending on the command type.
 
The microprocessor receives messages on the asynchronous serial input. First, the message is checked for errors in transmission using the checksum. Then the processor decides whether the message is addressed to this station. Last the data bytes in the message are sent to the display, the synchronous output, the asynchronous output or as digits back to the exchange, depending on the command type.
Serial format
+
 
 +
== Serial format ==
 +
 
 
The serial format is 8 bit, no parity, 2 stop bits, 9600 baud.
 
The serial format is 8 bit, no parity, 2 stop bits, 9600 baud.
Message format
+
 
 +
== Message format ==
 +
 
 
The message consists of the following items:
 
The message consists of the following items:
 
*A start of record mark, one byte. Always 0xa5.
 
*A start of record mark, one byte. Always 0xa5.
Line 11: Line 15:
 
*Data. Up to 18 bytes of data.
 
*Data. Up to 18 bytes of data.
 
*Checksum. One byte checksum of record, obtained by adding count byte, address bytes, command byte and data bytes, ignoring any carry.
 
*Checksum. One byte checksum of record, obtained by adding count byte, address bytes, command byte and data bytes, ignoring any carry.
Addresses
+
 
 +
== Addresses ==
 +
 
 
The processor has three different address registers that it tries to match against the address of the incoming message:
 
The processor has three different address registers that it tries to match against the address of the incoming message:
 
*The 16 bit main address register that is loaded by a message. The register may be loaded by a message that requires a double pulse on the polarity of the cd wire. The register is set to 0xff00 after full reset.
 
*The 16 bit main address register that is loaded by a message. The register may be loaded by a message that requires a double pulse on the polarity of the cd wire. The register is set to 0xff00 after full reset.
Line 21: Line 27:
 
|-
 
|-
 
!style="background:#ffdead;" width="90pt" |Address
 
!style="background:#ffdead;" width="90pt" |Address
!style="background:#ffdead;" width="200pt"|Interpretation
+
!style="background:#ffdead;" width="800pt"|Interpretation
 
|-
 
|-
 
|0x0000 - 0xfbff || The address is compared directly with the 16 bit main address register.
 
|0x0000 - 0xfbff || The address is compared directly with the 16 bit main address register.
Line 36: Line 42:
 
|-
 
|-
 
|}
 
|}
 +
<br/><br/>
  
=== Commands ===
+
== Commands ==
  
 
The command byte tell the processor what to do. Not all commands will be supported by all systems, refer to individual product specifications for details.
 
The command byte tell the processor what to do. Not all commands will be supported by all systems, refer to individual product specifications for details.
Line 44: Line 51:
 
|-
 
|-
 
!style="background:#ffdead;" width="90pt" |Command
 
!style="background:#ffdead;" width="90pt" |Command
!style="background:#ffdead;" width="200pt"|Action description
+
!style="background:#ffdead;" width="800pt"|Action description
 
|-
 
|-
 
|0x01 || Write data in message to low address (control register of display). Wait for display to become ready for each byte.
 
|0x01 || Write data in message to low address (control register of display). Wait for display to become ready for each byte.
Line 139: Line 146:
 
     state on, binary  1 on
 
     state on, binary  1 on
 
   
 
   
(*): Status with higher the priority will override the lower.<br\>
+
(*): Status with higher the priority will override the lower.<br />
 
NOTE: special indicator use on keys # 1000-1023
 
NOTE: special indicator use on keys # 1000-1023
 
|-
 
|-
|0x42 || A station indicator reset command: <br\>
+
|0x42 || A station indicator reset command: <br />
It will reset all the indicators on the station to state 0. <br\>
+
It will reset all the indicators on the station to state 0. <br />
Message ID: 0x42<br\>
+
Message ID: 0x42<br />
 
The command has no parameters.
 
The command has no parameters.
 
|-
 
|-
|0x43 || A station indicator test command (lamptest): <br\>
+
|0x43 || A station indicator test command (lamptest): <br />
It will divide the lamps into sections that will be sequentially set to state 1 (on) so that no more than ¼ of the lamps will light up at the same time. The function will stay active for a period set by a parameter.<br\>
+
It will divide the lamps into sections that will be sequentially set to state 1 (on) so that no more than ¼ of the lamps will light up at the same time. The function will stay active for a period set by a parameter.<br />
Message ID: 0x43  <br\>
+
Message ID: 0x43  <br />
Parameter: time in seconds; 0-255.<br\>
+
Parameter: time in seconds; 0-255.<br />
 
Example: “0x43+0x10+checksum” will stay active for 16 seconds
 
Example: “0x43+0x10+checksum” will stay active for 16 seconds
 
|-
 
|-
Line 159: Line 166:
 
{|Border="1"
 
{|Border="1"
 
|-
 
|-
|0x20 / 0x00 / 0b00ab cdef || CRM III special outputs:<br\>
+
|0x20 / 0x00 / 0b00ab cdef || CRM III special outputs:<br />
a,b,c,d,e: available extra outputs on CRM III display driver board (A100C01454), write ‘0’ if not used<br\>
+
a,b,c,d,e: available extra outputs on CRM III display driver board (A100C01454), write ‘0’ if not used<br />
 
f : external buzzer (0=off, 1=on)
 
f : external buzzer (0=off, 1=on)
 
|-
 
|-
 
|0x20 / 0x02 / 0b0000 abcd || CRM III special outputs:
 
|0x20 / 0x02 / 0b0000 abcd || CRM III special outputs:
a : backlight control inverted (0=on, 1=off)<br\>
+
a : backlight control inverted (0=on, 1=off)<br />
b : internal buzzer (0=off, 1=on)<br\>
+
b : internal buzzer (0=off, 1=on)<br />
c : do not use always write ‘0’<br\>
+
c : do not use always write ‘0’<br />
 
d : do not use always write ‘0’ (display select)
 
d : do not use always write ‘0’ (display select)
 
|-
 
|-
Line 206: Line 213:
 
{| border="1"  
 
{| border="1"  
 
|-
 
|-
|width="200pt"|0x10  
+
|width="90pt"|0x10  
|width="90pt" |Clear display.
+
|width="800pt" |Clear display.
 
|-
 
|-
 
|0x11 || Move cursor to start of first line.
 
|0x11 || Move cursor to start of first line.
Line 222: Line 229:
 
|-
 
|-
 
|}
 
|}
 +
<br/><br/><br/>
  
=== Dialling format, frequencies and currents. ===
+
== Dialling format, frequencies and currents ==
  
 
The following format is used for key data in command type 0x22, for frequencies and for currents when dialling numbers:
 
The following format is used for key data in command type 0x22, for frequencies and for currents when dialling numbers:
Line 407: Line 415:
 
|-
 
|-
 
|}
 
|}
 +
 +
[[Category:Discontinued Products]]
 +
[[Category: Analogue Station - Technical articles]]

Latest revision as of 13:05, 14 June 2018

General

The microprocessor receives messages on the asynchronous serial input. First, the message is checked for errors in transmission using the checksum. Then the processor decides whether the message is addressed to this station. Last the data bytes in the message are sent to the display, the synchronous output, the asynchronous output or as digits back to the exchange, depending on the command type.

Serial format

The serial format is 8 bit, no parity, 2 stop bits, 9600 baud.

Message format

The message consists of the following items:

  • A start of record mark, one byte. Always 0xa5.
  • Byte count. One byte giving the number of bytes in the rest of the record. The count starts at the next byte and includes the checksum byte at the end of the record.
  • Address. Two bytes telling for who this record is intended. The most significant byte comes first.
  • Command type. One byte telling what the message is about.
  • Data. Up to 18 bytes of data.
  • Checksum. One byte checksum of record, obtained by adding count byte, address bytes, command byte and data bytes, ignoring any carry.

Addresses

The processor has three different address registers that it tries to match against the address of the incoming message:

  • The 16 bit main address register that is loaded by a message. The register may be loaded by a message that requires a double pulse on the polarity of the cd wire. The register is set to 0xff00 after full reset.
  • The 8 bit K-group address register that can be loaded by a message.

The address range of the incoming messages is divided as follows:

Address Interpretation
0x0000 - 0xfbff The address is compared directly with the 16 bit main address register.
0xfc00 - 0xfcff The lower 8 bits are compared with the short address register.
0xfd00 - 0xfdff The lower 8 bits are compared with the K-group address register.
0xfe00 - 0xfeff The lower 8 bits are compared with the upper 8 bits of the main address register. The processor have 0xff00 in the main address register after reset so that 0xfeff is group broadcast to all processors whose main address register is not yet loaded.
0xfffe Maskable broadcast to all processors.
0xffff Unmaskable broadcast to all processors.



Commands

The command byte tell the processor what to do. Not all commands will be supported by all systems, refer to individual product specifications for details.

NOTE: special use on CRM III
Command Action description
0x01 Write data in message to low address (control register of display). Wait for display to become ready for each byte.
0x02 Write data to high address (display RAM and character generator of display). Wait for display to become ready for each byte.
0x03 Write data in message to high address, but interpret values in the range 0x10 .. 0x1f as control codes. Wait for display to become ready for each byte.
0x04 Load the main address register with the two first data bytes of message if the processor has received two pulses on the PD7 pin within a short time (less than one second). This is a double flash in the station LED and the sequence on the PD7 pin is 1-0-1-0-1. The first 1 must be present when the message is processed, meaning that the LED must be off. Most significant byte is first data byte.
0x05 Load the first data byte as the K-group address.
0x06 Write data bytes in message to low address.
0x07 Write data bytes in message to high address.
0x08 HC05/HC04 specific command:

Load the short address register from port A (PA0..PA7).

0x09 Mask broadcast. Messages with address 0xfffe is ignored.
0x0a Unmask broadcast. Messages with address 0xfffe is recognised.
0x0b HC05/HC04 specific command:

Shift 0xff out to SPI address 0x02. This command is for compatibility with old version of display station processor only.

0x0c HC05/HC04 specific command:

Shift 0x00 out to SPI address 0x02. This command is for compatibility with old version of display station processor only.

0x0d HC05/HC04 specific command:

Shift first data byte out to address 0x00. This command is for compatibility with old version of display station processor only.

0x0e HC05/HC04 specific command:

Shift first data byte out to address 0x01. This command is for compatibility with old version of display station processor only.

0x20 HC05/HC04 specific command:

Shift data in message out to specified SPI addresses. Data and addresses comes in pairs, first one byte of address then one byte of data. Since at most 18 bytes may be sent in one message, one message can load up to 9 external registers.

0x21 Transmit data bytes in message on asynchronous output (9600 baud, 2 stop bit, no parity, 8 bit data).
0x22 Use the data bytes in message as key presses, send them as digits on the CD wires. Key value 20 gives ID+specified current, key values 21-30 gives current pulse only, 31 gives C-key pulse.
0x23 Activate handset and volume override.
0x24 Deactivate handset and volume override.
0x25 Load the main address register with the two first data bytes of the message without looking for any pulses on CD-wire. Most significant byte is first data byte.
0x26 Activate RCO-pin

(HC05: Active = PD1/TDO going low).

0x27 Deactivate RCO-pin

(HC05: Inactive = PD1/TDO going high).

0x28 Activate RCO-pin with time-out given by data byte. Time-out is given by hex value times 100 ms.

(HC05: Active = PD1/TDO going low).

0x29 Start pulse train on RCO-pin. First data byte gives on-time, second data byte gives off-time, and third data byte gives number of pulses (max 127 = 0x7f). Times are given by hex value times 100 ms.

(HC05: on = PD1/TDO going low).

0x2a HC05/HC04 specific command:

Same as 0x22, but four-digit version number is appended.

0x2e HC05/HC04 specific command:

Activate watchdog reset, processor dials own identity (directory number) if programmed, when coming alive.

0x2f Stop activities in microcontroller to start watchdog reset.
0x31 Multiple display version of command 0x01. Display address is first byte after command. Address 0x00 is default display (for back compatibility use command 0x01) and address 0xff is all displays.
0x32 Multiple display version of command 0x02. Display address is first byte after command. Address 0x00 is default display (for back compatibility use command 0x02) and address 0xff is all displays
0x33 Multiple display version of command 0x03. Display address is first byte after command. Address 0x00 is default display (for back compatibility use command 0x03) and address 0xff is all displays
0x41 Set indicator status command; will set status on one indicator as off, on, slow blink or fast blink.

It will refer to KEY number(K), indicator number(I) and status selector with state(S). Many indicator can be set with one command:

Example: 0x41+ KIS+KIS+….+KIS+ checksum (up to 9 KIS)
Message ID: 0x41 : 	1 byte
Message size:	16 bits
- Key number:	10 bits
- Indicator number:	3 bits
   indicator 0 (binary 000):	red LED
   indicator 1 (binary 001):	green LED
   indicators 2-7:	for future use
- Status selector (*):	2 bits
   status 0, binary 00, low priority:	on
   status 1, binary 01, medium priority:	slow blink
   status 2, binary 10, high priority:	fast blink
   status 3, binary 11, no priority	for future use
- Status state:	1 bit
   state off, binary  0	off
   state on, binary  1	on

(*): Status with higher the priority will override the lower.
NOTE: special indicator use on keys # 1000-1023

0x42 A station indicator reset command:

It will reset all the indicators on the station to state 0.
Message ID: 0x42
The command has no parameters.

0x43 A station indicator test command (lamptest):

It will divide the lamps into sections that will be sequentially set to state 1 (on) so that no more than ¼ of the lamps will light up at the same time. The function will stay active for a period set by a parameter.
Message ID: 0x43
Parameter: time in seconds; 0-255.
Example: “0x43+0x10+checksum” will stay active for 16 seconds

Special commands/usage

0x20 / 0x00 / 0b00ab cdef CRM III special outputs:

a,b,c,d,e: available extra outputs on CRM III display driver board (A100C01454), write ‘0’ if not used
f : external buzzer (0=off, 1=on)

0x20 / 0x02 / 0b0000 abcd CRM III special outputs:

a : backlight control inverted (0=on, 1=off)
b : internal buzzer (0=off, 1=on)
c : do not use always write ‘0’
d : do not use always write ‘0’ (display select)

0x41-43 Special indicator and status usage for keys 1000-up:
key 1023: LCD backlight control
- Indicator: 
   indicator 0 (binary 000):	backlight LCD 0
   indicator 1 (binary 001):	backlight LCD 1
   indicator 2 (binary 010):	backlight LCD 2
   indicator 3 (binary 011):	backlight LCD 3
   indicator 4 (binary 100):	backlight LCD 4
   indicator 5 (binary 101):	backlight LCD 5
   indicator 6 (binary 110):	backlight LCD 6
   indicator 7 (binary 111):	backlight LCD 7
-Indicator status as ordinary indicators. 
key 1022: Buzzer control
- Indicator: 
   indicator 0 (binary 000):	internal buzzer
   indicator 1 (binary 001):	external buzzer (relay)
	
   indicators 2-7: 	not used
- Status selector (*):	2 bits
   status 0, binary 00, low pri:	1 blip every 5 sec
   status 1, binary 01, medium pri:	1 blip every 2 sec
   status 2, binary 10, high pri:	on
   status 3, binary 11, no pri:	for future use
- Status state:	1 bit
   state off, binary  0	off
   state on, binary  1	on

Control codes as used in command 0x03

When sending a message with command 0x03, the processor writes the data bytes to the display high address. However, bytes in the range 0x10 to 0x1f is interpreted as control codes. The codes have the following meaning:

0x10 Clear display.
0x11 Move cursor to start of first line.
0x12 Move cursor to start of second line.
0x13 Position cursor. Use the following byte as the new cursor address. Range is 0x00..0x7f. Refer to HD44780 data sheet for details.
0x14 The following byte is written to low address rather than high address.
0x15 Mask broadcast. Messages with address 0xfffe will be ignored.
0x16 Unmask broadcast. Records with address 0xfffe will be recognised.




Dialling format, frequencies and currents

The following format is used for key data in command type 0x22, for frequencies and for currents when dialling numbers:

Frequency Current Data byte in command 0x22 Name
500 Hz Handset ON 0x00 Digit 0
700 Hz Handset ON   Digit 1
900 Hz Handset ON   Digit 2
1100 Hz Handset ON   Digit 3
1300 Hz Handset ON   Digit 4
1500 Hz Handset ON   Digit 5
1700 Hz Handset ON   Digit 6
1900 Hz Handset ON   Digit 7
2100 Hz Handset ON   Digit 8
2300 Hz Handset ON   Digit 9
400 Hz Handset ON 0x0a Digit 10
2600 Hz Handset ON   Digit 11
450 Hz Handset ON   Digit 12
2900 Hz Handset ON   Digit 13
600 Hz Handset ON   Digit 14
3200 Hz Handset ON   Digit 15
800 Hz Handset ON   Digit 16
3600 Hz Handset ON   Digit 17
1000 Hz Handset ON   Digit 18
4000 Hz Handset ON 0x13 Digit 19
500 Hz M-key 0x20 M +digit 0
700 Hz M-key   M +digit 1
900 Hz M-key   M +digit 2
1100 Hz M-key   M +digit 3
1300 Hz M-key   M +digit 4
1500 Hz M-key   M +digit 5
1700 Hz M-key   M +digit 6
1900 Hz M-key   M +digit 7
2100 Hz M-key   M +digit 8
2300 Hz M-key   M +digit 9
400 Hz M-key 0x2a M +digit 10
2600 Hz M-key   M +digit 11
450 Hz M-key   M +digit 12
2900 Hz M-key   M +digit 13
600 Hz M-key   M +digit 14
3200 Hz M-key   M +digit 15
800 Hz M-key   M +digit 16
3600 Hz M-key   M +digit 17
1000 Hz M-key   M +digit 18
4000 Hz M-key 0x33 M +digit 19
500 Hz Handset OFF 0x40 Hsoff +digit 0
700 Hz Handset OFF   Hsoff +digit 1
900 Hz Handset OFF   Hsoff +digit 2
1100 Hz Handset OFF   Hsoff +digit 3
1300 Hz Handset OFF   Hsoff +digit 4
1500 Hz Handset OFF   Hsoff +digit 5
1700 Hz Handset OFF   Hsoff +digit 6
1900 Hz Handset OFF   Hsoff +digit 7
2100 Hz Handset OFF   Hsoff +digit 8
2300 Hz Handset OFF   Hsoff +digit 9
400 Hz Handset OFF 0x4a Hsoff +digit 10
2600 Hz Handset OFF   Hsoff +digit 11
450 Hz Handset OFF   Hsoff +digit 12
2900 Hz Handset OFF   Hsoff +digit 13
600 Hz Handset OFF   Hsoff +digit 14
3200 Hz Handset OFF   Hsoff +digit 15
800 Hz Handset OFF   Hsoff +digit 16
3600 Hz Handset OFF   Hsoff +digit 17
1000 Hz Handset OFF   Hsoff +digit 18
4000 Hz Handset OFF 0x53 Hsoff +digit 19
500 Hz C-key 0x60 C +digit 0
700 Hz C-key   C +digit 1
900 Hz C-key   C +digit 2
1100 Hz C-key   C +digit 3
1300 Hz C-key   C +digit 4
1500 Hz C-key   C +digit 5
1700 Hz C-key   C +digit 6
1900 Hz C-key   C +digit 7
2100 Hz C-key   C +digit 8
2300 Hz C-key   C +digit 9
400 Hz C-key 0x6a C +digit 10
2600 Hz C-key   C +digit 11
450 Hz C-key   C +digit 12
2900 Hz C-key   C +digit 13
600 Hz C-key   C +digit 14
3200 Hz C-key   C +digit 15
800 Hz C-key   C +digit 16
3600 Hz C-key   C +digit 17
1000 Hz C-key   C +digit 18
4000 Hz C-key 0x73 C +digit 19
(no tone) M-key + ID 0x34 M+ID-pulse
(no tone) Handset ON + ID 0x14 ID-pulse
(no tone) Handset OFF + ID 0x54 Hsoff +ID-pulse
(no tone) C-key + ID 0x74 C+ID-pulse
(no tone) M-key 0x35 M-pulse
(no tone) C-key 0x5f C-pulse