Expand description
Binary programming protocol for MCP (Memory Control Program) access.
The TH-D75 supports a binary programming protocol entered via
0M PROGRAM. This provides access to data not available through
standard CAT commands, including channel display names.
§Protocol
- Entry:
0M PROGRAM\r->0M\r - Read:
R+ 2-byte page +0x00 0x00->W+ 4-byte address + 256-byte data (261 bytes) - ACK:
0x06 - Exit:
E
§Safety
Entering programming mode makes the radio stop responding to normal CAT commands. Always exit programming mode when done.
The 0M handler is at firmware address 0xC002F01C.
Structs§
- Channel
Flag - A single channel’s flag data (4 bytes per channel at MCP offset 0x2000+).
Constants§
- ACK
- ACK byte sent after receiving a data block.
- APRS_
START - First page of APRS messages and settings.
- APRS_
STATUS_ PAGE - APRS message status header page.
- BT_
START - First page of Bluetooth device data and remaining config.
- CHANNELS_
PER_ MEMGROUP - Channels per memgroup (6 channels + 16 bytes padding = 256 bytes).
- CHANNEL_
DATA_ END - Last page of channel memory data (inclusive).
- CHANNEL_
DATA_ START - First page of channel memory data (192 memgroups x 256 bytes).
- CHANNEL_
FLAGS_ END - Last page of channel flags (inclusive).
- CHANNEL_
FLAGS_ START - First page of channel flags (1200 entries x 4 bytes = 4800 bytes).
- CHANNEL_
NAMES_ END - Last page of channel names (inclusive).
- CHANNEL_
NAMES_ START - First page of channel names (1200 entries x 16 bytes).
- CHANNEL_
RECORD_ SIZE - Size of one channel memory record in bytes.
- DSTAR_
RPT_ START - First page of D-STAR repeater list and callsign list.
- ENTER_
PROGRAMMING - Entry command to enter programming mode (ASCII).
- ENTER_
RESPONSE - Expected response when entering programming mode (ASCII).
- EXIT
- Exit byte to leave programming mode.
- FACTORY_
CAL_ PAGES - Number of factory calibration pages at the end that must never be written.
- FLAG_
220 - Flag
usedvalue indicating a 220 MHz channel (150-400 MHz). - FLAG_
EMPTY - Flag
usedvalue indicating an empty/unused channel slot. - FLAG_
RECORD_ SIZE - Size of one channel flag record in bytes.
- FLAG_
UHF - Flag
usedvalue indicating a UHF channel (freq >= 400 MHz). - FLAG_
VHF - Flag
usedvalue indicating a VHF channel (freq < 150 MHz). - GROUP_
NAMES_ END - Last page of group names (inclusive).
- GROUP_
NAMES_ START - First page of group names (within the names array, indices 1152-1181).
- MAX_
CHANNELS - Maximum number of usable channel names (channels 0-999).
- MAX_
WRITABLE_ PAGE - Last page that may be safely written (inclusive).
- MEMGROUP_
COUNT - Number of memgroups (200 memgroups, 192 used for 1152 channels + 8 spare).
- MEMGROUP_
PADDING - Padding bytes at the end of each memgroup.
- NAMES_
PER_ PAGE - Channel name entries per 256-byte page (256 / 16 = 16).
- NAME_
ALL_ PAGE_ COUNT - Number of pages containing all channel name data including extended entries (75 pages, channels 0-1199: scan edges, WX, call channels).
- NAME_
ENTRY_ SIZE - Bytes per channel name entry.
- NAME_
PAGE_ COUNT - Number of pages containing channel name data (63 pages, channels 0-1007).
- NAME_
START_ PAGE - Starting page address for channel name data.
- PAGE_
SIZE - Size of data payload in each page (256 bytes).
- SETTINGS_
END - Last page of system settings (inclusive).
- SETTINGS_
START - First page of system settings (radio state, global config).
- TOTAL_
CHANNEL_ ENTRIES - Total channel entries including extended channels (scan edges, WX, call).
- TOTAL_
PAGES - Total number of pages in the radio memory (0x0000-0x07A2).
- TOTAL_
SIZE - Total radio memory in bytes (1955 * 256).
- W_
HEADER_ SIZE - Size of the W response header (W + 2-byte block address + 2-byte data size).
- W_
RESPONSE_ SIZE - Total size of a W response (1 opcode + 4 address + 256 data).
Functions§
- build_
read_ command - Build a binary read command for a given page address.
- build_
write_ command - Build a binary write command for a given page address with 256-byte data.
- extract_
name - Extract a channel name from a 16-byte entry.
- is_
factory_ calibration_ page - Returns
trueif the given page is within the factory calibration region that must never be overwritten. - parse_
channel_ flag - Parse a 4-byte channel flag record.
- parse_
write_ response - Parse a write response from the radio.