page_title: Commodore Datasette
section_title: Physical coding
hierarchical_section_title: Commodore Datasette / Physical coding
caption_attribution_description: A Commodore 1530 (C2N) Datasette drive for the Commodore line of computers, shown with the top casing removed. This made it possible to save and run programs from inexpensive cassette tapes.
context_page_description: The Commodore 1530 Datasette, later also Datassette, is Commodore's dedicated magnetic tape data storage device. Using compact cassettes as the storage medium, it provides inexpensive storage to Commodore's 8-bit home/personal computers, notably the PET, VIC-20, and C64. A physically similar model, Commodore 1531, was made for the Commodore 16 and Plus/4 series computers.
context_section_description: To record physical data, the zero-crossing from positive to negative voltage of the analog signal is measured. The resulting time between these positive to negative crossings is then compared to a threshold to determine whether the time since the last crossing is short (0) or long (1). Note the lower amplitude for the shorter periods.
  A circuit in the tape unit transforms the analog signal into a logical 1 or 0, which is then transmitted to the computer via the tape connector. Inside the computer, the first Complex Interface Adapter (6526) in the C64 senses when the signal goes from one to zero. This event is called trigger and causes an interrupt request. This event can be handled by a handler code, or simply discovered by testing bit 4 of location $DC0D. The points that trigger this event are indicated by the black circles in the figure.
  Inside the tape device the read head signal is fed into an operational amplifier (1) whose output signal is DC-filtered. Op-amp (2) amplifies and feeds an RC filter. Op-amp (3) amplifies the signal again followed by another DC filter. Op-amp (4) amplifies the signal into clipping the sine-formed signal. The positive and negative rails for all op-amps are wired to +5V DC and GND. The clipped signal therefore fits into the TTL electrical level window of the Schmitt trigger step that in turn feeds the digital cassette port.
  On the PAL version of the C64, the time granularity is 1.014 μs (for NTSC 0.978 μs). Since each bit uses 3284 clock cycles this means 3284 * 1.014 μs = 3330 μs/bit. or a 300 bit/s data rate.
  Once the bits can be decoded, they are fed into a shift register and are continuously compared to a special bit sequence. This bit sequence can also be seen as a byte. A bit-sequence match means that the stream is byte-synchronized. The first byte to compare with is called lead-in byte. If matched, it's compared to the sync byte as well.
  An example: Turbo Tape 64 has a lead-in byte $02 (binary 00000010), sync byte $09 (binary 00001001) and a following sync sequence of $08, $07, $06, $05, $03, $02, $01.
caption: Inside the Datasette.
exif: {"Image Make": "NIKON CORPORATION", "Image Model": "NIKON D7100", "Image Orientation": "Horizontal (normal)", "Image XResolution": "240", "Image YResolution": "240", "Image ResolutionUnit": "Pixels/Inch", "Image Software": "Adobe Photoshop CS5 Windows", "Image DateTime": "2016:12:28 23:22:13", "Image Artist": "Evan Amos", "Image Copyright": "Vanamo Media Public Domain", "Image ExifOffset": "280", "Thumbnail Compression": "JPEG (old-style)", "Thumbnail XResolution": "72", "Thumbnail YResolution": "72", "Thumbnail ResolutionUnit": "Pixels/Inch", "Thumbnail JPEGInterchangeFormat": "1066", "Thumbnail JPEGInterchangeFormatLength": "5697", "EXIF ExposureTime": "1/250", "EXIF FNumber": "18", "EXIF ExposureProgram": "Manual", "EXIF ISOSpeedRatings": "100", "EXIF SensitivityType": "Recommended Exposure Index", "EXIF ExifVersion": "0230", "EXIF DateTimeOriginal": "2016:12:28 04:11:51", "EXIF DateTimeDigitized": "2016:12:28 04:11:51", "EXIF ShutterSpeedValue": "995723/125000", "EXIF ApertureValue": "166797/20000", "EXIF ExposureBiasValue": "0", "EXIF MaxApertureValue": "3", "EXIF MeteringMode": "Pattern", "EXIF LightSource": "Unknown", "EXIF Flash": "Flash did not fire, compulsory flash mode", "EXIF FocalLength": "60", "EXIF SubSecTimeOriginal": "4", "EXIF SubSecTimeDigitized": "40", "EXIF ColorSpace": "Uncalibrated", "EXIF ExifImageWidth": "3400", "EXIF ExifImageLength": "2400", "EXIF FocalPlaneXResolution": "83841555/32768", "EXIF FocalPlaneYResolution": "83841555/32768", "EXIF FocalPlaneResolutionUnit": "3", "EXIF SensingMethod": "One-chip color area", "EXIF FileSource": "Digital Camera", "EXIF SceneType": "Directly Photographed", "EXIF CVAPattern": "[2, 0, 2, 0, 0, 1, 1, 2]", "EXIF CustomRendered": "Normal", "EXIF ExposureMode": "Manual Exposure", "EXIF WhiteBalance": "Manual", "EXIF DigitalZoomRatio": "1", "EXIF FocalLengthIn35mmFilm": "90", "EXIF SceneCaptureType": "Standard", "EXIF GainControl": "None", "EXIF Contrast": "Normal", "EXIF Saturation": "Normal", "EXIF Sharpness": "Normal", "EXIF SubjectDistanceRange": "0", "EXIF BodySerialNumber": "2557295", "EXIF LensSpecification": "[60, 60, 14/5, 14/5]", "EXIF LensModel": "60.0 mm f/2.8"}