diff --git a/14P-10P.lay6 b/14P-10P.lay6 index 9cbad39..0dff37d 100644 Binary files a/14P-10P.lay6 and b/14P-10P.lay6 differ diff --git a/Beta10Pin/beta10p.c b/Beta10Pin/beta10p.c index 2f05a61..de904f0 100644 --- a/Beta10Pin/beta10p.c +++ b/Beta10Pin/beta10p.c @@ -178,7 +178,7 @@ const uint8_t ucaf_adc_to_byte[1024] PROGMEM = // Firmware description strings. -volatile const uint8_t ucaf_version[] PROGMEM = "v1.3"; // Firmware version +volatile const uint8_t ucaf_version[] PROGMEM = "v1.4"; // Firmware version volatile const uint8_t ucaf_compile_time[] PROGMEM = __TIME__; // Time of compilation volatile const uint8_t ucaf_compile_date[] PROGMEM = __DATE__; // Date of compilation volatile const uint8_t ucaf_info[] PROGMEM = "Sony Beta camera 14-pin to 10-pin EIAJ adapter"; // Firmware description @@ -472,7 +472,7 @@ static inline void delay_management(void) if(u8_vid_dir_dly!=0) u8_vid_dir_dly--; if(u8_rec_trg_dly!=0) u8_rec_trg_dly--; if(u8_rr_dly!=0) u8_rr_dly--; - #ifdef EN_SERIAL +#ifdef EN_SERIAL // Serial command timeout. if(u8_ser_cmd_dly!=0) { @@ -493,8 +493,7 @@ static inline void delay_management(void) // No serial activity. u8i_interrupts &= ~INTR_SERIAL; } - - #endif /* EN_SERIAL */ +#endif /* EN_SERIAL */ } //-------------------------------------- Process slow delays. @@ -502,9 +501,9 @@ static inline void slow_state_timing(void) { // Count down every 500 ms. if(u8_rec_fade_dly!=0) u8_rec_fade_dly--; - #ifdef EN_SERIAL +#ifdef EN_SERIAL if(u8_ser_mode_dly!=0) u8_ser_mode_dly--; - #endif /* EN_SERIAL */ +#endif /* EN_SERIAL */ } //-------------------------------------- Check state of input power supply. @@ -1781,7 +1780,7 @@ int main(void) if((u8_state&STATE_SERIAL_DET)!=0) { // Fast heartbeat: FW alive, serial link is OK. - DBG_HRBT_TGL; + DBG_HRBT_ON; } // Filter ADC data from 12 V input channel. filter_adc_ph1(); @@ -1790,6 +1789,11 @@ int main(void) { u8_tasks&=~TASK_5HZ_PH2; // 5 Hz event (phase 2), 200 ms period. + if((u8_state&STATE_SERIAL_DET)!=0) + { + // Fast heartbeat: FW alive, serial link is OK. + DBG_HRBT_OFF; + } // Filter ADC data from camera power channel. filter_adc_ph2(); // Check state of incoming voltage. diff --git a/Beta10Pin/beta10p.h b/Beta10Pin/beta10p.h index 298360c..cbde2ef 100644 --- a/Beta10Pin/beta10p.h +++ b/Beta10Pin/beta10p.h @@ -69,7 +69,7 @@ enum VIN_OFF = 19, // Input voltage 9.9 V V_DIFF_MAX = 32, // Maximum allowed difference in voltages (~1.5 A consumption) VD_CAM_ON_UP = 8, // Voltage difference for detected camera ON (current shunt 0.47 Ohm) - VD_CAM_ON_DN = 5, // Voltage difference for detected camera OFF (current shunt 0.47 Ohm) + VD_CAM_ON_DN = 6, // Voltage difference for detected camera OFF (current shunt 0.47 Ohm) }; // Length of the buffer for each ADC channel before filtering. diff --git a/Beta10Pin/drv_io.h b/Beta10Pin/drv_io.h index b463393..91f699d 100644 --- a/Beta10Pin/drv_io.h +++ b/Beta10Pin/drv_io.h @@ -86,8 +86,8 @@ Supported MCUs: ATmega48(-/A/P/AP), ATmega88(-/A/P/AP), ATmega168(-/A/P/AP), ATm #define VTR_REC_PORT PORTD #define VTR_REC_DIR DDRD #define VTR_REC_BIT (1<<5) // Linked with EIAJ pin 6 -#define VTR_REC_RUN (VTR_REC_PORT|=VTR_REC_BIT) -#define VTR_REC_PAUSE (VTR_REC_PORT&=~VTR_REC_BIT) +#define VTR_REC_RUN (VTR_REC_PORT&=~VTR_REC_BIT) +#define VTR_REC_PAUSE (VTR_REC_PORT|=VTR_REC_BIT) // Camera record button input. #define CAM_REC_PORT PORTD @@ -136,10 +136,12 @@ Supported MCUs: ATmega48(-/A/P/AP), ATmega88(-/A/P/AP), ATmega168(-/A/P/AP), ATm #define DBG_3_TGL (DBG_PORT^=DBG_3_PIN) #define DBG_PWM OCR1B #define DBG_HRBT_TGL DBG_3_TGL // Used to indicate alive firmware and serial link status (in production) +#define DBG_HRBT_ON DBG_3_ON +#define DBG_HRBT_OFF DBG_3_OFF #define DBG_RECERR_ON DBG_2_OFF // Used to indicate NV-180 mechanical record state (in production) #define DBG_RECERR_OFF DBG_2_ON -#define DBG_CAM_ON DBG_1_ON // Used to indicate camera presence (in production) -#define DBG_CAM_OFF DBG_1_OFF +#define DBG_CAM_ON DBG_1_OFF // Used to indicate camera presence (in production) +#define DBG_CAM_OFF DBG_1_ON // Power supply ADC inputs. #define ADC_INT ADC_vect // Interrupt vector alias diff --git a/README.md b/README.md index e4d3b9c..128499c 100644 --- a/README.md +++ b/README.md @@ -49,11 +49,11 @@ Most of all CMA-1010 can not monitor if record process on a VTR has started and ## Features - Provides power from a VTR to a Beta Camera -- Allows video and audio to be transfered from a camera to a VTR when VTR is in record mode -- Allows video from a VTR to be displayed in a camera's viewfinder when VTR is in playback mode +- Allows video and audio to be transfered from a camera to a VTR when VTR is in record state +- Allows video from a VTR to be displayed in a camera's viewfinder when VTR is in playback state - Works both with PAL and NTSC VTRs and cameras - Converts level and pulse pause commands from a camera to level "unpause" signal for a VTR (camera record button mode is auto-detected) -- Allows "Record review" mode (via "RR" button) through picture search +- Allows "Record review" state (via "RR" button) through picture search - Monitors VTR's state via serial link and indicates control errors via tally light blinking - Monitors supply voltage and indicates low battery by blinking tally light in a camera - Monitors camera's power consumption and puts VTR in pause and stand by to preserve energy when camera is turned off @@ -123,28 +123,18 @@ In hex form: ## Hardware -Adapter fits onto single PCB (**BETA10P.M.xx**) of size ~97x30 mm. PCB project is done in **Sprint Layout 6**. - -14-pin Beta camera connector, 2xRCA connector and USB-C PD/QC trigger are soldered onto the PCB. 10-pin EIAJ VTR connector connects via its cable with individual wires connected to the PCB through connectors. +Adapter fits onto single PCB (**BETA10P.M.xx**) of size ~97x30 mm (1.6 mm thick). PCB project is done in **Sprint Layout 6**. The main PCB can be wrapped with shrink tube or slid into plastic/metal case. As an alternative project contains files for 4 more PCBs to assemble case from: -- **BETA10P.F.xx** (29x35 mm) for the front part (holds 14-pin camera connector) -- **BETA10P.B.xx** (29x35 mm) for the back part (2xRCA, USB-C, cable to 10-pin EIAJ connector) -- **BETA10P.S.xx** (98x35 mm) for the both sides (2 pcs per adapter) -- **BETA10P.C.xx** (98x28 mm) for the top and bottom parts (2 pcs per adapter) +- **BETA10P.F.xx** (30x35 mm, 1.6 mm thick) for the front part (holds 14-pin camera connector) +- **BETA10P.B.xx** (30x35 mm, 1.6 mm thick) for the back part (2xRCA, USB-C, cable to 10-pin EIAJ connector) +- **BETA10P.S.xx** (98x35 mm, 1.0 mm thick) for the both sides (2 pcs per adapter) +- **BETA10P.C.xx** (98x30 mm, 1.0 mm thick) for the top and bottom parts (2 pcs per adapter) "*xx*" at the end denotes revision of each PCB. Release can contain boards of different revisions ("xx" doesn't have to be the same). Provided "case boards" also contain copper fill to shield the insides and connect with main PCB's common. -When assembling, cable should be routed through the back PCB before connecting to the main PCB. 14-pin Beta connector should be put through the front PCB before soldering to the main PCB. - -Back PCB should be screwed to the RCA connector block. Front PCB should be screwed to the 14-pin Beta connector through soldered nuts. - -Case cover is assembled by soldering top and side parts together at the 90 degree angles. After that assembled cover should be slid onto the main PCB from the top and soldered in all corners to the front and back PCBs. - -Bottom PCB has to be put last and soldered on its perimeter to the case. -
Pinout for ATmega 88/168/328 MCU in SMD packages @@ -166,7 +156,7 @@ Voltage monitor: VTR I/O: - **pin 12** *(PB0)*: (input) video in/out ***direction*** (linked with EIAJ J-type pin 1) -- **pin 9** *(PD5)*: (output) ***pause*** command (linked with EIAJ J-type pin 6, *active low*) +- **pin 9** *(PD5)*: (output) ***pause*** command (linked with EIAJ J-type pin 6, *active high*) - **pin 10** *(PD6)*: (output) ***standby*** control (linked with EIAJ J-type pin 5, *active high*) - **pin 11** *(PD7)*: (input) serial link ***clock*** (linked with EIAJ J-type pin 4) - **pin 31** *(PD1)*: (input/output) serial link ***data*** (linked with EIAJ J-type pin 3) @@ -183,12 +173,63 @@ Relay control: Debug signals: - **pin 17** *(PB5)*: (output) ***record*** active (solid)/***error*** code - **pin 16** *(PB4)*: (output) FW ***heartbeat*** indicator -- **pin 14** *(PB2)*: (output) camera ***power consumption PWM*** +- **pin 14** *(PB2)*: (output) ***camera presence***
+## Assembly + +14-pin Beta connector should be put through the front PCB before soldering to the main PCB. Front PCB should be screwed to the 14-pin Beta connector through soldered M2.5 nuts. + +VTR cable (with a 10-pin connector) should be routed through the back PCB before connecting to the main PCB. Back PCB should be screwed to the RCA connector block. + +14-pin Beta camera connector, 2xRCA connector and USB-C PD/QC trigger are soldered onto the main PCB. VTR cable's individual wires are connected to the main PCB through connectors. + +Case cover is assembled by soldering top and side parts together at the 90 degree angles. After that assembled cover should be slid onto the main PCB from the top and soldered in all corners to the front and back PCBs. When front and back PCBs are secured, main PCB should be soldered to the side PCB on a single joint on the bottom. + +Bottom PCB has to be put last and soldered on its perimeter to the case PCBs. + +Main PCB provides AVR ISP header for uploading and updating firmware. In normal use the same connector is used to connect "*Heartbeat*" and "*Record/Error*" LEDs on the case. + + ## Usage +### General operation + +Controller can operate in two modes: "serial link mode" and "direct mode". The mode is determined by what and when adapter is connected to. "Serial link mode" requires **Beta10Pin** to be connected to **NV-180** (or compatible, see list above) VTR with serial bus for monitoring and enhanced control. Adapter should be connected before VTR is turned on, otherwise VTR will disable serial link till next power up and the adapter will be operating in "direct mode". + +Each operating mode is explained in details below. + +**Beta10Pin** adapter has three camera-related controls: +- record/pause button +- Rec Review (RR) button +- camera's power consumption + +Main control input is the record/pause button on the camera. It pauses/unpauses recording, arms the controller and the VTR (in "serial link mode"), clears an error state (in "serial link mode"). Camera also can have "Rec Review" ("RR") button that operates only in "serial link mode". The third input is camera's power consumption from which **Beta10Pin** adapter determines if camera is connected/powered on and if power saving should be activated. + +**Beta10Pin** adapter has three visual indicators: +- tally light on the camera +- "record/error" LED on the adapter's case +- "heartbeat" LED on the adapter's case + +Tally light can indicate: +- active unpaused recording (solid light) +- low voltage (low battery) condition (short blink once a second) +- state switching, waiting for the VTR (fast continuous blinking, 5 Hz, only in "serial link mode") +- error state (slow continuous blinking, 2 Hz, only in "serial link mode") + +"Record/Error" LED can indicate: +- active unpaused recording (solid light) +- loop of short blinks according to the error code (error state, only in "serial link mode") + +"Heartbeat" LED can indicate: +- firmware is alive, operating in "serial link mode" (fast continuous blinking, 5 Hz) +- firmware is alive, operating in "direct mode" (slow continuous blinking, 1 Hz) + +Controls and indicators are explained in more details below. + +### Camera record trigger + Cameras can have different "trigger modes" for the record button that usually can be selected with a switch at the bottom of the camera. Usual record button modes: @@ -196,11 +237,11 @@ Usual record button modes: - default at "high", toggling state with each button press - default at "high", producing ~200 ms negative pulse with each button press -**CMA-1010** adapter only supports two modes and for selecting between those you have to open up its case and move a physical switch inside. **Beta10Pin** auto-detects trigger mode of the camera and responds on every record button press on the camera correctly. +**CMA-1010** adapter only supports two trigger modes and for selecting between those you have to open up its case and move a physical switch inside. **Beta10Pin** auto-detects trigger mode of the camera and responds on every record button press on the camera correctly. ### Serial link mode -After connecting adapter to supported VTR (NV-180 or other from "Supported VTRs" list), to Beta camera and powering on the VTR adapter establishes serial link with the VTR and is held in "**idle**" mode. +After connecting adapter to supported VTR (NV-180 or other from "Supported VTRs" list), to Beta camera and powering on the VTR adapter establishes serial link with the VTR and is held in "**idle**" state. ```mermaid flowchart LR; @@ -216,21 +257,21 @@ flowchart LR; idErr-- record button -->idIdle; ``` -When "**Camera**" switch on the front of the VTR is set to "***Normal***" VTR is controlled by its front panel and camera adapter is ignored. User should eject the loading tray, put a recordable VHS cassette inside and close the tray. +When "**Camera**" switch on the front of the VTR is set to "***Normal***" position VTR is controlled by its front panel and camera adapter has no effect and is ignored. User should eject the loading tray, put a recordable VHS cassette inside and close the tray. -Next, "**Camera**" switch on the VTR should be moved into "***Remote***" position to allow the adapter to take control. +Next, "**Camera**" switch on the VTR should be moved into "***Remote***" position to allow the **Beta10Pin** adapter to take control. -First press of the record button on the camera arms the adapter, that commands to set "*record + pause*" mode to the VTR. At the same time tally light on the camera blinks fast and VTR spins up its head drum and loads the tape inside. When VTR gets ready tally light goes out and adapter settles in "**paused recording**" mode, recording does not start yet. +First press of the record/pause button on the camera arms the adapter, that commands to set "*record + pause*" mode to the VTR. At the same time tally light on the camera blinks fast and VTR spins up its head drum and loads the tape inside. When VTR gets ready tally light goes out and adapter settles in "**paused recording**" state, recording does not start yet. -"**Paused recording**" is the main mode of the adapter, ready to begin recording process. User can frame a shot using viewfinder of the camera and arm camera's "*Fader*" function if necessary. When record button is pressed in this state the adapter goes into "**recording**" mode and commands the VTR to clear pause and start recording process. Tally light should light up and stay solid. +"**Paused recording**" is the main state of the adapter, ready to begin recording process. User can frame a shot using viewfinder of the camera and arm camera's "*Fader*" function if necessary. When record button is pressed in this state the adapter goes into "**recording**" state and commands the VTR to clear pause and start recording process. Tally light should light up and stay solid. -If record button is pressed while adapter is in "**recording**" mode, adapter returns back to "**paused recording**" mode, sets "record + pause" for the VTR and turns off tally light. +If record button is pressed while adapter is in "**recording**" state, adapter returns back to "**paused recording**" state, sets "record + pause" for the VTR and turns off camera's tally light. -If camera is switched into "*power save*" mode or gets disconnected, the adapter goes into "**power save pause**" mode. The same happens if "**paused recording**" mode was held for more than 2 minutes. In this mode VTR keeps tape loaded in but stops the drum and deactivates most of the circuits, dropping power consumption five-fold. +If camera is switched into "*power save*" or gets disconnected, the adapter goes into "**power save pause**" state. The same happens if "**paused recording**" state was held for more than 2 minutes. In this state VTR keeps tape loaded in but stops the drum and deactivates most of the circuits, dropping power consumption five-fold. -When in "**paused recording**" or "**power save pause**" modes "*RR*" button can be pressed and held on the camera (if it's present). That puts adapter into "**record review**" mode when the VTR switches to playback in reverse and displays what was just recorded in camera's viewfinder. If record button is pressed while "*RR*" button is held, playback direction is reversed. As soon as "*RR*" button gets released adapter goes into short "**pause**" and then returns into "**paused recording**" mode putting the VTR once again into "*record + pause*" from current place on the tape. While VTR switches from recording to playback and vice versa the tally light on the camera blinks fast. +While in "**paused recording**" or "**power save pause**" states "*RR*" button can be pressed and held on the camera (if it's present). That puts adapter into "**record review**" state when the VTR switches to playback in reverse and displays what was just recorded in camera's viewfinder. If record button is pressed while "*RR*" button is held, playback direction is reversed. As soon as "*RR*" button gets released adapter goes into short "**pause**" and then returns into "**paused recording**" state putting the VTR once again into "*record + pause*" from current place on the tape. While VTR switches from recording to playback and vice versa the tally light on the camera blinks fast. -If any abnormal situation occurs, the adapter senses that and falls into "**error**" mode which is indicated by slow blinking of the tally light on the camera. VTR should unload the tape and stop. "**Error**" mode can be cleared by single press of the record button on the camera. +If any abnormal situation occurs, the adapter senses that and falls into "**error**" state which is indicated by slow blinking of the tally light on the camera. VTR should unload the tape and stop. "**Error**" state can be cleared by single press of the record button on the camera. Examples of the sources of the error: - Trying to start recording without a tape in the VTR (*error code 1*) @@ -238,21 +279,25 @@ Examples of the sources of the error: - VTR or tape malfunction (*error code 3*) - "**Camera**" switch was moved from "***Remote***" position and adapter lost control over the VTR (*error code 4*) +"Record/Error" LED on the adapter's case will blink in cycle the same number of times as error code number is. + If battery level gets too low, adapter makes a short blink of the tally light once a second. ### Direct mode -If the VTR does not have a serial link (or the link has failed for any reason) adapter senses that and falls back into "direct" control mode. In this mode adapter operates more or less like **CMA-1010**. +If the VTR does not have a serial link (or the link has failed for any reason) adapter senses that and falls back into "direct" control mode. In this mode **Beta10Pin** adapter operates more or less like **CMA-1010**. + +The only control mechanism in this mode is "pause" wire in the 10-pin EIAJ connector (pin 6) with no feedback from a VTR to a camera. No monitoring of the VTR state and no direct control of VTR state is available in this mode. -The only control mechanism in this mode is "pause" wire in the 10-pin connector (pin 6) with no feedback from a VTR to a camera. No monitoring of the VTR state and no direct control of VTR mode is available in this mode. +With every press of record button on the camera adapter will toggle "pause" signal to the VTR and tally light on the camera. If VTR was in "**paused recording**" state it will go into "**recording**" state, if VTR was in "**recording**" state it will go into "**paused recording**" state. -With every press of record button on the camera adapter will toggle "pause" signal to the VTR and tally light on the camera. If VTR was in "**paused recording**" mode it will go into "**recording**" mode, if VTR was in "**recording**" mode it will go into "**paused recording**" mode. If there was no tape in the VTR or recording mode was not armed probably nothing will happen on the VTR side (while tally light could still light up) leading to loss of video material. +If there was no tape in the VTR or recording state was not armed probably nothing will happen on the VTR side (while tally light could still light up) leading to loss of video material. -If adapter senses that VTR switched into playback mode, firmware will toggle "**recording**" mode to "**paused recording**" and turn off tally light. +If adapter senses that VTR switched into playback state, firmware will toggle "**recording**" state to "**paused recording**" and turn off tally light. "RR" button on the camera will have no effect on the VTR, no "**record review**" functionality is available in this mode. -If camera is switched into "*power save*" mode or gets disconnected, the adapter goes into "**paused recording**" mode and turns off tally light on the camera. +If camera is switched into "*power save*" or gets disconnected, the adapter goes into "**paused recording**" state and turns off tally light on the camera. If battery level gets too low, adapter makes a short blink of the tally light once a second.