With this code, I try to attempted to program a Arduino nano, to use in older transceivers, where the CTCCC board is no longer available.
The goal is to let the Arduino communicate with the transceiver, as it would with a factory CTCSS board.
I found out that Icom, yaesu, and Kenwood, all use a 8 bit shift register IC, and a CTCSS encoder/decoder IC like the FX365, that are obsolete.
I used the library written by PE1CID,that I slightly modified, to generate the sub-audio tone. (CtcssTone)
PIN 2 = ChipSelect Input for TSTB (P47-3) from the transceiver
PIN 3 = PWM_OUTPUT output that generates the sub-audio tone, via filter network to TSTN (P46-5) to the transceiver
PIN 4 = PTT_INDICATOR output indicator with led -for testing purposes
PIN 5 = TONE_OFF_INDICATOR output indicator with led for testing purposes
PIN 8 = DECODE_INDICATOR goes high if CTCSS code is decoded
PIN 11 = MOSI SPI DATA (P47-4) from transceiver
PIN 13 = SCK SPI clock serial clock for CK (P47-5) from transceiver
PIN 14 = A0 Sub-audio tone input, needs 260Hz lowpass filter
P47-1 = 5V
P47-2 = GND
P47-3 = TSTB (Chip Select) to D2
P47-4 = DATA (MOSI) to D11
P47-5 = CK (SCK) to D13
P46-1 = TSFL Squelch control
P46-2 = AFMT AF mute
P46-3 = TSAO Receive OUTPUT
P46-4 = GND
P46-5 = TSTN Transmit Input to D3 via filter network
P46-6 = GND
Channel 1 = Yellow = Data
Channel 2 = Purple = Clock
Channel 3 = Blue = ChipSelect (CS)
Clock period (Fig1) = 4.4 uSec
Data Pulse (Fig2) = 2.2 uSec.
Latch after last clock pulse (Fig3) = 14.8 uSec.
Latch time (Fig4) = 3.8 µSec.
Latch to next bust of always 192 (Fig5) = 22.2 uSec.