zondag 12 februari 2017

Program the Racal Cougar - Part 6

Arduino boxed up and connected to the E.C.U.


This post is about the hardware and software i used doing my experiments.

I used an Arduino Nano V3 (cheap clone) with a minimum of additional components, mostly to perform the level shifting and have a visual indication of the programming result.

At this moment there is no support for the Fill Gun functionality yet. This will be added in future version.

Schema:



The Arduino is powered using the USB Host using an USB cable and requires no external power source.

The schema is simple, the most important parts are the Arduino itself and the level shifter made using the 2N7000 mosfet. A bicolor led is added to have some visual confirmation of the programming result and a reset button for reseting the Arduino program.

Installing the Arduino Sketch

After you have downloaded and installed the Arduino IDE (Arduino Getting started) it is best to test your Arduino by connecting it using an USB cable and load the "Blink" example available in your Arduino IDE.

If you have the "Blink" sketch running and the led at pin #13 is blinking you have successfully installed the IDE and managed to load a sketch to your Nano.

Next is the Racal Cougar Program sketch which can be downloaded using this link.

After you have downloaded, unzipped and opened the sketch (file ending with the .ino extension) in your Arduino IDE you can upload it to your Arduino. After successfully uploading the sketch it will start running and the red led and green led should light up for 1 second in turn indicating it is ready to go.

Next is opening the Arduino Monitor (console) which you can use to control the programmer. This can be done by pressing Ctrl + Shift + M. Make sure the line ending and baud rate of the monitor are set to "Both NL & CR" and 19200.

After opening the monitor console the following should be visible:

Main menu

More information about the programmer menu and functions is described in a previous post.

Supported PRM models


At this moment the software is configured and tested for use of the PRM4515L (4 meter) model only.   Although programming the other PRM4515 models is based on the same principal i haven't implemented this yet, mainly because currently i have no other models available to test the functionality with.

If you have one of the other models and want to test the programmer for a particilar model please let me know and i will make some changes to the software for you to test.

Update 05-03-2017:

Version 0.0.3 of the Arduino Racal Cougar Programmer now supports the PRM 4515 H models, see next post.

Update 15-10-2015:

 A new version v0.0.4 is available that fixes the default channel data being garbage when a fresh Arduino was used and channel data hasn't been stored before.

Important

This is an experimental project and you are using this software at your own risk. I am not responsible for any damage to your precious Racal Cougar !



zaterdag 11 februari 2017

Program the Racal Cougar - Part 5




The Racal Cougar uses PWM serial data over the audio connector its F pin to control and program the tranceiver. (see part 2). This part describes the commands i recorded using an Arduino and a tab on the cable between the Racal and E.C.U. (Remote Control Unit MA-4730) or Fill Gun (MA-4083)


Tap on F & E pins

Commands


Every command send by the ECU and Fill Gun / Programmer consists of at least 4 bytes of data; a header and instruction byte repeated twice, so byte 1 and 3 are similar and so are byte 2 and 4.

Depending on the type of command 20 additional bits of data are appended to the command maing the size of the data stream 52 bits.

(Almost) every command is echoed back by the Racal cougar after it has been processed successfully. The difference between  normal command and echoed command is bit 7 of the command header. On echo this is set to '0'.

The following command tables have an echo column which describe if an echo is to be expected.

Controlling the Racal Cougar:

Channels

Select channel

HEXByte 1Byte 2Byte 3Byte 4Echo
Channel 07F007F0001111111000000000111111100000000Y
Channel 17F087F0801111111000010000111111100001000Y
Channel 27F047F0401111111000001000111111100000100Y
Channel 37F0C7F0C01111111000011000111111100001100Y
Channel 47F027F0201111111000000100111111100000010Y
Channel 57F0A7F0A01111111000010100111111100001010Y
Channel 67F067F0601111111000001100111111100000110Y
Channel 77F0E7F0E01111111000011100111111100001110Y
Channel 87F017F0101111111000000010111111100000001Y
Channel 97F097F0901111111000010010111111100001001Y

Squelch


Squelch

HEXByte 1Byte 2Byte 3Byte 4Echo
Open7E0D7E0D608C501111110000011010111111000001101Y
Data:
01100000100011000101

Close7E0D7E0D600C401111110000011010111111000001101Y
Data:
01100000000011000100


