Jump to content
IGNORED

Aligning a 1541 drive with an oscilloscope


Recommended Posts

I'm a new commodore 64 owner and just acquired a 1541 drive. While it does load disks fine, I figured that it could use an alignment after it's years of service and I only have access to an oscilloscope at my school. I've got a test/demo disk and I'm a 1541 maintenance manual. So I've been trying to input a program that the manual says will move the head to track 16 and keep the motor running, but every time I've tried it I get a syntax error on line 20. Anyone know what I might be doing wrong?

 

10 OPEN 15,8,15,"U+":OPEN 2,8,2,"#":OPEN 8,8,8,"#"

20 PRINT #15,"B-P:";8;0:PRINT #15,"UA:";2;0;16;1

30 FOR X=1 TO 9:READ Y

40 PRINT #8,Y;

50 NEXT X

60 PRINT #15,"M-E"+CHR$(0)+CHR$(5)

70 STOP

80 DATA 173,0,28,9,4,141,0,28,96

Edited by Videogamecollector123
Link to comment
Share on other sites

The only thing I can see that looks possibly strange about line 20 is there are 4 numeric parameters at the of the 2nd print statement and not 2 like the first print statement, but that might be correct. The best way to approach this kind of problem is type line 10 in, and run it.

Then type line 20 in and run it, if it errors then and refers to line 20 its definitely line 20. Then I would experiment with the parameter (and find info on print from C64 basic online), perhaps removing the last 2 digits from the 2nd print, or try adding 2 more to the first print.

Link to comment
Share on other sites

I'm still working on it, but I still don't get why it won't work. I've got the test disk with these programs on it http://www.everythin...hp?download.328, does anyone know if I can use one of them to keep the motor running continuously?

Edited by Videogamecollector123
Link to comment
Share on other sites

There is something wrong with line 20 syntax. Perhaps the # characters are wrong, or the semi colons or something. I tried messing last night on C64 app on my phone and got the same error. I will take a look later when ive got more time. Let us know if you get it working.

Link to comment
Share on other sites

Thanks for taking a look, here's the code as the manual puts it.

8554755570_a2c98c88fe.jpg

untitled by Atari1977, on Flickr

 

Here's the manual it's from,

8553650363_7168df76f3.jpg

2 by Atari1977, on Flickr

 

While it's a Vic-1541 on the cover, I was told that this applies to the regular 1541 as well

Edited by Videogamecollector123
Link to comment
Share on other sites

My science teacher actually figured it out, apparently he's got a bit of programming experience. He got it working by taking the spaces out. So instead of "PRINT #15", it's "PRINT#15". Kinda of weird when the manual clearly has spaces printed in it.

Edited by Videogamecollector123
Link to comment
Share on other sites

  • 8 months later...

The SYNTAX ERROR refers to PRINT #15 which should be PRINT# 15 or more properly (and cost effective in RAM terms) PRINT#15 with no spaces between the PRINT and #. PRINT (for printing on screen) and PRINT# (for printing to files other than the default text console) are different BASIC tokens, therefore if you type PRINT #filenumber, the # will appear as an unexpected character to the BASIC parser and give you an error. Typing PRINT# filenumber instead, will use the file #filenumber to perform the output operation (in your case, send the disk command for head positioning). Hope that helps, M

Edited by mfonseca
  • Like 1
Link to comment
Share on other sites

Probably some editor at the publishing company wanted to tidy up the listings and added spaces where they should not be. For that matter, it could be noted that Commodore BASIC has both PRINT, PRINT#, INPUT, INPUT#, GET and GET#, which work in pairs.

 

Also, although not technically required in this case, it can be a good practise to CLOSE each channel after they've been used, ideally in the opposite order of them being opened. I suppose the maintenance guide aimed at experts who might make their own improvements instead of newbies who would follow the instructions literally to every space and comma.

 

It's not the worst example I've encountered, I have seen (3rd party) usage/programming guides boldly state that BASIC supports LPRINT, LLIST and PLOT, commands you'd find in other dialects but usually not in factory default Commodore BASIC, at least not V2.0.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...