[Coco] Trying to understand reading Cassette BASIC

Robert Gault robert.gault at att.net
Tue Jan 15 21:23:50 EST 2013


Luis,

We can continue with this in private email but to give a general answer to the 
list, the tape system used by the Coco more or less follows.

The ROM contains a table to generate a sine wave at $A85C. The values are sent 
to the DAC at speeds which generates either 1200 Hz (zero) or 2400 Hz (1); i.e. 
Frequency Shift Keying (FSK). These tones are used to create the cassette tape 
format which is explained in "The Facts for the TRS-80 Color Computer" by 
Spectral Associates, a precursor to the "Basic Unravelled" series also by 
Spectral Associates. The cassette format is also explained in the Coco3 service 
manual.

To read files from the cassette, the incoming sound is passed through a zero 
crossing detector. The ROM code counts the time between zero crossings where a 
"short" time corresponds to a high frequency (1) and a "long" time corresponds 
to a low frequency (0).

The portion of code which you described is only part of the decode software. The 
complete code starts at $A75D and continues through $A7BC.
If you look at all of the code from $A75D-$A7BC, you will find that both the 
1200 Hz and 2400 Hz tones are decode.

I think the above explains what you are asking, but much could have been lost in 
translation so I may not understand your question. Anyway, let's continue this 
with private email.

Robert


Luis Fernández wrote:
> Not understand, because compared, only the last half of the waveform, with the time value for the entire waveform
> Explication:
> In A7AD RESET PERIOD TIMER
> WAIT UNTIL CASSETTE GOES LO (Only half Wave)
> and compared with the throughout the full waveform     (ERROR)
>
> 1100 A7AD 0F 83              LA7AD CLR CPERTM            RESET PERIOD TIMER
> 1101 A7AF 8D C6                         BSR LA777                WAIT UNTIL CASSETTE GOES LO
> 1102 A7B1 D6 83              LA7B1 LDB CPERTM            GET PERIOD TIMER
> 1103 A7B3 D1 90                         CMPB CMP0             UPPER LIMIT OF 1200 HZ PERIOD
> 1104 A7B5 22 03                         BHI LA7BA                 BRANCH IF CASSETTE SPEED IS TOO SLOW OR DROPOUT
> 1105 A7B7 D1 91                         CMPB CMP1             UPPER LIMIT OF 2400 HZ PERIOD
> 1106 A7B9 39                               RTS
> 1107 A7BA 0F 82              LA7BA CLR CPULWD            RESET UP TO SPEED COUNTER
> 1108 A7BC 39                              RTS
>
>
> Mr. Robert Gauld Can you help?
>
> for me the result is almost always going to be very short, or 2400 or more
>
> of course, I have some error because the routine works, but can not find where that wrong
>
>
>




More information about the Coco mailing list