Mode


Mode

HEXByte 1Byte 2Byte 3Byte 4Echo
Clear7E0D7E0D600C401111110000011010111111000001101Y
Data:
01100000000011000100

Select Secure7E0D7E0D620C501111110000011010111111000001101Y
Data:
01100010000011000101

Use Cypher A7ED37ED30000101111110110100110111111011010011Y
Data:
00000000000000000001

Use Cypher B7ED37ED38000001111110110100110111111011010011Y
Data:
10000000000000000000


To select a Secure channel 2 commands need to be given, "Select Secure" and "Use Cypher A/B"

Programming the Racal Cougar


Program

HEXByte 1Byte 2Byte 3Byte 4Echo
Init (FLT)7F3B7F3B01111111001110110111111100111011N
Start (FTXI)7F3B7F3B01111111001110110111111100111011Y
Disable Tone7FB37FB301111111101100110111111110110011Y
Channel 0 TX7E007E00240E001111110000000000111111000000000Y
Data:
00100100000011100000

Channel 0 RX7E807E80240E001111110100000000111111010000000Y
Data:
00100100000011100000

Channel 1 TX7E087E08E40E001111110000010000111111000001000Y
Data:
11100100000011100000

Channel 1 RX7E887E88E40E001111110100010000111111010001000Y
Data:
11100100000011100000

Channel 2 TX7E047E040C0E001111110000001000111111000000100Y
Data:
00001100000011100000

Channel 2 RX7E847E840C0E001111110100001000111111010000100Y
Data:
00001100000011100000

Channel 3 TX7E0C7E0CCC0E001111110000011000111111000001100Y
Data:
11001100000011100000

Channel 3 RX7E8C7E8CCC0E001111110100011000111111010001100Y
Data:
11001100000011100000

Channel 4 TX7E027E02AC0E001111110000000100111111000000010Y
Data:
10101100000011100000

Channel 4 RX7E827E82AC0E001111110100000100111111010000010Y
Data:
10101100000011100000

Channel 5 TX7E0A7E0A6C0E001111110000010100111111000001010Y
Data:
01101100000011100000

Channel 5 RX7E8A7E8A6C0E001111110100010100111111010001010Y
Data:
01101100000011100000

Channel 6 TX7E067E06820E001111110000001100111111000000110Y
Data:
10000010000011100000

Channel 6 RX7E867E86820E001111110100001100111111010000110Y
Data:
10000010000011100000

Channel 7 TX7E0E7E0E420E001111110000011100111111000001110Y
Data:
01000010000011100000

Channel 7 RX7E8E7E8E420E001111110100011100111111010001110Y
Data:
01000010000011100000

Channel 8 TX7E017E01220E001111110000000010111111000000001Y
Data:
00100010000011100000

Channel 8 RX7E817E81220E001111110100000010111111010000001Y
Data:
00100010000011100000

Channel 9 TX7E097E09E20E001111110000010010111111000001001Y
Data:
11100010000011100000

Channel 9 RX7E897E89E20E001111110100010010111111010001001Y
Data:
11100010000011100000

End(DN)7F037F0301111111000000110111111100000011Y

A program sequence is made up of the following steps where step 3,4 and 5 are repeated for every channel to be programmed:
  1. Init
  2. Start
  3. Disable tone (optional)
  4. Channel n TX
  5. Channel n RX
  6. End
The Disable Tone command can be omitted if a 150 Hz pilot tone is requested for the selected channel.

The Init, Start and End commands are needed to store the new channel data in the Racal's EEProm. Using the Program Channel commands without this results in the channel data only being stored in RAM and thus reset back to its original info after powering down the unit.

In the table above the following frequencies are programmed:



TXRX
Channel 070.250 Mhz70.250 Mhz
Channel 170.275 Mhz70.275 Mhz
Channel 270.300 Mhz70.300 Mhz
Channel 370.325 Mhz70.325 Mhz
Channel 470.350 Mhz70.350 Mhz
Channel 570.375 Mhz70.375 Mhz
Channel 670.400 Mhz70.400 Mhz
Channel 770.425 Mhz70.425 Mhz
Channel 870.450 Mhz70.450 Mhz
Channel 970.475 Mhz70.475 Mhz

The "algorithm" to set a specific frequency was described in part 2.