• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

Mac Plus serial port

Wawavoun

Well-known member
Hi,

I try to get a connection between a 8 bits system and a Mac Plus (7.0.1) using modem port.

I have made a cable which "should" work, adapting rs232 to rs422... I have no handshake and usually 3 wires are ok for communicate.

The basic problem I have is that before to talk the 8 bits computer must receive a $7F hex value for auto timing.

I have ZTerm as terminal emulation program.

Is there a way to directly send hex data to the serial port ? How ?

Thanks, regards.
Philippe
 

Mu0n

Well-known member
It is entirely possible if you're willing to code in THINK C or equivalent. I have done it in the past. A Mac Classic was used to send a data signal to an electric circuit, specifically to a relay. The circuit then activated a nail shooter (using a coil). Fun student project time.
 

joevt

Well-known member
Does all the data need to be hex?

Can you copy the $7F character from a text file and paste it in Z-Term?

This will create a TeachText file in Mac OS X with the hex you want:
Code:
{
printf 'Here is a $7F character:\r'
printf "\x7f"
} > my7f.txt
setfile -t TEXT -c ttxt my7f.txt

This will verify the contents of the file:
Code:
xxd my7f.txt

It should look like this:
Code:
00000000: 4865 7265 2069 7320 6120 2437 4620 6368  Here is a $7F ch
00000010: 6172 6163 7465 723a 0d7f                 aracter:..

Can Z-Term send raw binary files?

You can find Apple serial port sample code that uses Communications Toolbox or OpenTransport to find and open the serial ports.
Enter "serial" into the search term at https://developer.apple.com/library/archive/navigation/
Apple still has Inside Macintosh documentation but I don't know how to navigate to it using the Apple website. Google can find the pdfs but I think there used to be a html pages too? The wayback machine might have more info.

I did serial port programming 20 years ago using CodeWarrior. One project used PowerPlant. I implemented a state machine based on Mac driver asynchronous I/O calls (APIs that used parameter blocks with callbacks) for communicating with a PlayStation Multitap adaptor that had multiple controllers and memory cards attached. The Multitap was connected to Mac serial port via some complicated breadboard circuit that converted the externally clocked (up to 1MHz) asynchronous serial output to synchronous serial I/O with the clock and select signals that the PlayStation devices require. The Mac serial port is able to use an external clock for serial communication and it was easier to use an external clock than to try to generate a clock from the Mac serial output.
 

Wawavoun

Well-known member
Thanks for the suggestion !

The serial com start only if the external board receive first a $7F.
After that the behaviour is normal and zterm should do the job.
Its a good idea. A binary file with one byte...
 
Top