Skip to content

Control library for CRP42602Y auto-reverse cassette tape deck mechanism by Raspberry Pi Pico

License

Notifications You must be signed in to change notification settings

elehobica/pico_crp42602y_ctrl

Repository files navigation

Raspberry Pi Pico CRP42602Y mechanism control

Overview

Control library for CRP42602Y auto-reverse cassette tape deck mechanism

sample application

Features

  • Generate solenoid pull timing for the function gear of CRP42602Y to support Play A/B, Cueing and Stop control
  • Perform auto-stop action by rotation sensor of CRP42602Y
  • Support 3 auto-reverse modes (One way, One round and Infinite round)
  • Support timeout power disable to stop motor when no operations (optional)
  • Provide commands and callbacks for user interface

Supported Board and Peripheral Devices

  • Raspberry Pi Pico (rp2040)
  • CRP42602Y mechanism
  • Need additional circuit to drive solenoid

Pin Assignment & Connection

CRP42602Y connector

Pin # Name Function Connection
1 REC_B_SW Rec. protection switch of B side
(0: not protected, 1: protected)
to Pico GPIO input
2 ROTATION_SENS Rotation sensor to Pico GPIO input
3 GEAR_STATUS_SW Gear status switch
(0: in function, 1 not in function)
to Pico GPIO input
4 SOLENOID_1 Solenoid coil 1 from solenoid driver circuit
5 SOLENOID_2 Solenoid coil 2 from solenoid driver circuit
6 GND GND GND
7 CASSETTE_DETECT_SW Cassette detection switch
(0: detected, 1: not detected)
to Pico GPIO input
8 P12V 12V Power for motor and
IR LED for rotation sensor
from power circuit
9 REC_A_SW Rec. protection switch of A side
(0: not protected, 1: protected)
to Pico GPIO input

Raspberry Pi Pico

Pico Pin # GPIO Function Connection
4 GP2 GPIO Output to SOLENOID_CTRL of additional circuit (0: release, 1: pull)
5 GP3 GPIO Input CASSETTE_DETECT from CRP42602Y pin 7
6 GP4 GPIO Input GEAR_STATUS_SW from CRP42602Y pin 3
7 GP5 GPIO Input ROTATION_SENS from CRP42602Y pin 2
8 GND GND GND
9 GP6 GPIO Output to POWER_CTRL (optional) (0: disable, 1: enable)

Pin assignments are configurable

Schematic

Control circuit schematic

CRP62402Y_ctrl_schematic

The solenoid driver part is needed at least.

Head circuit (for reference)

CRP62402Y_head_circuit

Polarity information is relative, however, L/R polarities should be aligned.

How to build

  • See "Getting started with Raspberry Pi Pico"
  • Put "pico-sdk", "pico-examples" and "pico-extras" on the same level with this project folder.
  • Set environmental variables for PICO_SDK_PATH, PICO_EXTRAS_PATH and PICO_EXAMPLES_PATH
  • Confirmed with Pico SDK 2.0.0
> git clone -b 2.0.0 https://github.com/raspberrypi/pico-sdk.git
> cd pico-sdk
> git submodule update -i
> cd ..
> git clone -b sdk-2.0.0 https://github.com/raspberrypi/pico-examples.git
>
> git clone -b sdk-2.0.0 https://github.com/raspberrypi/pico-extras.git
> 
> git clone -b main https://github.com/elehobica/pico_crp42602y_ctrl.git
> cd pico_crp42602y_ctrl
> git submodule update -i
> cd ..

Windows

  • Build is confirmed with Developer Command Prompt for VS 2022 and Visual Studio Code on Windows environment
  • Confirmed with cmake-3.27.2-windows-x86_64 and gcc-arm-none-eabi-10.3-2021.10-win32
  • Lanuch "Developer Command Prompt for VS 2022"
> cd pico_crp42602y_ctrl
> cd samples\xxxx
> mkdir build && cd build
> cmake -G "NMake Makefiles" ..
> nmake
  • Put "xxxx.uf2" on RPI-RP2 drive

Linux

$ cd pico_crp42602y_ctrl
$ cd samples/xxxx
$ mkdir build && cd build
$ cmake ..
$ make -j4
  • Download "xxxx.uf2" on RPI-RP2 drive