Friday, February 11, 2005

Progress: Serial Port works...

The Serial Interface is now working. That means that the device can now act as an interface between an RS-232 device (modem, barcode scanner, printer) and a CBM using the CBM's IEEE-488 interface. Supported baudrates are from 75 to 38400 with 7/8 databits, 1/2 stop bits and Odd/Even or No parity.

Here's a sample program to set the serial parameters (the factory IEEE-488 device number is 7):

10 open 1,7,1
20 print#1, "1200,8,1,n" : rem 1200 baud, 8 databits, 1 stop bit, no parity
30 close 1

The cool thing is: The parameters are stored in EEPROM (non-volatile memory) so once they're set there's no need to set them again (unless you want to change them, of course). There's no battery required to retain the settings.

To send something:

10 open 1,7
20 print#1,"Hello World";
30 close 1

To read data and display it on the screen:

10 open 1,7
20 get#1,a$
30 if st = 0 then print a$;
40 goto 20


ALSO... The device number for the serial interface (as well as for the IDE drive to follow) are set through the PET software:

10 open 1,7,2
20 print #1, "14"
30 close 1

after you run the above, the serial port device number will be 14. To reprogram it to 12 you'd run:

10 open 1,14,2
20 print #1, "12"
30 close 1

0 Comments:

Post a Comment

<< Home